@tight-embedded/react 6.0.0 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{create as e}from"zustand";import{devtools as t,persist as n}from"zustand/middleware";import"zustand/react/shallow";import{cloneDeep as r,entries as a,mapValues as o,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import{v4 as d}from"uuid";import*as u from"zod";import{z as h}from"zod";import*as p from"react";import{useRef as g,useMemo as m,createContext as v,useContext as b,Component as f,useState as y,useCallback as x,useEffect as k,createElement as T,forwardRef as C,useImperativeHandle as w,useReducer as E,useLayoutEffect as A}from"react";import{jsx as I,Fragment as S,jsxs as N}from"react/jsx-runtime";import{QueryClient as P,useIsRestoring as M,useQuery as R,keepPreviousData as D,useMutation as L}from"@tanstack/react-query";import O from"yocto-queue";import F from"big.js";import{ResponsiveContainer as B,BarChart as V,Legend as U,CartesianGrid as W,XAxis as H,YAxis as q,Tooltip as j,Bar as z,ReferenceLine as K,Line as Y}from"recharts";import{flexRender as _,createColumnHelper as Z,useReactTable as G,getCoreRowModel as Q,getExpandedRowModel as X}from"@tanstack/react-table";import{useFloatingNodeId as J,useFloating as $,offset as ee,flip as te,shift as ne,size as re,autoUpdate as ae,useClick as oe,useDismiss as ie,useRole as le,useInteractions as se,useFloatingParentNodeId as ce,FloatingTree as de,FloatingNode as ue,useMergeRefs as he,FloatingOverlay as pe,FloatingPortal as ge,FloatingFocusManager as me,useTransitionStatus as ve}from"@floating-ui/react";import{ContextAwareConfirmation as be,confirmable as fe}from"react-confirm";import{createFormHookContexts as ye,useStore as xe,createFormHook as ke}from"@tanstack/react-form";import{NumericFormat as Te}from"react-number-format";import Ce from"fuse.js";import{openDB as we}from"idb";import{PersistQueryClientProvider as Ee}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ae}from"@microsoft/fetch-event-source";function Ie(e,t){return`${e.trim()}:${t.trim()}`}const Se=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,FEATUREFLAG_SUGGESTED_CATEGORIES:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Ie("featureFlags","updateFlags"))});function Ne(){return Ye(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Pe(){return Ye(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}const Me="drawerNavigation",Re=e=>({drawerHistory:[],closingDrawerCount:0,openDrawer:(t,n={})=>e(e=>{const{replaceHistory:a,routeProps:o}=n,i={[t]:{routeProps:o}};if(a||0===e.drawerHistory.length)return{drawerHistory:[i],closingDrawerCount:0};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t,closingDrawerCount:0}}},void 0,Ie(Me,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:0}},void 0,Ie(Me,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ie(Me,"closeAllDrawers")),requestCloseDrawer:()=>e(e=>0===e.drawerHistory.length?{}:{closingDrawerCount:1},void 0,Ie(Me,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>({closingDrawerCount:e.drawerHistory.length}),void 0,Ie(Me,"requestCloseAllDrawers")),confirmCloseDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:Math.max(0,e.closingDrawerCount-1)}},void 0,Ie(Me,"confirmCloseDrawer")),confirmCloseAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ie(Me,"confirmCloseAllDrawers"))}),De=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Ie("externalOptions","setOptions"))});function Le(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Oe(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e={...n};if(delete e.children,t.push(e),n.children&&n.children.length>0){const e=Oe(n.children);t.push(...e)}}return t}function Fe(e){return Array.isArray(e)&&e.length>0}function Be(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:d()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}const Ve="search",Ue=Be({key:Ve,name:"Search"}),We="transactionsDashFilters";function He(e){if(0===e.length)return e;const t=function(e,t){if(0===e.length)return-1;let n=e.length-1;for(;n>-1;){if(t(e[n]))return n;n--}return-1}(e,e=>e.modelKey===Ve);return-1===t?e:e.filter((e,n)=>n===t||e.modelKey!==Ve)}const qe=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>{const n=He([...e.transactionsDashFilters,...t]);return{...e,transactionsDashFilters:n}},void 0,Ie(We,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Le(e.transactionsDashFilters,t)}),void 0,Ie(We,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:He(t)}),void 0,Ie(We,"setFilters"))}),je={label:"Connected Accounts",value:"connected"},ze="banksAndIntegrationsState",Ke=e=>({banksAndIntegrationsSelectedTab:je,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Ie(ze,"setBanksAndIntegrationsSelectedTab")),toggleExpandedIntegration:(t,n)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||n&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,Ie(ze,"toggleExpandedIntegration"))}),Ye=e()(t(n((...e)=>({...Se(...e),...Re(...e),...De(...e),...qe(...e),...Ke(...e)}),{name:"tight-featureflag-storage",partialize:e=>{const t=Object.entries(e).filter(([e])=>e.startsWith("FEATUREFLAG"));return Object.fromEntries(t)}}),{name:"globalStore",store:"globalStore",enabled:!1})),_e={SELECT:"select",EXPAND:"expand"},Ze={..._e,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},Ge=[Ze.COMMENTS,Ze.DATE,Ze.DESCRIPTION,Ze.AMOUNT,Ze.CATEGORY,Ze.CLASS_SEGMENT,Ze.REVIEW_STATUS],Qe=u.object({pageSize:u.optional(u.int32().positive()),columns:u.optional(u.array(u.enum(Ge)))}),Xe=u.optional(u.string().trim()),Je=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,$e=u.optional(u.array(u.string().trim())),et=u.object({integrations:u.optional(u.array(u.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"]))),useOnPlaidLink:u.optional(u.boolean()),hideManualBanks:u.optional(u.boolean())}),tt={transactionsDashboard:e=>{const t=Qe.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=Xe.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=$e.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>Je.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=et.safeParse(e);return t.success?t.data:void 0}},nt=(e,t)=>{if(void 0!==tt[e])return(0,tt[e])(t)};function rt(e){const t=g(!1),n=Ye(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=nt(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=Ye(e=>e.externalOptions);return{options:m(()=>r(o),[o]),setOptions:n}}function at(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function ot(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function it(e){return String.fromCharCode(e+(e>25?39:97))}function lt(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=it(t%52)+n;return it(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var st=/\s*!(important)?/i;function ct(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var dt=e=>{const t=/* @__PURE__ */new Map;return(...n)=>{const r=JSON.stringify(n);if(t.has(r))return t.get(r);const a=e(...n);return t.set(r,a),a}},ut=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function ht(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(ut.has(n))return;const r=e[n],a=t[n];at(r)&&at(a)?e[n]=ht(r,a):e[n]=a}),e):e,{})}var pt=e=>null!=e;function gt(e,t,n={}){const{stop:r,getKey:a}=n;return function e(n,o=[]){if("object"==typeof(i=n)&&null!==i){const i={};for(const[l,s]of Object.entries(n)){const c=a?.(l,s)??l,d=[...o,c];if(r?.(n,d))return t(n,o);const u=e(s,d);pt(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function mt(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return gt(e,e=>{return Array.isArray(e)?(t=e,n=a.breakpoints.keys,t.reduce((e,t,r)=>{const a=n[r];return null!=t&&(e[a]=t),e},{})):e;var t,n},{stop:e=>Array.isArray(e),getKey:n?e=>o?i(e):e:void 0})}var vt={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},bt=/([A-Z])/g,ft=/^ms-/,yt=dt(e=>e.startsWith("--")?e:e.replace(bt,"-$1").replace(ft,"-ms-").toLowerCase()),xt=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),kt=`(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`,Tt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${kt}$`),Ct={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):at(e)?gt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&xt.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&Tt.test(e)},wt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,ot(t))};const Et=new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")),At=/^@|&|&$/;function It(e){return Et.has(e)||At.test(e)}const St=/^_/,Nt=/&|@/,Pt=/* @__PURE__ */new Map;"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,n]=e.split(":");Pt.set(t,n)});const Mt={conditions:{shift:function(e){return e.sort((e,t)=>{const n=It(e),r=It(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>Et.has(e)?e.replace(St,""):Nt.test(e)?`[${ct(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${Pt.get(e)||yt(e)}_${ct(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Rt=function(e){const{utility:t,hash:n,conditions:r=vt}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return dt(({base:o,...i}={})=>{const l=mt(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return gt(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&st.test(u),[l,...c]=r.shift(o),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(st,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,o)=>{let i;if(n){const n=[...r.finalize(e),o];i=a(t.toHash(n,lt))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Mt),Dt=(...e)=>Rt(Lt(...e));Dt.raw=(...e)=>Lt(...e);const{mergeCss:Lt}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>at(e)&&Object.keys(ot(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>mt(t,e))}return{mergeCss:dt(function(...e){return ht(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Mt);function Ot(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Ft=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Bt(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Ft(e),o=e=>({...r,...ot(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=Lt(i,n[t][a]));const l=function(e,t){let n={};return e.forEach(e=>{Object.entries(e).every(([e,n])=>"css"===e||(Array.isArray(n)?n:[n]).some(n=>t[e]===n))&&(n=Lt(n,e.css))}),n}(a,r);return Lt(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(dt(function(e){return Dt(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Ft(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(n));return Bt({base:Lt(t,o.base),variants:Object.fromEntries(i.map(e=>[e,Lt(n[e],o.variants[e])])),defaultVariants:ht(r,o.defaultVariants),compoundVariants:[...a,...o.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),a=e=>{const t={};for(let r=0;r<e.length;r++){const a=e[r];n[a]&&(Object.defineProperty(t,a,n[a]),delete n[a])}return t};return t.map(e=>a(Array.isArray(e)?e:r.filter(e))).concat(a(r))}(e,l)},getVariantProps:o})}var Vt,Ut=((Vt=Ut||{}).component="component",Vt["dashboard-placeholder-table"]="dashboard-placeholder-table",Vt["dashboard-header"]="dashboard-header",Vt["dashboard-table"]="dashboard-table",Vt["dashboard-table-body"]="dashboard-table-body",Vt["dashboard-table-cell"]="dashboard-table-cell",Vt["dashboard-table-column-header"]="dashboard-table-column-header",Vt["dashboard-table-header"]="dashboard-table-header",Vt.label="label",Vt.popup="popup",Vt["popup-sort-row"]="popup-sort-row",Vt["progress-bar"]="progress-bar",Vt["progress-bar-fill"]="progress-bar-fill",Vt.summation="summation",Vt["table-parent-row"]="table-parent-row",Vt["table-row"]="table-row",Vt["table-sub-row"]="table-sub-row",Vt.tile="tile",Vt["tile-bar-label"]="tile-bar-label",Vt["tile-body"]="tile-body",Vt["tile-filter-button"]="tile-filter-button",Vt["tile-filter-list"]="tile-filter-list",Vt["tile-filter-row"]="tile-filter-row",Vt["tile-header"]="tile-header",Vt["tile-title"]="tile-title",Vt.title="title",Vt["business-owner-dashboard"]="business-owner-dashboard",Vt["business-owner-dashboard-header"]="business-owner-dashboard-header",Vt["business-owner-table"]="business-owner-table",Vt["transaction-type-label"]="transaction-type-label",Vt["transaction-date-cell-container"]="transaction-date-cell-container",Vt["selector-row"]="selector-row",Vt["popup-list"]="popup-list",Vt.badge="badge",Vt["badge-chip"]="badge-chip",Vt["date-cell"]="date-cell",Vt["expander-cell"]="expander-cell",Vt["vertical-divider"]="vertical-divider",Vt["horizontal-divider"]="horizontal-divider",Vt["table-cell-divider"]="table-cell-divider",Vt["checkbox-input"]="checkbox-input",Vt["bulk-select"]="bulk-select",Vt["button-base"]="button-base",Vt["button-discrete-small"]="button-discrete-small",Vt["button-primary"]="button-primary",Vt["button-secondary"]="button-secondary",Vt["button-tertiary"]="button-tertiary",Vt["button-danger"]="button-danger",Vt["button-warning"]="button-warning",Vt["button-action"]="button-action",Vt.text="text",Vt["cell-button"]="cell-button",Vt["selector-button"]="selector-button",Vt["review-status-selector-button"]="review-status-selector-button",Vt["month-picker-left-button"]="month-picker-left-button",Vt["month-picker-right-button"]="month-picker-right-button",Vt["filter-bar"]="filter-bar",Vt["filter-search-bar"]="filter-search-bar",Vt["filter-pill"]="filter-pill",Vt["discrete-form-input"]="discrete-form-input",Vt["editable-form-input"]="editable-form-input",Vt["category-text"]="category-text",Vt["amount-input-container"]="amount-input-container",Vt["amount-input"]="amount-input",Vt["modal-popup"]="modal-popup",Vt["drawer-header"]="drawer-header",Vt["drawer-header-border"]="drawer-header-border",Vt["form-body"]="form-body",Vt.body="body",Vt.heading="heading",Vt["sub-label"]="sub-label",Vt["strong-label"]="strong-label",Vt["strong-sub-label"]="strong-sub-label",Vt["metric-xl"]="metric-xl",Vt["metric-md"]="metric-md",Vt["large-icon"]="large-icon",Vt["medium-icon"]="medium-icon",Vt["small-icon"]="small-icon",Vt["tiny-icon"]="tiny-icon",Vt.icon="icon",Vt["neutral-badge"]="neutral-badge",Vt["highlight-badge"]="highlight-badge",Vt["success-badge"]="success-badge",Vt["warning-badge"]="warning-badge",Vt["critical-badge"]="critical-badge",Vt["button-group"]="button-group",Vt["alert-dialog"]="alert-dialog",Vt["alert-header"]="alert-header",Vt["emphasis-label"]="emphasis-label",Vt["profit-loss-graph"]="profit-loss-graph",Vt.banner="banner",Vt["banner-high"]="banner-high",Vt["banner-medium"]="banner-medium",Vt["banner-low"]="banner-low",Vt["banner-urgent"]="banner-urgent",Vt["banner-default"]="banner-default",Vt["banner-button"]="banner-button",Vt["banner-button-text"]="banner-button-text",Vt["banner-button-icon"]="banner-button-icon",Vt["empty-dashboard-layout"]="empty-dashboard-layout",Vt["zero-state-layout"]="zero-state-layout",Vt["emphasis-sub-label"]="emphasis-sub-label",Vt);const Wt="Tight-",Ht=e=>`${Wt}${e}`;function qt(e){return e in Ut}function jt(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Wt&&r in Ut}function zt(e){return!qt(e)&&!jt(e)}const Kt=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Ht(e)),t.forEach(e=>{void 0!==e&&(zt(e)?r.push(e):qt(e)&&n.push(Ht(e)))}),{className:Ot(...n,...r)}},Yt=Kt(Ut["business-owner-dashboard-header"],Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80,paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function _t({children:e}){return I("div",{...Yt,children:e})}function Zt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(jt(t)&&e.push(t),e),[])],[])}function Gt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(zt(t)&&e.push(t),e),[])],[])}function Qt(e){const t=Array.isArray(e)?e:[e];return{className:Ot(...Zt(t),...Gt(t))}}const Xt=Bt({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{xl:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{xl:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{xl:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontSize:"lg",fontWeight:"sm",lineHeight:"18px",xl:{fontWeight:"label.strong",fontSize:"label.strong",lineHeight:"16px"},fontFamily:"label",color:"typography.label.strong",letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),Jt=Kt(Ut.heading,Xt({heading:"default"}));function $t({children:e,stylists:t=[]}){const n=Qt([Jt,...t]);return I("div",{...n,children:e})}function en(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function tn(e,t,n){return new Date(e,t,n)}function nn(e,t){return en(tn(t,e,1))}function rn(){const e=/* @__PURE__ */new Date;return en(tn(e.getFullYear(),e.getMonth()+1,0))}const an={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},on=e=>{switch(e){case an.THIS_YEAR:return en(tn(/* @__PURE__ */(new Date).getFullYear(),0,1));case an.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return nn(e.getMonth(),e.getFullYear())}();case an.LAST_YEAR:return en(tn(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case an.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return en(tn(e.getFullYear(),e.getMonth()-1,1))}();case an.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return en(tn(e.getFullYear(),e.getMonth()-11,1))}();default:return""}},ln=e=>{switch(e){case an.THIS_YEAR:return en(tn(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case an.THIS_MONTH:return rn();case an.LAST_YEAR:return en(tn(/* @__PURE__ */(new Date).getFullYear(),0,0));case an.PAST_YEAR:return rn();case an.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return en(tn(e.getFullYear(),e.getMonth(),0))}();default:return""}};const sn=e=>{return t=e,Object.values(an).includes(t)?{beginDate:on(e),endDate:ln(e)}:function(e){if("object"!=typeof e)return!1;const t=e;return"string"==typeof t.beginDate&&"string"==typeof t.endDate}(e)?e:{beginDate:en((n=e).beginDate),endDate:en(n.endDate)};var t,n},cn=["SUN","MON","TUE","WED","THU","FRI","SAT"],dn=["January","February","March","April","May","June","July","August","September","October","November","December"];function un({yearsBack:e=10,startYear:t}){const n=t??/* @__PURE__ */(new Date).getFullYear(),r=[n];for(let a=n-1;a>=n-e;a--)r.push(a);return r}function hn(e,t){return e.toDateString()===t.toDateString()}function pn(e){return hn(e,/* @__PURE__ */new Date)}function gn(e,t){const n=tn(e.getFullYear(),e.getMonth(),e.getDate()),r=tn(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function mn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function vn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=tn(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function bn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return vn(o,i,l)?tn(l,o-1,i):null}function fn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return vn(i,l,o)?tn(o,i-1,l):null}function yn(e){if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getDate()).padStart(2,"0");return`${t}-${String(e.getMonth()+1).padStart(2,"0")}-${n}`}function xn(e,t){return gn(e,t)?t:e}function kn(e,t){return gn(t,e)?t:e}const Tn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",n)},Cn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return pn(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):Tn(t,{abbreviateMonth:!0,abbreviateYear:!1})},wn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function En(e,t){return tn(e.getFullYear(),e.getMonth(),e.getDate()+t)}function An(e,t,n){return[...e,{accessToken:t,environment:n}]}function In(e,t){return[...e,t]}const Sn=e=>null==e,Nn=e=>!Sn(e);function Pn(e){return""===e.trim()}function Mn(e){return Sn(e)||Pn(e)}function Rn(e){return!Mn(e)}const Dn=v({activeToken:void 0,accountantToken:void 0});function Ln(){const{activeToken:e}=b(Dn);return e}const On=()=>{throw new Error("No access token provided")},Fn=72e5,Bn=new P({defaultOptions:{queries:{gcTime:Fn,staleTime:3e4,refetchInterval:6e4}}}),Vn=v("SANDBOX");function Un(){return b(Vn)}function Wn({queryKey:e,queryFn:t,...n}){const r=Ln(),a=Un(),o=Rn(r),i=An(e,r??"",a),l=M(),s=R({...n,queryKey:i,queryFn:o?t:On,placeholderData:n.keepPreviousDataPlaceholder?D:void 0,...o?{}:{retry:!1,staleTime:1/0}},Bn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class Hn{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:n,payloadVersion:r}){const a=/* @__PURE__ */(new Date).toISOString(),o=JSON.stringify({apiKey:e,payloadVersion:r,notifier:n,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":r,"Bugsnag-Sent-At":a},referrerPolicy:"no-referrer",body:o})}}const qn=Symbol("Circular"),jn=Symbol("AccessError");function zn(e,t,n){return Kn({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Kn({key:e,value:t,replacer:n,seen:r,depthLimit:a=1/0,depth:o,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(r.includes(s)&&(s=qn),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Yn(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(o>a||i+1>l)return"[...]";if(r.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Yn(()=>s[i]);e.push(Kn({key:i,value:t,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Yn(()=>s[c]);e[c]=Kn({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function Yn(e){try{return e()}catch{return jn}}const _n=Object.prototype.toString,Zn=Object.getPrototypeOf;function Gn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Qn=/^\s*at .*(\S+:\d+|\(native\))/m,Xn=/^(eval@)?(\[native code])?$/;function Jn(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const n=t[2]?parseInt(t[2],10):void 0,r=t[3]?parseInt(t[3],10):void 0;return[t[1],n,r]}function $n(e,t){const n=er(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&Gn(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[tr(n)];return a.push(...ar(n).map(e=>tr(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function er(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===_n.call(t))return!0;t=Zn(t)}return!1}(e))return e;let n=function(e){if(!Gn(e))return null;const t=t=>{const n=e[t];if("string"==typeof n&&e[t.length])return n},n=t("name")||t("errorClass"),r=t("message")||t("errorMessage");if(!n||!r)return null;const a=new Error(r);return a.name=n,a}(e);if(n)return n;switch(typeof n){case"string":case"number":case"boolean":return new Error(String(e));default:return n=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),n.name="InvalidError",n}}function tr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:nr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function nr(e,{backtrace:t}){const n=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return n?function(e){return(e.match(Qn)?e.split("\n").filter(e=>!!e.match(Qn)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),a=Jn(n?n[1]:r.pop()||"(no location)"),o=r.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(a[0])>-1?void 0:a[0],lineNumber:a[1],columnNumber:a[2],method:o}}):(t=e,t.split("\n").filter(e=>!e.match(Xn)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=Jn(e.replace(t,""));return{file:a[0],lineNumber:a[1],columnNumber:a[2],method:r}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let n=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";n=n.replace(/\?.*$/,"").replace(/#.*$/,"");let r=t.method||"(unknown function)";return r=/^global code$/i.test(r)?"global code":r,e.concat([{file:n,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:r}])},[]);var t}(n):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<rr;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const rr=20;function ar(e){const t=e;if(t.cause){const e=er(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(ar(e))}return[]}function or(...e){console.log}function ir(...e){console.error}const lr={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let sr=Date.now();const cr=()=>{sr=Date.now()},dr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-sr,!0}),{reset:cr})},ur=[["Edge (EdgeHTML)",/Edge\/([0-9._]+)/],["Edge (iOS)",/EdgiOS\/([0-9._]+)/],["Yandex",/YaBrowser\/([0-9._]+)/],["KakaoTalk",/KAKAOTALK\s([0-9.]+)/],["Samsung",/SamsungBrowser\/([0-9.]+)/],["Silk",/\bSilk\/([0-9._-]+)\b/],["MIUI",/MiuiBrowser\/([0-9.]+)$/],["Beaker",/BeakerBrowser\/([0-9.]+)/],["Edge (Chromium)",/EdgA?\/([0-9.]+)/],["Chromium WebView",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome (iOS)",/CriOS\/([0-9.]+)(:?\s|$)/],["Firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["Firefox (iOS)",/FxiOS\/([0-9.]+)/],["Opera Mini",/Opera Mini.*Version\/([0-9.]+)/],["Opera",/Opera\/([0-9.]+)(?:\s|$)/],["Opera",/OPR\/([0-9.]+)(:?\s|$)/],["Internet Explorer",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["Internet Explorer",/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],["Internet Explorer",/MSIE\s(7\.0)/],["Blackberry",/BB10;\sTouch.*Version\/([0-9.]+)/],["Android",/Android\s([0-9.]+)/],["Safari (iOS)",/Version\/([0-9._]+).*Mobile.*Safari.*/],["Safari",/Version\/([0-9._]+).*Safari/],["Facebook",/FB[AS]V\/([0-9.]+)/],["Instagram",/Instagram\s([0-9.]+)/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Mobile/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Gecko\)$/]],hr=[["iOS",void 0,/iP(hone|od|ad)/],["Android",void 0,/Android/],["BlackBerry",void 0,/BlackBerry|BB10/],["Windows Mobile",void 0,/IEMobile/],["Kindle",void 0,/Kindle/],["Windows","3.11",/Win16/],["Windows","95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows","98",/(Windows 98)|(Win98)/],["Windows","2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows","XP",/(Windows NT 5.1)|(Windows XP)/],["Windows","Server 2003",/(Windows NT 5.2)/],["Windows","Vista",/(Windows NT 6.0)/],["Windows","7",/(Windows NT 6.1)/],["Windows","8",/(Windows NT 6.2)/],["Windows","8.1",/(Windows NT 6.3)/],["Windows","10+",/(Windows NT 10.0)/],["Windows","ME",/Windows ME/],["Open BSD",void 0,/OpenBSD/],["Sun OS",void 0,/SunOS/],["Chrome OS",void 0,/CrOS/],["Linux",void 0,/(Linux)|(X11)/],["Mac OS",void 0,/(Mac_PowerPC)|(Macintosh)/],["QNX",void 0,/QNX/],["BeOS",void 0,/BeOS/],["OS/2",void 0,/OS\/2/]],pr=(gr=function(e){const t=""!==(n=e)&&ur.reduce((e,[t,r])=>{if(e)return e;const a=r.exec(n);return!!a&&[t,a]},!1);var n;if(!t)return{};const[r,a]=t,o=function(e){for(const[t,n,r]of hr)if(r.exec(e))return{osName:t,osVersion:n};return null}(e),i="iOS"===o?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:r,browserVersion:a[1],osName:o?.osName,osVersion:o?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...gr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var gr;class mr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new O}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class vr extends f{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:n,metadata:r}=$n(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let n="";for(let r=0,a=t.length;r<a;r++)t[r].length&&(n+=`${n.length?"\n":""}${t[r]}`);return n}(t.componentStack));const{onError:a,client:o}=this.props;o.notifyEvent({exceptions:n,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...r,react:t},onError:a},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return I(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return I(S,{children:this.props.children})}}const br={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>I(vr,{client:e,onError:t,FallbackComponent:n,children:r})})},fr=new class{breadcrumbs=[];config;delivery=new Hn(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return ir(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const n of this.config.plugins||[])this.plugins.push({name:n.name||"unknown",plugin:n.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:n,metadata:r}=$n(e,"notify");let a,o,i=r;return"function"==typeof t?a=t:(o=t.severity,t.metadata&&(i={...r,...t.metadata})),this.notifyEvent({exceptions:n,metadata:i,severity:o,onError:a},e)}leaveBreadcrumb(e,t,n){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:n||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:r=25}=this.config;this.breadcrumbs.length>r&&this.breadcrumbs.splice(0,this.breadcrumbs.length-r)}async notifyEvent({exceptions:e,unhandled:t,severity:n,severityReason:r,metadata:a,onError:o},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:n||"warning",severityReason:r,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:a||{}},c=[...this.errorCallbacks];o&&c.push(o);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=zn(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={apiKey:this.config.apiKey,payloadVersion:"5",notifier:{name:"Tight Components",version:"1",url:"https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md"},events:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){ir()}}getUser(){return this.config?.user||{}}setUser(e,t,n){this.config&&(this.config.user={id:e,email:t,name:n})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let yr="",xr="";const kr="prod",Tr=fr.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"6.0.0",appType:"browser",releaseStage:kr,plugins:[dr,pr,lr,(()=>{const e=new mr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),br]}),Cr=(e,t)=>{try{fr.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?wr({error:n,severity:"error"}):wr({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},wr=async e=>{try{await fr.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:yr,environment:xr}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await wr({error:t,severity:"error"}):await wr({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},Er=Tr.getPlugin("react"),Ar=Er?.BugsnagErrorBoundary,Ir=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,Sr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Nr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Pr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function Mr(e){const t=(({accessToken:e,extraHeaders:t})=>{const n={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...n}:n})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?Pr:{}}});return{url:(n=e.endpointManager.getUrl(e.path),r=e.pathParams,void 0!==r&&Object.entries(r).forEach(([e,t])=>{n=n.replace(`{${e}}`,t)}),n),headers:t};var n,r}async function Rr({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=Sr({extraHeaders:t,authorization:e});Cr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return Cr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),Nr(e)}catch(l){return Promise.reject(l)}}async function Dr(e){const{url:t,headers:n}=Mr(e);return Rr({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Lr(e){return Dr(e)}async function Or(e){return Dr(e)}const Fr=(e,t)=>({getUrl:t=>((e,t)=>{let n=t;for(;n.length>0&&"/"===n.charAt(0);)n=n.slice(1);return`${e}/${n}`})(e,t),baseUrl:e,apiVersion:t}),Br={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},Vr={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Ur={...Vr,LOCAL:"http://localhost:8082"};function Wr(e){return Fr(`${t=e,Br[t]}/v5`,"v5");var t}const Hr=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],qr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...sn(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:Wr(a)};return await Or(o)};function jr({filter:e,grouping:t,select:n}){return Wn({queryKey:Hr({filter:e,grouping:t}),queryFn:qr,select:n})}const zr="noDataHeight";function Kr(e){const t=fn(e??"");return null!==t?Tn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}function Yr(e){const t=Kr(e.period?.beginDate),n=e.netIncome??0,{profit:r,remainingIncome:a,loss:o,remainingExpenses:i}=function(e,t,n){const r=e>0?e:0,a=e<0?e:0;return{profit:r,remainingIncome:void 0!==t?F(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?F(n).plus(a).toNumber():0}}(n,e.income?.total,e.expenses?.total);return{month:{month:t,income:a,expenses:-i,profit:r,loss:o,netIncome:n,hasNoData:/* @__PURE__ */function(e,t,n){return 0===e&&0===t&&0===n}(n,a,i)},netIncome:n}}function _r(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(Sn(n))return t;for(const i of n){const{month:e,netIncome:n}=Yr(i);t.total=F(n).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:r,domainMax:a}=n.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[r,a],t.hasAnyData=t.months.some(e=>!e.hasNoData);const o=function(e,t){const n=t-e;return n>0?.03*n:3}(r,a);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:o}:e),t}const Zr=Kt(Ut["tile-header"],Dt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Gr({title:e}){return I("div",{...Zr,children:I($t,{children:e})})}const Qr=Kt(Ut["tile-body"],Dt({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderBottomRadius:"lg",borderTop:"hidden"}));function Xr({children:e}){return I("div",{...Qr,children:e})}const Jr=Bt({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative",borderRadius:"lg"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function $r({children:e,type:t,isSample:n=!1}){const r=Kt(Ut.tile,Jr({type:t,isSample:n}));return I("div",{...r,children:e})}const ea=Dt({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),ta=Dt.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),na=Dt({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),ra=Kt(Ut.text,Dt({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea);function aa({children:e}){return I("div",{...ra,children:e})}const oa=Kt(Ut["metric-xl"],Xt({metric:"xl"}));function ia(e){return I("div",{...oa,children:e.children})}const la=Kt(Ut.summation,Dt({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function sa({title:e,label:t}){return N("div",{...la,children:[I(ia,{children:e}),I(aa,{children:t})]})}const ca=Kt(null,Dt({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function da({children:e}){return I("div",{...ca,children:e})}const ua=(e,t=0)=>{const n=Math.abs(e);let r;if(t<=0)r=Math.round(n);else{const e=n.toFixed(t);r=parseFloat(e)}return Math.sign(e)*r},ha=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),pa=1e9;function ga(e,{cents:t="default",condense:n=!1,dollarSign:r=!1,signage:a="default"}={}){const o="string"==typeof e?parseFloat(e):e;if(Number.isNaN(o))return"";let i;const l=Math.abs(o);let s;if(n&&l>99999){s=Math.sign(o)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),n=Math.round(l/t),r=n*t;let a,c=n/1e3;l<pa&&c>=1e3&&(c/=1e3),r>=pa?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${ha(c,0,1)}${a}`}else{let e;const n=2,r=0;let a,l;"floor"===t?(a=r,l=r,c=o,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(a=r,l=r,e=ua(o,a)):"always"===t?(a=n,l=n,e=ua(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=ua(o,a)):(a=n,e=ua(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=ha(d,l,a)}var c,d;let u=i;const h=r?"$":"";return void 0===a||"off"===a?u=i:"parens"===a?u=`${h}${s?`(${i})`:i}`:"always"===a?u=`${s?"-":"+"}${h}${i}`:"default"===a&&(u=`${s?"-":""}${h}${i}`),u}function ma(e){return ga(e,{condense:!0,dollarSign:!0})}function va(e){return ga(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const ba=Bt({variants:{wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function fa({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(Mn(n))return null;const a=Qt([Kt(Ut["strong-label"],Xt({label:"strongLabel"}),ba({wrap:e,textAlign:t})),...r]);return I("div",{title:"ellipsis"===e?n:void 0,...a,children:n})}const ya=Bt({base:{fontWeight:"label.sub",fontSize:"md",fontFamily:"label",lineHeight:"16px",letterSpacing:"0.66px",fontStyle:"normal",xl:{lineHeight:"14px",fontSize:"label.sub"}},variants:{intent:{normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"},wrapThrice:{ellipsisTextRaw:ta,whiteSpace:"normal",textAlign:"left",display:"-webkit-box","-webkit-line-clamp":3,"-webkit-box-orient":"vertical"}}}});function xa({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":e,o=Kt(Ut["sub-label"],ya({intent:a,wrap:t,accent:r}),ea);return Mn(n)?null:I("div",{...o,children:n})}const ka=Kt(null,Dt({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"10px",width:"fit-content",height:"fit-content"}));function Ta({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===zr)return null;let n=t[0].value??0;return"expenses"===t[0].dataKey?n+=t[0].payload.loss:"income"===t[0].dataKey&&(n+=t[0].payload.profit),N("div",{...ka,children:[I(fa,{children:t[0].name??""}),I(xa,{children:ma(Number(n))})]})}const Ca={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue200":{value:"#EDFAFC",variable:"var(--Tight-colors-blue200)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green200":{value:"#DBF9EA",variable:"var(--Tight-colors-green200)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow200":{value:"#FFF3C3",variable:"var(--Tight-colors-yellow200)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red200":{value:"#FFCBCB",variable:"var(--Tight-colors-red200)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"12px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"fontWeights.sm":{value:"400",variable:"var(--Tight-fontWeights-sm)"},"fontWeights.md":{value:"600",variable:"var(--Tight-fontWeights-md)"},"fontWeights.lg":{value:"900",variable:"var(--Tight-fontWeights-lg)"},"radii.zero":{value:"0",variable:"var(--Tight-radii-zero)"},"radii.sm":{value:"1px",variable:"var(--Tight-radii-sm)"},"radii.md":{value:"2px",variable:"var(--Tight-radii-md)"},"radii.lg":{value:"4px",variable:"var(--Tight-radii-lg)"},"borderWidths.sm":{value:"0.5px",variable:"var(--Tight-borderWidths-sm)"},"borderWidths.md":{value:"1px",variable:"var(--Tight-borderWidths-md)"},"borderWidths.lg":{value:"1px",variable:"var(--Tight-borderWidths-lg)"},"borderWidths.xl":{value:"2px",variable:"var(--Tight-borderWidths-xl)"},"animations.appear.instant":{value:"0.25s linear fade-in",variable:"var(--Tight-animations-appear-instant)"},"animations.appear.delay":{value:"0.25s linear both 1.5s fade-in",variable:"var(--Tight-animations-appear-delay)"},"animations.shimmer":{value:"2s ease-in-out infinite shimmer",variable:"var(--Tight-animations-shimmer)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"animations.slideIn.right":{value:"300ms ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"300ms ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"300ms ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"300ms ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(0, 0, 0, 0.05), 0px 4px 12px 0px rgba(0, 0, 0, 0.15) ",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.opaque":{value:"var(--Tight-colors-blue200)",variable:"var(--Tight-colors-brand-action-opaque)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.opaque":{value:"var(--Tight-colors-green200)",variable:"var(--Tight-colors-brand-success-opaque)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.opaque":{value:"var(--Tight-colors-yellow200)",variable:"var(--Tight-colors-brand-warning-opaque)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.opaque":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-brand-danger-opaque)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.surface.intent.danger.weak":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger-weak)"},"colors.surface.intent.danger.opaque":{value:"var(--Tight-colors-brand-danger-opaque)",variable:"var(--Tight-colors-surface-intent-danger-opaque)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-active)"},"colors.typography.intent.success":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success)"},"colors.typography.intent.success.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-hover)"},"colors.typography.intent.success.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-active)"},"colors.typography.intent.warning":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning)"},"colors.typography.intent.warning.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-hover)"},"colors.typography.intent.warning.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-active)"},"colors.typography.intent.danger":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger)"},"colors.typography.intent.danger.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-hover)"},"colors.typography.intent.danger.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-active)"},"colors.typography.accent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-typography-accent-success)"},"colors.typography.accent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-typography-accent-warning)"},"colors.typography.accent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-typography-accent-danger)"},"colors.typography.accent.action":{value:"var(--Tight-colors-brand-action-strongest)",variable:"var(--Tight-colors-typography-accent-action)"},"colors.typography.body":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-body)"},"colors.typography.label":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label)"},"colors.typography.label.sub":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-typography-label-sub)"},"colors.typography.label.strong":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strong)"},"colors.typography.label.strongSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strongSub)"},"colors.typography.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"colors.typography.heading":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-heading)"},"colors.typography.metric.sm":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-sm)"},"colors.typography.metric.md":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-md)"},"colors.typography.metric.lg":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-lg)"},"colors.typography.metric.xl":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-xl)"},"colors.icon.base":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-icon-base)"},"colors.icon.base.weak":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-icon-base-weak)"},"colors.icon.contrast":{value:"var(--Tight-colors-typography-contrast)",variable:"var(--Tight-colors-icon-contrast)"},"colors.icon.contrast.weak":{value:"var(--Tight-colors-typography-contrast-weak)",variable:"var(--Tight-colors-icon-contrast-weak)"},"colors.icon.intent.primary":{value:"var(--Tight-colors-typography-intent-primary)",variable:"var(--Tight-colors-icon-intent-primary)"},"colors.icon.intent.primary.hover":{value:"var(--Tight-colors-typography-intent-primary-hover)",variable:"var(--Tight-colors-icon-intent-primary-hover)"},"colors.icon.intent.primary.active":{value:"var(--Tight-colors-typography-intent-primary-active)",variable:"var(--Tight-colors-icon-intent-primary-active)"},"colors.icon.intent.secondary":{value:"var(--Tight-colors-typography-intent-secondary)",variable:"var(--Tight-colors-icon-intent-secondary)"},"colors.icon.intent.secondary.hover":{value:"var(--Tight-colors-typography-intent-secondary-hover)",variable:"var(--Tight-colors-icon-intent-secondary-hover)"},"colors.icon.intent.secondary.active":{value:"var(--Tight-colors-typography-intent-secondary-active)",variable:"var(--Tight-colors-icon-intent-secondary-active)"},"colors.icon.intent.action":{value:"var(--Tight-colors-typography-intent-action)",variable:"var(--Tight-colors-icon-intent-action)"},"colors.icon.intent.action.hover":{value:"var(--Tight-colors-typography-intent-action-hover)",variable:"var(--Tight-colors-icon-intent-action-hover)"},"colors.icon.intent.action.active":{value:"var(--Tight-colors-typography-intent-action-active)",variable:"var(--Tight-colors-icon-intent-action-active)"},"colors.icon.intent.success":{value:"var(--Tight-colors-typography-intent-success)",variable:"var(--Tight-colors-icon-intent-success)"},"colors.icon.intent.success.hover":{value:"var(--Tight-colors-typography-intent-success-hover)",variable:"var(--Tight-colors-icon-intent-success-hover)"},"colors.icon.intent.success.active":{value:"var(--Tight-colors-typography-intent-success-active)",variable:"var(--Tight-colors-icon-intent-success-active)"},"colors.icon.intent.warning":{value:"var(--Tight-colors-typography-intent-warning)",variable:"var(--Tight-colors-icon-intent-warning)"},"colors.icon.intent.warning.hover":{value:"var(--Tight-colors-typography-intent-warning-hover)",variable:"var(--Tight-colors-icon-intent-warning-hover)"},"colors.icon.intent.warning.active":{value:"var(--Tight-colors-typography-intent-warning-active)",variable:"var(--Tight-colors-icon-intent-warning-active)"},"colors.icon.intent.danger":{value:"var(--Tight-colors-typography-intent-danger)",variable:"var(--Tight-colors-icon-intent-danger)"},"colors.icon.intent.danger.hover":{value:"var(--Tight-colors-typography-intent-danger-hover)",variable:"var(--Tight-colors-icon-intent-danger-hover)"},"colors.icon.intent.danger.active":{value:"var(--Tight-colors-typography-intent-danger-active)",variable:"var(--Tight-colors-icon-intent-danger-active)"},"colors.icon.accent.success":{value:"var(--Tight-colors-typography-accent-success)",variable:"var(--Tight-colors-icon-accent-success)"},"colors.icon.accent.warning":{value:"var(--Tight-colors-typography-accent-warning)",variable:"var(--Tight-colors-icon-accent-warning)"},"colors.icon.accent.danger":{value:"var(--Tight-colors-typography-accent-danger)",variable:"var(--Tight-colors-icon-accent-danger)"},"colors.border.layout.weak":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-border-layout-weak)"},"colors.border.layout":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-border-layout)"},"colors.border.layout.strong":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-border-layout-strong)"},"colors.border.intent.primary.hover":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-hover)"},"colors.border.intent.primary":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary)"},"colors.border.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-active)"},"colors.border.intent.primary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-primary-disabled)"},"colors.border.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-hover)"},"colors.border.intent.secondary":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary)"},"colors.border.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-active)"},"colors.border.intent.secondary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-secondary-disabled)"},"colors.border.intent.danger.hover":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-hover)"},"colors.border.intent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger)"},"colors.border.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-active)"},"colors.border.intent.danger.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-danger-disabled)"},"colors.border.intent.warning.hover":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-hover)"},"colors.border.intent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning)"},"colors.border.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-active)"},"colors.border.intent.warning.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-warning-disabled)"},"colors.border.intent.success.hover":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-hover)"},"colors.border.intent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success)"},"colors.border.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-active)"},"colors.border.intent.success.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-success-disabled)"},"colors.border.intent.action.hover":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-hover)"},"colors.border.intent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action)"},"colors.border.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-active)"},"colors.border.intent.action.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-action-disabled)"},"colors.money":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-money)"},"colors.money.positive":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive)"},"colors.money.positive.weak":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"fontWeights.heading":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-heading)"},"fontWeights.title":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-title)"},"fontWeights.metric.sm":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-sm)"},"fontWeights.metric.md":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-md)"},"fontWeights.metric.lg":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-lg)"},"fontWeights.metric.xl":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-xl)"},"fontSizes.title":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-title)"},"fontSizes.body":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-body)"},"fontSizes.label":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label)"},"fontSizes.label.strong":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label-strong)"},"fontSizes.label.sub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-sub)"},"fontSizes.label.strongSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-strongSub)"},"fontSizes.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-heading)"},"fontSizes.metric.sm":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-metric-sm)"},"fontSizes.metric.md":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-metric-md)"},"fontSizes.metric.lg":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-metric-xl)"},"colors.colorPalette":{value:"var(--Tight-colors-colorPalette)",variable:"var(--Tight-colors-colorPalette)"},"colors.colorPalette.primary.weak":{value:"var(--Tight-colors-colorPalette-primary-weak)",variable:"var(--Tight-colors-colorPalette-primary-weak)"},"colors.colorPalette.weak":{value:"var(--Tight-colors-colorPalette-weak)",variable:"var(--Tight-colors-colorPalette-weak)"},"colors.colorPalette.primary":{value:"var(--Tight-colors-colorPalette-primary)",variable:"var(--Tight-colors-colorPalette-primary)"},"colors.colorPalette.primary.strong":{value:"var(--Tight-colors-colorPalette-primary-strong)",variable:"var(--Tight-colors-colorPalette-primary-strong)"},"colors.colorPalette.strong":{value:"var(--Tight-colors-colorPalette-strong)",variable:"var(--Tight-colors-colorPalette-strong)"},"colors.colorPalette.secondary.weak":{value:"var(--Tight-colors-colorPalette-secondary-weak)",variable:"var(--Tight-colors-colorPalette-secondary-weak)"},"colors.colorPalette.secondary":{value:"var(--Tight-colors-colorPalette-secondary)",variable:"var(--Tight-colors-colorPalette-secondary)"},"colors.colorPalette.secondary.strong":{value:"var(--Tight-colors-colorPalette-secondary-strong)",variable:"var(--Tight-colors-colorPalette-secondary-strong)"},"colors.colorPalette.action.opaque":{value:"var(--Tight-colors-colorPalette-action-opaque)",variable:"var(--Tight-colors-colorPalette-action-opaque)"},"colors.colorPalette.opaque":{value:"var(--Tight-colors-colorPalette-opaque)",variable:"var(--Tight-colors-colorPalette-opaque)"},"colors.colorPalette.action.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.opaque":{value:"var(--Tight-colors-colorPalette-success-opaque)",variable:"var(--Tight-colors-colorPalette-success-opaque)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.opaque":{value:"var(--Tight-colors-colorPalette-warning-opaque)",variable:"var(--Tight-colors-colorPalette-warning-opaque)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.opaque":{value:"var(--Tight-colors-colorPalette-danger-opaque)",variable:"var(--Tight-colors-colorPalette-danger-opaque)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.intent.danger.weak":{value:"var(--Tight-colors-colorPalette-intent-danger-weak)",variable:"var(--Tight-colors-colorPalette-intent-danger-weak)"},"colors.colorPalette.intent.danger.opaque":{value:"var(--Tight-colors-colorPalette-intent-danger-opaque)",variable:"var(--Tight-colors-colorPalette-intent-danger-opaque)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"colors.colorPalette.body":{value:"var(--Tight-colors-colorPalette-body)",variable:"var(--Tight-colors-colorPalette-body)"},"colors.colorPalette.label":{value:"var(--Tight-colors-colorPalette-label)",variable:"var(--Tight-colors-colorPalette-label)"},"colors.colorPalette.label.sub":{value:"var(--Tight-colors-colorPalette-label-sub)",variable:"var(--Tight-colors-colorPalette-label-sub)"},"colors.colorPalette.sub":{value:"var(--Tight-colors-colorPalette-sub)",variable:"var(--Tight-colors-colorPalette-sub)"},"colors.colorPalette.label.strong":{value:"var(--Tight-colors-colorPalette-label-strong)",variable:"var(--Tight-colors-colorPalette-label-strong)"},"colors.colorPalette.label.strongSub":{value:"var(--Tight-colors-colorPalette-label-strongSub)",variable:"var(--Tight-colors-colorPalette-label-strongSub)"},"colors.colorPalette.strongSub":{value:"var(--Tight-colors-colorPalette-strongSub)",variable:"var(--Tight-colors-colorPalette-strongSub)"},"colors.colorPalette.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"colors.colorPalette.heading":{value:"var(--Tight-colors-colorPalette-heading)",variable:"var(--Tight-colors-colorPalette-heading)"},"colors.colorPalette.metric.sm":{value:"var(--Tight-colors-colorPalette-metric-sm)",variable:"var(--Tight-colors-colorPalette-metric-sm)"},"colors.colorPalette.sm":{value:"var(--Tight-colors-colorPalette-sm)",variable:"var(--Tight-colors-colorPalette-sm)"},"colors.colorPalette.metric.md":{value:"var(--Tight-colors-colorPalette-metric-md)",variable:"var(--Tight-colors-colorPalette-metric-md)"},"colors.colorPalette.md":{value:"var(--Tight-colors-colorPalette-md)",variable:"var(--Tight-colors-colorPalette-md)"},"colors.colorPalette.metric.lg":{value:"var(--Tight-colors-colorPalette-metric-lg)",variable:"var(--Tight-colors-colorPalette-metric-lg)"},"colors.colorPalette.lg":{value:"var(--Tight-colors-colorPalette-lg)",variable:"var(--Tight-colors-colorPalette-lg)"},"colors.colorPalette.metric.xl":{value:"var(--Tight-colors-colorPalette-metric-xl)",variable:"var(--Tight-colors-colorPalette-metric-xl)"},"colors.colorPalette.xl":{value:"var(--Tight-colors-colorPalette-xl)",variable:"var(--Tight-colors-colorPalette-xl)"},"colors.colorPalette.layout.weak":{value:"var(--Tight-colors-colorPalette-layout-weak)",variable:"var(--Tight-colors-colorPalette-layout-weak)"},"colors.colorPalette.layout":{value:"var(--Tight-colors-colorPalette-layout)",variable:"var(--Tight-colors-colorPalette-layout)"},"colors.colorPalette.layout.strong":{value:"var(--Tight-colors-colorPalette-layout-strong)",variable:"var(--Tight-colors-colorPalette-layout-strong)"},"colors.colorPalette.positive":{value:"var(--Tight-colors-colorPalette-positive)",variable:"var(--Tight-colors-colorPalette-positive)"},"colors.colorPalette.positive.weak":{value:"var(--Tight-colors-colorPalette-positive-weak)",variable:"var(--Tight-colors-colorPalette-positive-weak)"},"colors.colorPalette.negative":{value:"var(--Tight-colors-colorPalette-negative)",variable:"var(--Tight-colors-colorPalette-negative)"},"colors.colorPalette.negative.weak":{value:"var(--Tight-colors-colorPalette-negative-weak)",variable:"var(--Tight-colors-colorPalette-negative-weak)"}};function wa(e,t){return Ca[e]?.value||t}wa.var=function(e,t){return Ca[e]?.variable||t};const Ea=Kt(null,Dt({borderRadius:"50%",flexShrink:0})),Aa=Kt(null,Dt({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),Ia=wa.var("colors.surface.foreground.disabled");function Sa({color:e=Ia,diameter:t=17,label:n}){return N("div",{...Aa,"data-testid":"bullet-row",children:[I("div",{...Ea,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&I(xa,{children:n})]})}const Na=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function Pa({payload:e}){return void 0===e?null:I("div",{...Na,children:e.map((e,t)=>"none"!==e.type&&I(Sa,{color:e.color,label:e.value,diameter:17},t))})}const Ma={right:20,left:20},Ra=["income","profit","expenses","loss"],Da=e=>Ra.findIndex(t=>t===e.dataKey),La={paddingBottom:"20px",marginLeft:"-20px"},Oa={stackId:"stack",isAnimationActive:!1},Fa=Kt(Ut["profit-loss-graph"],Dt({"& .recharts-surface":{outline:"none"}})),Ba=wa.var("colors.money"),Va=wa.var("colors.border.layout"),Ua=wa.var("colors.border.layout.strong"),Wa={fill:wa.var("colors.typography.base"),fontSize:wa.var("fontSizes.metric.sm")},Ha={profit:wa.var("colors.money.positive"),income:wa.var("colors.money.positive.weak"),loss:wa.var("colors.money.negative"),expenses:wa.var("colors.money.negative.weak")},qa=[0,100],ja=["auto","auto"];function za({data:e}){const[t,n]=y(!0);if(void 0===e)return null;const r=e.hasAnyData?ja:qa;return I(B,{width:"100%",height:"100%",...Fa,children:N(V,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Ma,children:[I(U,{verticalAlign:"top",itemSorter:Da,wrapperStyle:La,content:({payload:e})=>I(Pa,{payload:e})}),I(W,{strokeDasharray:"0",vertical:!1,stroke:Va}),I(H,{dataKey:"month",interval:0,tickLine:!1,stroke:Va,tick:Wa}),I(q,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Va,tick:Wa,tickFormatter:e=>ma(e)}),I(j,{content:({active:e,payload:t})=>I(Ta,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),I(z,{name:"Profit",dataKey:"profit",fill:Ha.profit,...Oa}),I(z,{name:"Income",dataKey:"income",fill:Ha.income,...Oa}),I(z,{name:"Loss",dataKey:"loss",fill:Ha.loss,...Oa}),I(z,{name:"Expenses",dataKey:"expenses",fill:Ha.expenses,...Oa}),I(z,{dataKey:zr,fill:Va,legendType:"none",...Oa}),I(K,{y:0,stroke:Ua}),I(Y,{dataKey:"netIncome",fill:Ba,stroke:Ba,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Ka=Dt({backgroundColor:"surface.elevated",borderRadius:"sm",backgroundImage:"linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)",backgroundSize:"400%",backgroundPosition:"100% 0",animation:"shimmer"});function Ya({styles:e}){const t=Ot(Ka,e);return I("div",{className:t,"data-testid":"shimmer-block"})}const _a=Dt({width:"40%",minHeight:65});function Za({children:e}){return N(S,{children:[I(Ya,{styles:_a}),I(da,{children:e})]})}const Ga=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),Qa=Dt({width:"80px",height:"17px",marginBottom:"10px"}),Xa=Dt({width:"100%",height:"100%"});function Ja(){return N(S,{children:[N("div",{...Ga,children:[I(Ya,{styles:Qa}),I(Ya,{styles:Qa}),I(Ya,{styles:Qa}),I(Ya,{styles:Qa})]}),I(Ya,{styles:Xa})]})}const $a=Bt({base:{color:"typography.base.weak",boxSizing:"border-box",position:"absolute",bottom:"0",left:"0",right:"0",top:"0",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",margin:"0 auto",transform:"rotate(-20deg)",opacity:"80%"},variants:{size:{sm:{fontSize:"4em"},lg:{fontSize:"7em"},xl:{fontSize:"10em"}}}});function eo({size:e}){const t=$a({size:e});return I("div",{className:t,children:"Sample"})}const to=20200,no=5043,ro=Object.freeze({income:to,expenses:no,netIncome:15157,absoluteSum:Math.abs(to)+Math.abs(no)}),ao=Object.freeze({total:no,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),oo=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),io=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function lo({filter:e=an.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return jr({filter:e,grouping:t,select:_r})}({filter:e,grouping:"MONTHLY"}),a=t?function(){const e=[],t=/* @__PURE__ */new Date;let n=0,r=0,a=0;for(let o=11;o>=0;o--){const i=new Date(t.getFullYear(),t.getMonth()-o,1),l=Tn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=io[11-o],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),n+=c,r=Math.max(r,s.income),a=Math.max(a,s.expenses)}return{total:n,domain:[-a,r],months:e,hasAnyData:!0}}():n;return N($r,{type:"chart",children:[I(Gr,{title:"Profit + Loss"}),I(Xr,{children:r?I(Za,{children:I(Ja,{})}):N(S,{children:[I(sa,{title:ma(a?.total??0),label:"Profit"}),I(da,{children:I(za,{data:a})})]})}),t&&I(eo,{size:"xl"})]})}const so=Kt(null,Dt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function co({children:e}){return I("div",{...so,children:e})}const uo="conversations-section",ho="transactions-section",po={MESSAGE_REVIEW:uo,TRANSACTION_REVIEW:ho,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},go={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},mo={resolutionStatus:{in:["OPEN"]}},vo=[],bo=[];function fo(e){return Fr(`${t=e,Vr[t]}`,"v6");var t}const yo={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},xo=e=>["tasks",e??{}],ko={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},To=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:fo(t[2].environment)},a=await Lr(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}},Co=Bt({base:{stroke:"currentColor"},variants:{primary:{DEFAULT:{stroke:"icon.intent.primary"},hover:{stroke:"icon.intent.primary.hover"},active:{stroke:"icon.intent.primary.active"}},secondary:{DEFAULT:{stroke:"icon.intent.secondary"},hover:{stroke:"icon.intent.secondary.hover"},active:{stroke:"icon.intent.secondary.active"}},success:{DEFAULT:{stroke:"icon.intent.success"},hover:{stroke:"icon.intent.success.hover"},active:{stroke:"icon.intent.success.active"}},warning:{DEFAULT:{stroke:"icon.intent.warning"},hover:{stroke:"icon.intent.warning.hover"},active:{stroke:"icon.intent.warning.active"}},danger:{DEFAULT:{stroke:"icon.intent.danger"},hover:{stroke:"icon.intent.danger.hover"},active:{stroke:"icon.intent.danger.active"}},action:{DEFAULT:{stroke:"icon.intent.action"},hover:{stroke:"icon.intent.action.hover"},active:{stroke:"icon.intent.action.active"}}}});function wo(e,t){const n=({size:t=24,fill:n="transparent",stylists:r})=>{const a=Qt([Kt(null,Co()),...r]);return I(e,{...a,style:{minHeight:t,minWidth:t},width:t,height:t,fill:n})};return n.displayName=t,n}const Eo=wo(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),Ao=wo(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),Io=Dt({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),So=Dt({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),No=Dt({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});Dt({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}}),Dt({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}});const Po=v({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Mo({Component:e,stylists:t}){return I(e,{stylists:[Kt(Ut["small-icon"],Ut.icon),...t??[]],size:12})}const Ro=Kt(null,Dt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{xl:"35px",base:"44px"},gap:0})),Do=Kt(null,Dt({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{xl:"4px",base:"12px"},margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",boxShadow:"0 0 0 0 transparent","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{opacity:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}}),So),Lo=Kt(null,Dt({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center",width:{xl:"100%",base:"44px"}})),Oo=Kt(null,Dt({height:{xl:"12px",base:"20px"},width:{xl:"12px",base:"20px"}}));function Fo(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=b(Po);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return N("div",{...Ro,children:[I("div",{...Lo,children:I("button",{...Do,onClick:r,disabled:!t,children:I(Mo,{Component:Eo,stylists:[Oo]})})}),I("div",{...Lo,children:I("button",{...Do,onClick:n,disabled:!e,children:I(Mo,{Component:Ao,stylists:[Oo]})})})]})}const Bo=Dt({width:"100%",height:"50px"});function Vo(){return I(Ya,{styles:Bo})}const Uo=Kt(Ut["dashboard-placeholder-table"],Dt({display:"flex",flexDirection:"column",gap:"4px"})),Wo=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Ho=Dt({width:"100px",height:"20px"});function qo({numColumns:e=6}){return N("div",{...Uo,children:[I("div",{...Wo,children:Array.from({length:e},(e,t)=>I(Ya,{styles:Ho},t))}),I(Vo,{}),I(Vo,{}),I(Vo,{}),I(Vo,{}),I(Vo,{}),I(Vo,{})]})}function jo(e,t){const n=Ln(),r=Un();return x(a=>{const o=Rn(n),i=o?{}:{retry:!1,staleTime:1/0};return Bn.prefetchQuery({queryKey:An(e(a),n??"",r),queryFn:o?t:On,...i})},[e,t,n,r])}const zo=Object.freeze({}),Ko=Object.freeze({cursor:"FINAL_PAGE"});function Yo({queryKey:e,queryFn:t,...n}){const[r,a]=y(zo),o=g(e);i(o.current,e)||(o.current=e,a(zo));const l=n.select,s=Nn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=In(e,r),d=Wn({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=m(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(zo),getLastPage:()=>t(Ko),hasNextPage:Nn(e?.after),hasPreviousPage:Nn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=jo(x(t=>In(e,t),[e]),t),p=jo(x(t=>In(e,t),[e]),t);return k(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{wr({error:e,severity:"error"})}),e.before&&p({cursor:e.before}).catch(e=>{wr({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,p]),{...d,paginationControls:u}}async function _o({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=Sr({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let n=e;const r=null==(a=t)?"":Object.entries(a).map(([e,t])=>{let n;return n=Array.isArray(t)?t.map(t=>Ir(e,t)).join("&"):Ir(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});Cr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return Cr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),Nr(e)}catch(s){return Promise.reject(s)}}async function Zo(e){const{url:t,headers:n}=Mr(e);return _o({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function Go(e){return Zo({...e,endpointManager:fo(e.environment)})}async function Qo(e){return Zo({...e,endpointManager:Wr(e.environment)})}function Xo({delay:e,callback:t}){const n=m(()=>function({delay:e,callback:t}){let n;const r=()=>{n&&(clearTimeout(n),n=void 0)};return{startCallback:a=>{r(),n=setTimeout(()=>{t(a)},e)},cancelCallback:()=>r()}}({delay:e,callback:t}),[e,t]);return k(()=>()=>{n.cancelCallback()},[n]),{startCallback:x(e=>{n.startCallback(e)},[n]),cancelCallback:x(()=>{n.cancelCallback()},[n])}}function Jo({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=Xo({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const $o={CREATED_DATE_TIME:"CREATED_DATE_TIME",SUBJECT:"SUBJECT",EMAIL:"EMAIL",LAST_MESSAGE_CREATED_DATE_TIME:"LAST_MESSAGE_CREATED_DATE_TIME",LAST_MESSAGE_TEXT:"LAST_MESSAGE_TEXT"},ei={ASC:"ASC",DESC:"DESC"},ti=e=>["conversations",e??{}],ni=e=>["conversations","conversation",e],ri=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:fo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function ai(e){return Yo({queryKey:e?ti(e):["conversations",{}],queryFn:ri})}const oi=async e=>{const t=e.queryKey,{id:n}=t[2],r={path:"/v6/conversations/{id}",pathParams:{id:n},accessToken:t[3].accessToken,environment:t[3].environment},a=await Go(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function ii(e){const t=Nn(e);return Wn({queryKey:ni({id:e??""}),queryFn:oi,enabled:t})}const li=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:fo(n)};return await Lr(r)};function si(){return Jo({prefetchFn:jo(ni,oi)})}function ci(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function di({header:e}){const t=ci(e.column);return I("div",{...Kt(Ut["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:_(e.column.columnDef.header,e.getContext())})}const ui=Kt(Ut["dashboard-table-header"],Dt({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function hi({headerGroups:e}){return I("div",{children:e.map(e=>T("div",{...ui,key:e.id},e.headers.map(e=>I(di,{header:e},e.id))))})}const pi=Kt(Ut["dashboard-table-body"],Dt({display:"flex",flexDirection:"column"}));function gi({children:e}){return I("div",{...pi,children:e})}const mi=Bt({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function vi({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Kt("vertical"===e?Ut["vertical-divider"]:Ut["horizontal-divider"],n,mi({alignment:e,color:t}));return I("div",{...r})}function bi(){return I(vi,{additionalClassName:Ut["table-cell-divider"]})}function fi({cell:e,index:t,onCellClick:n,shouldDisplayDivider:r}){const a=ci(e.column),o=Kt(Ut["dashboard-table-cell"],Dt({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Kt(null,Dt({display:"flex",flexDirection:"row",height:"100%"})),l=r(t);return N("div",{...i,style:a,onClick:()=>{n&&n(e)},children:[l&&I(bi,{}),I("div",{style:a,...o,children:_(e.column.columnDef.cell,e.getContext())})]})}const yi=Kt(Ut["table-sub-row"],Dt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function xi({rowData:e,onCellClick:t,shouldDisplayDivider:n}){const r=e.getVisibleCells();return I("div",{...yi,children:r.map((e,r)=>I(fi,{cell:e,index:r,onCellClick:t,shouldDisplayDivider:n,isChild:!0},e.id))})}const ki=Dt({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content",_hover:{backgroundColor:"brand.action.opaque"}}),Ti=Dt({background:"surface.background"}),Ci=Kt(Ut["table-row"],Dt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{base:"85px",xl:"60px"},minWidth:"fit-content"}));function wi({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=Kt(Ut["table-parent-row"],ki,e.index%2==0?Ti:void 0),l=e.getVisibleCells();return N("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[I("div",{...Ci,children:l.map((e,t)=>I(fi,{cell:e,index:t,onCellClick:r,shouldDisplayDivider:a},e.id))}),o&&I("div",{children:e.subRows.map(e=>I(xi,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const Ei=(e,t={})=>{Ye.getState().openDrawer(e,t)},Ai=()=>{Ye.getState().requestCloseDrawer()};function Ii({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=An(e,n,r);return Bn.fetchQuery({queryKey:a,queryFn:t})}function Si({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=An(e,n,r);return Bn.prefetchQuery({queryKey:a,queryFn:t})}const Ni=[{name:"One-Time Expense",value:"ONE_TIME"},{name:"Weekly Recurring Expense",value:"WEEKLY"},{name:"Monthly Recurring Expense",value:"MONTHLY"},{name:"Yearly Recurring Expense",value:"YEARLY"}],Pi={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Mi={ASC:"ASC",DESC:"DESC"},Ri=e=>["banks/transactions",e??{}],Di=e=>["banks/transactions",e.id],Li=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:fo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Oi(e){return Yo({queryKey:Ri(e),queryFn:Li})}const Fi=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await Go(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Bi({id:e}){return Wn({queryKey:Di({id:e}),queryFn:Fi})}function Vi(){return Jo({prefetchFn:jo(Di,Fi)})}const Ui={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Wi(e,t){return!Mn(e)&&e.startsWith(t)}function Hi({id:e,prefix:t}){return void 0!==e?`${Ui[t]}_${e}`:""}function qi(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const ji=e=>["conversations/messages",e];function zi(e){if(Sn(e)||0===e.length)return null;const t=[[e[0]]];for(let n=1;n<e.length;n++){const r=e[n],a=t[t.length-1],o=a[0].author.userId;r.author.userId===o?a.push(r):t.push([r])}return t}const Ki=async e=>{const t=e.queryKey,{id:n}=t[1],r={path:"/v6/conversations/{id}/messages",pathParams:{id:n},accessToken:t[2].accessToken,environment:t[2].environment},a=await Go(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Yi=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:fo(n),accessToken:t};return await Lr(r)};function _i(){return Jo({prefetchFn:jo(ji,Ki)})}const Zi=e=>["summaries",e??{}],Gi=e=>["summaries",e.id],Qi=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:fo(t[2].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const Xi=async e=>{const t=e.queryKey,n={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await Go(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Ji({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=si(),{startPrefetch:a,cancelPrefetch:o}=_i(),{startPrefetch:i,cancelPrefetch:l}=Vi(),{startPrefetch:s,cancelPrefetch:c}=Jo({prefetchFn:jo(Gi,Xi)}),d=x(()=>{Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Ui.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Ui.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),a({id:e.original.id}),n({id:e.original.id})},[e.original.attachedEntityId,e.original.id,a,n,i,s]),u=x(()=>{Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Ui.BANK_TRANSACTION)?l():Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Ui.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return I(wi,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?Ei("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Nn(t)?Wi(t,Ui.BANK_TRANSACTION)?Ei("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Wi(t,Ui.FINANCIAL_SUMMARY)&&(r=e,a=t,Ei("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){Ei("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const $i=wo(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),el=Dt({display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",borderRadius:"md","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout",outlineOffset:"-1px"},"&:disabled":{cursor:"not-allowed",opacity:.6}}),tl=Dt({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discrete",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),nl=Dt({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),rl=Dt({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),al=Dt.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discrete",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),ol=Bt({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%",height:"100%"}}}}),il={default:nl,small:rl},ll=e=>{const t=il[e];return Kt(Ut["button-base"],t,el,Io)},sl=["default","small"],cl={default:{className:""},small:{className:""}};for(const US of sl)cl[US]=ll(US);const dl=C(function({children:e,stylists:t=[],type:n="button",onClick:r,disabled:a,size:o="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Qt([cl[o],Kt(null,ol({width:i})),...t]);return I("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ul=Kt(Ut["button-primary"],tl),hl=C(function({children:e,active:t,stylists:n=[],width:r,...a},o){return I(dl,{ref:o,stylists:[ul,...n],active:t,width:r,...a,children:e})}),pl=()=>{Ei("Conversation",{routeProps:{conversationId:null}})};function gl(){return I("div",{className:Dt({width:{xl:"auto",base:"44px"},height:{xl:"auto",base:"44px"}}),children:I(hl,{onClick:pl,width:"fill-parent",children:I(Mo,{Component:$i})})})}const ml=Bt({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:{base:"none",xl:"{borderWidths.lg} solid {colors.border.layout}"},borderRadius:{base:"zero",xl:"lg"}}}}});function vl({children:e,dashboard:t}){const n=Kt(Ut["dashboard-table"],ml({dashboard:t}));return I("div",{...n,children:e})}const bl=v(null),fl="mobile",yl=Bt({base:{fontWeight:"label",fontSize:"lg",fontFamily:"label",lineHeight:"18px",letterSpacing:"0.84px",maxWidth:"100%",xl:{lineHeight:"16px",fontSize:"label"}},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function xl({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left",extraClassNames:a=[]}){const o=Kt(Ut.label,Dt(yl.raw({intent:t,wrap:n,alignment:r}),a));return Mn(e)?null:I("div",{title:"ellipsis"===n?e:void 0,...o,children:e})}const kl={"sm-sm":Kt(Ut.text,Dt({fontSize:{xl:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"sm-med":Kt(Ut.text,Dt({fontSize:{xl:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"sm-lg":Kt(Ut.text,Dt({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-sm":Kt(Ut.text,Dt({fontSize:{xl:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-med":Kt(Ut.text,Dt({fontSize:{xl:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-lg":Kt(Ut.text,Dt({fontSize:{xl:"md",base:"lg"},fontWeight:{base:"md",xl:"lg"},color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea)};function Tl({children:e,size:t,weight:n,stylists:r=[]}){const a=Qt([kl[`${t}-${n}`],...r]);return I("div",{title:e,...a,children:e})}const Cl=Kt(Ut["emphasis-label"],Dt({lineHeight:"16px"}));function wl({children:e}){return I(Tl,{size:"med",weight:"lg",stylists:[Cl],children:e})}function El({text:e,isRead:t}){return I(t?xl:wl,{children:e})}const Al=Bt({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"},flexEnd:{alignItems:"flex-end"}}},defaultVariants:{alignVariant:"flexStart"}});function Il({children:e,alignVariant:t="flexStart"}){const n=Kt(null,Al({alignVariant:t}));return I("div",{...n,children:e})}function Sl({date:e,isRead:t=!1}){const n=Cn(e);return I(El,{text:n,isRead:t})}const Nl=Kt(Ut["strong-sub-label"],Xt({label:"strongSubLabel"}));function Pl({children:e,stylists:t=[]}){return Mn(e)?null:I(Tl,{size:"sm",weight:"med",stylists:[Nl,...t],children:e})}const Ml=v(null),Rl=Dt({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),Dl=Dt({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:"none",backgroundColor:"surface.foreground",minWidth:{base:"100%"},boxShadow:{sm:"none"},minHeight:{sm:"35px"},height:{sm:"fit-content"},flexShrink:{sm:0},textAlign:{sm:"start"},"&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}),Ll=Kt(Ut["selector-row"],Dl);function Ol(e,t,n){const[r,a]=y(e);return[t??r,n??a]}function Fl({children:e}){return null===ce()?I(de,{children:e}):e}function Bl({children:e,modal:t=!1,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:n=0,modal:r,open:a,onOpenChange:o,enableClickMiddleware:i=!0}={}){const[l,s]=y(),[c,d]=y(),[u,h]=Ol(e,a,o),p=J(),g=$({placement:t,open:u,nodeId:p,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||h(e)},whileElementsMounted:ae,middleware:[ee(n),te({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),ne({padding:8}),re({apply({availableHeight:e,elements:t}){let n=e;if(e<314){const t=37*Math.floor(e/37)-18.5;n=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${n}px`,overflowY:"auto"})},padding:8})]}),v=g.context,b=oe(v,{enabled:i}),f=ie(v,{bubbles:{escapeKey:!0}}),k=le(v),T=se([b,f,k]),C=x(()=>h(!1),[h]);return m(()=>({open:u,setOpen:h,close:C,...T,...g,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,C,T,g,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=ce(),u=l&&null===d,h=c.nodeId;return I(Fl,{children:I(ue,{id:h,children:I(Ml.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function Vl(){const e=b(Ml);if(Sn(e))throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Ul({children:e}){const t=Vl(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return I(S,{children:e(a)})}const Wl=wo(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),p.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Hl({Component:e,stylists:t}){return I(e,{stylists:[Kt(Ut["tiny-icon"],Ut.icon),...t??[]],size:9})}const ql=wo(e=>p.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),jl=Kt(null,Dt({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Io),zl=Kt(null,Dt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Kl=Kt(null,Dt({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",padding:0,margin:"6px 6px 6px 5px",border:"none",outline:"none",position:"relative",cursor:"pointer","&::before":{content:"''",position:"absolute",top:"-9px",right:"-7px",bottom:"-9px",left:"-5px"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),Yl=Kt(null,Dt({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function _l({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return N("div",{...jl,"data-active":a,children:[N("button",{...zl,...r,children:[I(Pl,{children:t}),!a&&I("div",{...Yl,children:I(Hl,{Component:ql})})]}),a&&I("button",{...Kl,onClick:e,children:I(Hl,{Component:Wl})})]})}const Zl=Bt({base:{borderColor:"border.layout",background:"surface.foreground",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function Gl({initialFocus:e=!0,style:t,ref:n,type:r,forceMount:a,...o}){const{context:i,blockInteraction:l,...s}=Vl(),c=he([s.refs.setFloating,n]),d=Kt(Ut.popup,Zl({type:r}));return a||i.open?N(S,{children:[l&&I(pe,{lockScroll:!0}),I(ge,{children:I(me,{context:i,modal:s.modal,initialFocus:e?void 0:-1,children:I("div",{ref:c,...d,style:{...s.floatingStyles,...t},...s.getFloatingProps(o),"aria-labelledby":s.labelId,"aria-describedby":s.descriptionId,children:o.children})})})]}):null}const Ql=Kt(Ut["popup-sort-row"],Dt({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function Xl({onClick:e,children:t,active:n}){return I("button",{onClick:e,...Ql,children:I(xa,{accent:n?"active":"action",children:t})})}const Jl=Kt(null,Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),$l=Kt(null,Dt({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function es({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=Vl(),i=e=>{r(e),o.close()},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return N("div",{...Jl,children:[I(Pl,{stylists:[$l],children:"Sort by:"}),I(Xl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),I(Xl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const ts=Dt.raw(al,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function ns({extraClassNames:e,children:t,active:n,disabled:r,onClick:a,popupTriggerProps:o,ariaLabel:i,ariaExpanded:l}){const[s,c]=y(!1),d=Kt(Ut["button-discrete-small"],Dt(ts,e),Io),u=n??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return I("button",{type:"button",...d,onClick:e=>{void 0===u&&c(!s),a&&a(e)},"data-active":u??s,disabled:r,...o,"aria-label":i,"aria-expanded":l,children:t})}const rs={minWidth:"140px"};function as({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=b(bl);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(_l,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),I(Gl,{style:rs,children:I(es,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):I(ns,{disabled:!0,children:I(Pl,{children:e})})}const os=Bt({base:{display:"flex",width:"100%"},variants:{align:{left:{justifyContent:"flex-start"},center:{justifyContent:"center"},right:{justifyContent:"flex-end"}},padding:{none:{},default:{},large:{}}},compoundVariants:[{align:"left",padding:"none",css:{paddingLeft:"0"}},{align:"left",padding:"default",css:{paddingLeft:"19px"}},{align:"left",padding:"large",css:{paddingLeft:"33px"}},{align:"right",padding:"none",css:{paddingRight:"0"}},{align:"right",padding:"default",css:{paddingRight:"19px"}},{align:"right",padding:"large",css:{paddingRight:"33px"}}],defaultVariants:{align:"left",padding:"default"}});function is({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r,align:a="left",padding:o="default"}){return I("div",{className:os({align:a,padding:o}),children:I(as,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const ls="Oldest to Newest",ss="Newest to Oldest";const cs=v({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0,clientId:void 0,useStripeInvoicePaymentProcessing:void 0,hasPayroll:void 0,hasShopify:void 0,hasSquare:void 0,unitIntegrationBankName:null});function ds({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=b(cs);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),I(El,{text:a,isRead:t})}const us=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.94389 13.9144L13.4056 8.12309C14.1306 7.18143 14.4519 5.9904 14.299 4.81186C14.1461 3.63332 13.5313 2.56376 12.59 1.83834C12.1329 1.45727 11.602 1.17479 11.0306 1.00865C10.4592 0.842499 9.85956 0.796265 9.26942 0.872849C8.67928 0.949432 8.11133 1.14718 7.60124 1.45368C7.09115 1.76017 6.64993 2.16881 6.30526 2.65392L1.26787 9.15798C-0.0274639 10.7069 0.993722 12.5848 2.14513 13.4895C2.76204 13.9899 3.55149 14.2266 4.34198 14.1484C5.13247 14.0701 5.86015 13.6831 6.36694 13.0714L11.3769 6.56732C11.531 6.3676 11.6442 6.13944 11.7101 5.89592C11.7759 5.6524 11.7931 5.39829 11.7606 5.14812C11.7282 4.89795 11.6467 4.65664 11.5209 4.43799C11.395 4.21934 11.2274 4.02764 11.0274 3.87386C10.6233 3.56441 10.1132 3.42748 9.60854 3.49297C9.10385 3.55846 8.6456 3.82107 8.33392 4.22339L4.10525 9.70627",strokeMiterlimit:10})),"Attachment"),hs=Kt(Ut.text,Dt({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),ea);function ps({children:e,stylists:t=[]}){const n=Qt([hs,...t]);return I("div",{...n,children:e})}const gs=wo(e=>p.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.42442 14.4244C11.2487 14.4244 14.3488 11.3242 14.3488 7.49998C14.3488 3.67573 11.2487 0.575562 7.42442 0.575562C3.60017 0.575562 0.5 3.67573 0.5 7.49998C0.5 11.3242 3.60017 14.4244 7.42442 14.4244Z",fill:"#182428",stroke:"#182428",strokeMiterlimit:10})),"CircleFilled"),ms=Bt({base:{display:"flex",gap:8,border:"none",borderBottom:"1px solid",borderBottomColor:"border.layout.weak",borderRadius:0,padding:0,width:"100%",height:"100%",cursor:"pointer",alignItems:"stretch"},variants:{isRead:{true:{backgroundColor:"transparent"},false:{backgroundColor:"surface.background"}}}}),vs=Ot(Dt({display:"flex",flex:1,flexDirection:"column",alignItems:"start",justifyContent:"center",gap:"8px",maxWidth:"100%",paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"}),ea),bs=Dt({display:"flex",flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between",width:"100%"}),fs=Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end"}),ys=Dt({display:"flex",alignItems:"center",gap:8}),xs=Dt({display:"flex",alignItems:"center",gap:"4px"});function ks({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return I("button",{className:ms({isRead:a}),onTouchEnd:o,children:N("div",{className:vs,children:[N("div",{className:Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:4}),children:[!a&&I(Mo,{Component:gs}),I(El,{text:t,isRead:a})]}),N("div",{className:bs,children:[I("div",{className:Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4}),children:I(ds,{authorUserId:e,isRead:a})}),N("div",{className:ys,children:[I("div",{className:fs,children:I(Sl,{date:n,isRead:a})}),a?I(Mo,{Component:Ao}):I(ps,{children:I(Mo,{Component:Ao})})]})]}),Mn(r)?N("div",{className:xs,children:[I(Mo,{Component:us}),I(xl,{children:"Shared a file"})]}):I(xl,{children:r})]})})}const Ts=Z(),Cs=Kt(null,Dt({paddingLeft:"25px"})),ws=[Ts.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>I(Il,{children:I(ds,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>I(Pl,{stylists:[Cs],children:"From"}),size:150,maxSize:150}),Ts.accessor("subject",{id:"subject",cell:({row:e})=>I(Il,{children:I(El,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>I(Pl,{stylists:[Cs],children:"Subject"}),size:150}),Ts.accessor("latestMessage.text",{id:"message",cell:({row:e})=>I(Il,{children:I(El,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>I(Pl,{stylists:[Cs],children:"Message"}),size:200}),Ts.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>I(Il,{children:I(Sl,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>I(is,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:ss,sortAscDisplay:ls}),size:130,maxSize:130}),Ts.display({id:fl,cell:({row:e})=>I(ks,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function Es(e){return e?ws.filter(e=>e.id===fl):ws.filter(e=>e.id!==fl)}const As=[],Is=Dt({display:"flex",flexDirection:"column",height:"250px",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),Ss=Kt(Ut["empty-dashboard-layout"],Is);function Ns({children:e}){return I("div",{...Ss,"data-testid":"empty-dashboard-layout",children:e})}function Ps({Component:e,stylists:t}){return I(e,{stylists:[Kt(Ut["large-icon"],Ut.icon),...t??[]],size:25})}const Ms=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),Rs=()=>{Ei("Conversation",{routeProps:{conversationId:null}})};function Ds(){return N(S,{children:[I(Ps,{Component:Ms}),I(fa,{wrap:"wrap",children:"Need help with your financials?"}),I(hl,{onClick:Rs,children:I(fa,{children:"Talk to a bookkeeper"})})]})}function Ls(){return N(S,{children:[I(Ps,{Component:Ms}),I(fa,{wrap:"wrap",children:"All caught up"}),I(xa,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Os=Kt(null,Dt({display:"flex",flexDirection:"row",gap:"5px"}));function Fs({children:e}){return I("div",{...Os,children:e})}const Bs=Bt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Vs(e){return I(e?Ls:Ds,{})}function Us({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return G({data:e??As,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??As.length,columns:Es(t),getCoreRowModel:Q(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=ai({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!Sn(l?.data?.[0])&&!s;return N("div",{className:Bs({isMobile:o}),children:[I("div",{id:uo}),N(Po.Provider,{value:r,children:[N(_t,{children:[I($t,{children:"Conversations"}),N(Fs,{children:[I(Fo,{}),I(gl,{})]})]}),I(vl,{dashboard:"businessOwnerDashboard",children:a?I(qo,{numColumns:4}):N(S,{children:[!o&&I(bl.Provider,{value:{sortInstance:e,setSortInstance:t},children:I(hi,{headerGroups:i.getHeaderGroups()})}),n.length>0?I(gi,{children:i.getRowModel().rows.map(e=>I(Ji,{rowData:e,isMobile:o},e.id))}):I(Ns,{children:Vs(c)})]})})]})]})}const Ws=Kt(Ut.body,Xt({body:"default"}));function Hs({children:e,stylists:t=[]}){if(Mn(e))return null;const n=Qt([Ws,...t]);return I("div",{...n,children:e})}const qs=Kt(null,Dt({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),js=Bt({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),zs=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Ks(){return I("div",{...qs,children:zs.map((e,t)=>I(Ya,{styles:js({width:e?.width})},t))})}const Ys=wo(e=>p.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),_s=Dt({position:"absolute",top:"-1",right:"-1",width:"10",height:"10",borderRadius:"999px",backgroundColor:"surface.intent.warning",boxShadow:"0 0 0 1px {colors.border.intent.warning}"}),Zs=Dt({position:"relative",width:"25px",height:"25px"});function Gs({hasUnread:e}){return N("div",{className:Zs,children:[I(Ps,{Component:Ys}),e&&I("div",{"data-testid":"unread-comment-badge",className:_s,"aria-hidden":"true"})]})}const Qs=Dt({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout}",boxSizing:"border-box"});function Xs({hasUnreadMessages:e=!1,showMessageIndicator:t}){return N("div",{className:Qs,children:[I(fa,{children:"Message Bookkeeper"}),t&&I(Gs,{hasUnread:e})]})}const Js=Dt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function $s(){return N("div",{className:Js,children:[I(Ps,{Component:Ms}),I(fa,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),I(xa,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),I(hl,{onClick:()=>Ei("Conversation"),children:I(fa,{children:"Talk to a bookkeeper"})})]})}const ec=Dt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function tc({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=si(),{startPrefetch:a,cancelPrefetch:o}=_i(),i=x(()=>{a({id:t}),n({id:t})},[t,a,n]),l=x(()=>{o(),r()},[o,r]);return N("div",{className:ec,children:[I(Ps,{Component:Ms}),I(fa,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),I(xa,{wrap:"wrap",children:"Pick up where you left off."}),I(hl,{onClick:()=>Ei("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:I(fa,{children:"Continue conversation"})})]})}const nc=Dt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function rc({summaryId:e}){return N("div",{className:nc,children:[I(Ps,{Component:Ms}),I(fa,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),I(xa,{wrap:"wrap",children:"Your bookkeeper will respond here."}),I(hl,{onClick:()=>Ei("FinancialSummary",{routeProps:{summaryId:e}}),children:I(fa,{children:"Talk to a bookkeeper"})})]})}function ac({summaryId:e,conversationId:t}){const n=Nn(t);return Sn(e)?I($s,{}):n?I(tc,{conversationId:t,summaryId:e}):I(rc,{summaryId:e})}const oc=Dt({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),ic=Dt({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"});function lc({summaryData:e}){const t=Nn(e?.summary),n=Nn(e?.conversation);return N("div",{className:oc,children:[I(Xs,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),I("div",{className:ic,children:I(ac,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const sc=Dt({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),cc=Bt({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),dc=Kt(null,Dt({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),uc=Dt({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function hc({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},Wn({queryKey:(t={limit:1,filter:{date:{equal:nn(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Zi(t):["summaries",{}],queryFn:Qi,...n});var t,n}(t),a=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${to.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${no.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility.`}():n?.summary??"A summary of this month's financials will appear here once more data is available.";return N("div",{className:uc,children:[I("div",{"data-testid":"financial-summary-layout",className:cc({isSample:e}),children:!e&&r?I(Ks,{}):N("div",{className:sc,children:[I(Hs,{stylists:[dc],children:a}),e&&I(eo,{size:"lg"})]})}),I(lc,{summaryData:n})]})}const pc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},gc={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},mc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:gc.short.credentialsChanged,longMessage:gc.long.relinkCredentials,buttonType:pc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:gc.short.credentialsChanged,longMessage:gc.long.relinkCredentials,buttonType:pc.RELINK},INVALID_MFA:{shortMessage:gc.short.credentialsChanged,longMessage:gc.long.relinkCredentials,buttonType:pc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:gc.short.credentialsChanged,longMessage:gc.long.invalidUpdatedUsername,buttonType:pc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:gc.short.accountLocked,longMessage:gc.long.accountLocked,buttonType:pc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:gc.short.credentialsChanged,longMessage:gc.long.relinkCredentials,buttonType:pc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:gc.short.supportChanged,longMessage:gc.long.supportChanged,buttonType:pc.CHAT},USER_SETUP_REQUIRED:{shortMessage:gc.short.updateNeeded,longMessage:gc.long.updateNeeded,buttonType:pc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:gc.short.supportChanged,longMessage:gc.long.mfaUpdateNeeded,buttonType:pc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:gc.short.noAccountsAvailable,longMessage:gc.long.noAccountsUnlink,buttonType:pc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:gc.short.noAccountsAvailable,longMessage:gc.long.noAccountsUnlink,buttonType:pc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:gc.short.connectionError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},ITEM_NOT_FOUND:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},PRODUCT_NOT_READY:{shortMessage:gc.short.serverError,longMessage:gc.long.productNotReady,buttonType:pc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:gc.short.connectionError,longMessage:gc.long.permissionRevoked,buttonType:pc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:gc.short.temporarilyDown,longMessage:gc.long.bankMaintenance,buttonType:pc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:gc.short.serverDown,longMessage:gc.long.serverDown,buttonType:pc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:gc.short.temporarilyDown,longMessage:gc.long.bankMaintenance,buttonType:pc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:gc.short.supportChanged,longMessage:gc.long.supportChanged,buttonType:pc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:gc.short.connectionError,longMessage:gc.long.connectionError,buttonType:pc.CHAT},PLANNED_MAINTENANCE:{shortMessage:gc.short.temporarilyDown,longMessage:gc.long.bankConnectionMaintenance,buttonType:pc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:gc.short.requestError,longMessage:gc.long.connectionError,buttonType:pc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:gc.short.inputError,longMessage:gc.long.connectionError,buttonType:pc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:gc.short.volumeDown,longMessage:gc.long.bankMaintenance,buttonType:pc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:gc.short.serverError,longMessage:gc.long.connectionError,buttonType:pc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:gc.short.updateNeeded,longMessage:gc.long.partnerCredsChange,buttonType:pc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:gc.short.credentialsExpiring,longMessage:gc.long.credentialsExpiring,buttonType:pc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:gc.short.relinkNeeded,longMessage:gc.long.relinkForStatements,buttonType:pc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:gc.short.connectionError,longMessage:gc.long.connectionError,buttonType:pc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:gc.short.generic,longMessage:gc.long.generic,buttonType:pc.CHAT}}};function vc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return wr({error:new Error("No bank error provided. Should not get here"),severity:"error"}),mc.DEFAULT.DEFAULT;const n=mc[e];if(!n)return wr({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),mc.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(wr({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),mc.DEFAULT.DEFAULT)}const bc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",shortDescription:"Link your bank to track every dollar",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function fc(e,t=!0){const n=vc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName??"unknown"}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:n?.shortMessage(e.apiInstitutionName??"your bank")||"",description:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!1,apiPartnerName:""})||"",shortDescription:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!0,apiPartnerName:""})||"",type:n?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const yc=Kt(null,Dt({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),xc=Kt(Ut["month-picker-left-button"],Dt({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),kc=Kt(Ut["month-picker-right-button"],Dt({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Tc=Kt(null,Dt({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function Cc({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=tn(e.year,e.month,1),o=Tn(a,{abbreviateMonth:!0});return N("div",{...yc,children:[I(hl,{stylists:[xc],onClick:()=>{return t(0===(n=e).month?{month:11,year:n.year-1}:{month:n.month-1,year:n.year});var n},disabled:r,children:I(Mo,{Component:Eo})}),I("div",{...Tc,children:I(fa,{children:o})}),I(hl,{stylists:[kc],onClick:()=>{return t(11===(n=e).month?{month:0,year:n.year+1}:{month:n.month+1,year:n.year});var n},disabled:n,children:I(Mo,{Component:Ao})})]})}const wc=Dt({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function Ec({children:e}){return I("div",{className:wc,children:e})}const Ac=Kt(Ut["progress-bar"],Dt({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Ic=Kt(Ut["progress-bar-fill"],Dt({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Sc=Kt(Ut["tile-bar-label"],Dt({paddingLeft:"10px"}));function Nc({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i=Qt([Ic,Kt(null,n)]);return N("div",{...Ac,style:{width:a},children:[I("div",{...i,style:{width:`${t}%`},children:o&&I("div",{...Sc,children:I(xl,{children:e})})}),!o&&I("div",{...Sc,children:I(xl,{children:e})})]})}const Pc=Kt(Ut["metric-md"],Xt({metric:"md"}));function Mc(e){return I("div",{...Pc,children:e.children})}const Rc=Kt(null,Dt({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),Dc=Kt(null,Dt({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),Lc=({label:e,amount:t,total:n,colorCss:r})=>{const a=n>0?function(e,t,n,r=0,a=100){return r+(e-t)*(a-r)/(n-t)}(t,0,n):0;return N("div",{...Rc,children:[I(Nc,{label:e,percentage:a,color:r}),I("div",{...Dc,children:I(Mc,{children:ma(t)})})]})},Oc={netIncome:0,income:0,expenses:0,absoluteSum:0},Fc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return Oc;const t=e.json?.data?.[0];if(Sn(t))return Oc;const n=t.income?.total??0,r=t.expenses?.total??0,a=F(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Bc=wo(e=>p.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),p.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),p.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),p.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Vc({Component:e,stylists:t}){return I(e,{stylists:[Kt(Ut["medium-icon"],Ut.icon),...t??[]],size:15})}const Uc={},Wc=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Uc[e]={loading:!1,error:null,scriptEl:t}},Hc="undefined"!=typeof window&&void 0!==window.document;function qc({src:e,checkForExisting:t=!1,...n}){let r=Uc[e];!r&&t&&e&&Hc&&(r=Wc(e));const[a,o]=y(r?r.loading:Boolean(e)),[i,l]=y(r?r.error:null),[s,c]=y(!1);return k(()=>{if(!Hc||!e||s||i)return;let a;r=Uc[e],!r&&t&&(r=Wc(e)),r?a=r.scriptEl:(a=document.createElement("script"),a.src=e,Object.keys(n).forEach(e=>{void 0===a[e]?a.setAttribute(e,n[e]):a[e]=n[e]}),r=Uc[e]={loading:!0,error:null,scriptEl:a});const d=()=>{r&&(r.loading=!1),o(!1),c(!0)},u=e=>{r&&(r.error=e),l(e)};return a.addEventListener("load",d),a.addEventListener("error",u),document.body.appendChild(a),()=>{a.removeEventListener("load",d),a.removeEventListener("error",u),r&&r.loading&&(a.remove(),delete Uc[e])}},[e]),[a,i]}const jc=e=>["integrations",e??{}],zc=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:fo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Kc(e,t){return Yo({...t,queryKey:jc(e),queryFn:zc})}function Yc(e){return Kc({filter:{apiName:{equal:"PLAID"}}},e)}function _c(e){return Fr(`${t=e,Br[t]}/v1`,"v1");var t}async function Zc({institutionId:e,accessToken:t,environment:n}){if(!t)throw new Error("Access token is required to get Plaid item institution");const r={path:"/banks2/bankUrl",accessToken:t,endpointManager:_c(n)},{url:a,headers:o}=Mr(r);return await _o({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const Gc=Kt(Ut["button-danger"],Dt({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-text":{color:"typography.intent.danger.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.danger.active",borderColor:"border.intent.danger.active","& .Tight-text":{color:"typography.intent.danger.active"}},"& .Tight-text":{color:"typography.intent.danger"}}));function Qc({children:e,stylists:t=[],...n}){return I(dl,{stylists:[Gc,...t],...n,children:e})}const Xc=Kt(Ut["button-tertiary"],Dt({color:"typography.intent.success",border:"{borderWidths.md} solid",borderColor:"border.intent.success",backgroundColor:"surface.intent.success","& .Tight-text":{color:"typography.intent.success"},"& path":{stroke:"icon.intent.success"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-text":{color:"typography.intent.success.hover"},"& path":{stroke:"icon.intent.success.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.success.active",borderColor:"border.intent.success.active","& .Tight-text":{color:"typography.intent.success.active"},"& path":{stroke:"icon.intent.success.active"}}}));function Jc({children:e,stylists:t=[],...n}){return I(dl,{stylists:[Xc,...t],...n,children:e})}const $c="cancel",ed="danger",td="success",nd=Bt({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),rd=Bt({base:{background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",gap:"16px"},variants:{size:{sm:{maxWidth:"360px",minWidth:"0",margin:"32px"},md:{maxWidth:"600px",minWidth:"400px",margin:"32px"},lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},margin:{sm:"32px",base:"0"},height:{sm:"auto",base:"100dvh"}}},padding:{none:{padding:"0"},sm:{padding:"8px"},md:{padding:"16px"},lg:{padding:"24px"}}},defaultVariants:{size:"sm",padding:"md"}}),ad={transform:"none",willChange:"auto"};function od({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=$({open:e,strategy:"fixed"}),c=ie(s,{outsidePress:o,escapeKey:i}),d=le(s,{role:t}),{getFloatingProps:u}=se([c,d]),h=[rd({size:r,padding:a}),l].filter(Boolean).join(" ");return e?I(ge,{children:I(pe,{lockScroll:!0,className:nd(),children:I(me,{context:s,modal:!0,returnFocus:!0,children:I("div",{...u(),className:h,style:ad,children:n})})})}):null}const id=Dt({display:"flex",justifyContent:"flex-end",gap:"8px"}),ld="success",sd="danger",cd=be.createConfirmation(fe(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return N(od,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Ut["alert-dialog"],children:[I(fa,{wrap:"wrap",stylists:[Kt(Ut["alert-header"])],children:n}),r&&"string"==typeof r?I(xl,{wrap:"wrap",children:r}):I(S,{children:r}),I("div",{className:id,children:a.map(e=>{const n=(e=>{switch(e){case sd:return Qc;case ld:return Jc;default:return hl}})(e.type);return I(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:I(fa,{children:e.label})},e.key)})})]})}));function dd(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}function ud(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function hd(e,t){return t?e?`${e} ${ud(t)}`:ud(t):e??""}const pd=e=>Ei("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),gd=Dt({display:"flex",flexDirection:"column",gap:"12px"});async function md(e){await cd({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:$c,label:"Cancel"},{key:td,label:"Chat",type:ld}]})===td&&pd({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const vd=e=>["banks/accounts",e??{}],bd=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:fo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function fd(e){const t=e?.params;return Yo({queryKey:t?vd(t):["banks/accounts",{}],queryFn:bd,enabled:e?.enabled,select:e?.select})}function yd(e,t){return Ii({queryKey:In(["banks/accounts",{}],{}),queryFn:bd,accessToken:e,environment:t})}const xd=e=>{const t=e?.status?"DELETED"===e.status?"REMOVED":e.status:"ACTIVE",n="MORTGAGE"!==e?.apiType&&"BROKERAGE"!==e?.apiType&&e?.apiType?e.apiType:"OTHER";return{iconUrl:"",...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Hi({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Hi({id:e.plaidItemId||e.oauthAccountId,prefix:"INTEGRATION"}),apiInstitutionId:e.apiInstitutionId??null},mask:e.apiMask??"",beginningBalanceData:{},isSupported:e.isSupported||!1,tranStartDate:e.tranStartDate||null,tranMinStartDate:e.tranMinStartDate||null,latestTransactionDate:e.latestTransactionDate||null}},kd=Kt(Ut["button-secondary"],Dt({color:"typography.intent.primary",border:"{borderWidths.md} solid",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary","& .Tight-text":{color:"typography.intent.primary"},"& path":{stroke:"icon.intent.primary"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"},"& path":{stroke:"icon.intent.primary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.primary.active",borderColor:"border.intent.primary.active","& .Tight-text":{color:"typography.intent.primary.active"},"& path":{stroke:"icon.intent.primary.active"}}}));function Td({children:e,stylists:t=[],...n}){return I(dl,{stylists:[kd,...t],...n,children:e})}function Cd({mutationFn:e,onMutateFn:t,...n}){const r=Ln(),a=Un(),o=!Mn(r);return L({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):On,onMutate:o&&Nn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},Bn)}const wd=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:Wr(n)};return await Or(r)},Ed=async({data:e,accessToken:t,environment:n})=>wd({data:e,accessToken:t,environment:n}),Ad=async({data:e,accessToken:t,environment:n})=>wd({data:e,accessToken:t,environment:n}),Id=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/accounts",bodyParams:{accounts:e.accounts},accessToken:t,endpointManager:Wr(n)};return await Or(r)})({data:{accounts:e},accessToken:t,environment:n});function Sd(e){return Cd({onSuccess:async()=>{Cr("mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},...e})}function Nd(){return Sd({mutationFn:Ad})}function Pd(){return Cd({onSuccess:async()=>{Cr("mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},mutationFn:Id})}const Md=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,Rd=e=>"PLAID"===e,Dd=e=>e>0?"Deposited to":"Withdrawn from",Ld=e=>({id:qi(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),Od=Dt({display:"flex",flexDirection:"column",gap:"16px"}),Fd=async()=>cd({title:"Merge Accounts",body:N("div",{className:Od,children:[I(xl,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),I(xl,{wrap:"wrap",children:"This action can't be undone."}),I(xl,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:$c,label:"Cancel"},{key:ed,label:"Continue",type:sd}]}),Bd=()=>cd({title:"Merge Failed",body:I(xl,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:$c,label:"OK"}]}),{formContext:Vd,fieldContext:Ud,useFieldContext:Wd,useFormContext:Hd}=ye(),qd=wo(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{id:"icon/check"},p.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function jd({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return N(Jc,{type:"submit",disabled:n,children:[e&&I(Mo,{Component:qd}),I(fa,{children:t})]})}const zd=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Kd=[Kt(null,Dt({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Yd=Kt(null,Dt({display:"flex",alignItems:"center",gap:"4px"}));function _d({errorMessage:e}){return N("div",{...Yd,children:[I(Vc,{Component:zd,stylists:Kd}),I(xa,{intent:"danger",wrap:"wrap",children:e})]})}const Zd=Dt({display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",backgroundColor:"surface.intent.action.discrete","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discrete.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Gd=Dt({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Qd=Dt({display:"flex",justifyContent:"space-between",alignItems:"center"});function Xd({children:e,inputRef:t,popupTriggerProps:n,label:r,isDefaultValue:a,isTouched:o,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Kt(i||null,Zd,l,Gd,So),[m,v]=y(!0);return N(S,{children:[N("div",{...g,onClick:s,...n,onMouseDown:e=>{v(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{v(!1),c?.()},"data-clicked":m,"data-isdefaultvalue":a,"data-haserror":o&&void 0!==d,"data-disablehover":u,children:[N("div",{className:Qd,children:[void 0!==r&&I(xa,{children:r}),Nn(p)&&I(xa,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&I(_d,{errorMessage:d})]})}const Jd=Dt({border:"{borderWidths.lg} solid transparent","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},"&:focus-within":{cursor:"text"}});function $d({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=Wd(),i=xe(o.store,e=>e.meta.errors[0]?.message),l=xe(o.store,e=>e.meta.isDefaultValue),s=xe(o.store,e=>e.meta.isTouched);return I(Xd,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Ut["discrete-form-input"],additionalStyles:Jd,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function eu(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function tu(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function nu(e){"Enter"===e.key&&e.currentTarget.blur()}const ru=Kt(Ut["amount-input"],Xt({body:"default"}),Dt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),au=Kt(null,Dt({display:"flex",alignItems:"center",gap:"2px"}));function ou({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return N("div",{...au,children:[I(Hs,{children:"$"}),I(Te,{...ru,getInputRef:n,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:r,onBlur:a,onKeyDown:nu,autoFocus:o})]})}const iu=Dt({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),lu=Bt({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function su({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Wd(),u=xe(d.store,e=>e.meta.errors[0]?.message),h=xe(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=Nn(c)?c-p:void 0,m=a?iu:lu({kind:e});return I(Xd,{label:t,inputRef:r,popupTriggerProps:o,className:Ut["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const cu=Kt(null,Dt({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function du({options:e,onSelect:t,selectedLabel:n}){const r=Vl();return I("div",{...cu,children:e.map(e=>I(Xl,{onClick:()=>{return n=Number(e.value),r.close(),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const uu=wo(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2922)"},p.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_9779_2922"},p.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),hu=Kt(null,Dt({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),Io);function pu({selectedLabel:e,options:t,onSelect:n}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>N("div",{...hu,...t,children:[I(fa,{children:e}),I(Hl,{Component:uu})]})}),I(Gl,{children:I(du,{options:t,onSelect:n,selectedLabel:e})})]})}const gu=Kt(null,Dt({display:"flex",alignItems:"center",gap:"15px"})),mu=dn.map((e,t)=>({value:t,label:e})),vu=un({}).map(e=>({value:e,label:String(e)}));function bu({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return N("div",{...gu,children:[I(pu,{selectedLabel:dn[r],options:mu,onSelect:e=>a(n,e)}),I(pu,{selectedLabel:String(n),options:vu,onSelect:e=>a(e,r)})]})}const fu=Kt(null,Dt({background:"surface.foreground",padding:"25px",gap:"15px"})),yu=Kt(null,Dt({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),xu=Kt(null,Dt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),Io),ku=Kt(null,Dt({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),Tu=Kt(null,Dt({padding:"8px",textAlign:"center"})),Cu=Kt(null,Dt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discrete.active",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.active"},"&[data-today='true']::after":{content:"''",position:"absolute",bottom:"3px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"brand.primary"},"&:disabled":{cursor:"default"}}),Io),wu=Kt(null,Dt({color:"typography.base"}));function Eu({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&hn(e,t),l=pn(e),s=e.getMonth()!==n,c=!!a&&gn(e,a),d=!!o&&gn(o,e);return I("button",{...Cu,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:I(fa,{stylists:s||c||d?[wu]:[],children:e.getDate().toString()})})}function Au({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=Vl(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=tn(e,t,1),r=new Date(n);return r.setDate(r.getDate()-n.getDay()),Array.from({length:42},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n})}(s,c),u=(h=d)[h.length-1];var h;const p=void 0===a||u&&gn(a,u),g=Sn(o)||d.length>0&&gn(d[0],o),m=e=>{t(e),i.close()},v=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return N("div",{...fu,children:[N("div",{...yu,children:[I("button",{...xu,onClick:()=>v(-1),disabled:!g,children:I(Mo,{Component:Eo})}),I(bu,{currentMonthYear:l,onMonthYearChange:r}),I("button",{...xu,onClick:()=>v(1),disabled:!p,children:I(Mo,{Component:Ao})})]}),N("div",{...ku,children:[cn.map(e=>I("div",{...Tu,children:I(xa,{children:e})},e)),d.map(t=>I(Eu,{date:t,selectedDate:e,currentMonth:c,onClick:m,maxDate:a,minDate:o},t.toISOString()))]})]})}const Iu=Kt(null,Xt({body:"default"}),Dt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Su=Kt(null,Xt({body:"default"}),Dt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",cursor:"text",overflowWrap:"break-word",minWidth:"100%",maxWidth:"100%","&::placeholder":{color:"typography.base.weak"},"&:focus":{outline:"none"}}));function Nu(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const Pu=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:a,caption:o,entityId:i}=e,l=Wr(n).getUrl(`/files/upload/${a}`),s=Mn(o)?"att_"+i:o,c=new FormData;return c.append("file",r),c.append("caption",s),c.append("entityId",String(i)),(await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`},credentials:"include",body:c})).json()},Mu=async({data:e,accessToken:t,environment:n})=>{const r=Wr(n).getUrl("/files/attachment");return(await fetch(r,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e.id})})).json()};const Ru=Dt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Du=({onFileSelect:e,onUploadComplete:t})=>{const n=g(null),{mutateAsync:r,isPending:a}=Cd({mutationFn:Pu,onSuccess:async()=>Bn.invalidateQueries({queryKey:["files/attachments"]})});return N("div",{children:[I("input",{type:"file",multiple:!0,ref:n,onChange:async a=>{const o=Array.from(a.target.files??[]);if(0===o.length)return;const i=o.map(e=>({localId:crypto.randomUUID(),file:e,name:e.name,size:e.size})),l=i.map(({localId:e,name:t,size:n})=>({localId:e,name:t,size:n,id:null,isPending:!0}));e?.(l);try{const e=i.map(async({localId:e,file:t})=>({localId:e,result:await r({file:t,entity:"message",caption:t.name,entityId:null})})),n=(s=l,c=await Promise.allSettled(e),s.map(({localId:e,name:t,size:n})=>{const r=c.find(t=>"fulfilled"===t.status&&t.value.localId===e);if(r&&"fulfilled"===r.status){const a=r.value.result?.attachment?.id??null;return{localId:e,name:t,size:n,id:a,isPending:!1}}return{localId:e,name:t,size:n,id:null,isPending:!1}}));t?.(n)}finally{n.current&&(n.current.value="")}var s,c},style:{display:"none"}}),I(hl,{type:"button",onClick:()=>{n.current?.click()},disabled:a,children:I("span",{className:Ru,children:I(Vc,{Component:us})})})]})},Lu=h.object({localId:h.string(),id:h.number().nullable(),name:h.string(),size:h.number(),isPending:h.boolean()}),Ou=h.object({message:h.object({text:h.string(),attachments:h.array(Lu)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})}),Fu=Dt.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),Bu=Dt.raw({visibility:"hidden",fontSizeAdjust:"none",fontSize:"100%",fontStyle:"normal",letterSpacing:"normal",fontStretch:"normal",fontVariant:"normal",fontWeight:"normal",textAlign:"left",textAlignLast:"initial",textDecoration:"none",textEmphasis:"none",textIndent:"0px",textJustify:"auto",textShadow:"none",textTransform:"none"}),Vu=Dt(Bu,Fu),Uu=Dt.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Wu=Dt(Uu,Fu,Xt.raw({body:"default"})),Hu=Dt({display:"block",width:"100%"}),qu=Dt({position:"relative"}),ju=Dt({display:"flex",justifyContent:"flex-end",gap:"15px"}),zu=Dt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Ku=C(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:a,hideFileUpload:o},i){const l=Wd(),s=g(null),{startCallback:c}=Xo({delay:50,callback:e=>n(e)});w(i,()=>s.current);const d=!e&&Ou.safeParse(l.form.state.values).success;return I(su,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(Nu(t),void c(!0)),children:N("div",{className:Hu,children:[N("div",{className:qu,children:[N("pre",{className:Vu,children:[l.state.value.text,I("br",{})]}),I("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:Wu,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),N("div",{className:ju,children:[!o&&I(Du,{onFileSelect:r,onUploadComplete:a}),I(hl,{disabled:!d,type:"submit",children:I("span",{className:zu,children:I(Vc,{Component:Ms})})})]})]})})});function Yu(e){return new F(e).div(100).toNumber()}function _u(e){return new F(e).times(100).toNumber()}const Zu=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Gu=e=>{const t=e?.description;return`${t} | ${va(Yu(Number(e?.amount)))} | ${mn(fn(e?.date||""))}`},Qu=v(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function Xu(e,t){switch(t.type){case"increment":return((e,t)=>{let n;if(null===e.focusedIndex)n=0;else{const r=e.focusedIndex+1;n=!t.repeat&&r>e.maxIndex?0:Math.min(r,e.maxIndex)}return{...e,focusedIndex:n}})(e,t);case"decrement":return((e,t)=>{let n;if(null===e.focusedIndex)n=e.maxIndex;else{const r=e.focusedIndex-1;n=!t.repeat&&r<0?e.maxIndex:Math.max(r,0)}return{...e,focusedIndex:n}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function Ju(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function $u(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom&&r.left>=n.left&&r.right<=n.right}function eh(e,t,n){if(null===e)return{node:void 0,metadata:void 0};const r=t[e];return{node:r,metadata:n.get(r)}}function th(e){const[t,n]=y(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=g(null),[r,a]=y(!0),[o,i]=y(!1),l=b(Qu),[s,c]=E(Xu,{focusedIndex:null,maxIndex:e});k(()=>{const e=n.current,t=()=>{Sn(s.focusedIndex)&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[n,s.focusedIndex,c,l?.popupNodeId]);const d=g(null);return k(()=>{c({type:"max",max:e})},[e]),k(()=>{const e=n.current;if(null!==e){const n=e=>{i(!1);const n=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!n)return;const r=Number(e.target.getAttribute("data-index"));s.focusedIndex===r&&d.current===e.target||(0!==e.movementX||0!==e.movementY)&&n&&(a(!0),d.current=e.target,c({type:"set",focusedIndex:r}),t.setCascadeState(!0,r))},r=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;a(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):n&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},o=()=>i(!0);return e.addEventListener("mousemove",n),e.addEventListener("keydown",r),e.addEventListener("scroll",o),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("keydown",r),e.removeEventListener("scroll",o)}}},[t,s.focusedIndex]),{listRef:n,focusedState:s,isMousing:r,isScrolling:o}}(t.size-1,e),l=Vl(),s=x((e,t)=>{n(n=>new Map(n).set(e,t??null))},[]),c=x(e=>{n(t=>{const n=new Map(t);return n.delete(e),n})},[]),{sortedNodes:d,sortedMap:u}=function(e,t){const n=m(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(Ju)),n},[e,t]),r=m(()=>{const t=/* @__PURE__ */new Map;return n.forEach((n,r)=>{const a=e.get(n)??{};t.set(n,{...a,index:r})}),t},[n,e]);return{sortedNodes:n,sortedMap:r}}(t,r);!function(e,t,n,r,a,o){k(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=eh(r,t,n),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,n){const r=e.placement.includes("left"),a=e?.popupParentNodeId,o=a&&n?.hasCascading&&r?"ArrowLeft":"ArrowRight",i=r?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:n?.hasCascading&&t.key===o,shouldCloseCascade:a&&t.key===i}}(a,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=r,g=l,m=i,v=o,!(!(h=s)||!h.hasCascading||null===p||g&&m&&$u(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),a.close())};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,r,n,a,o])}(r,d,u,a.focusedIndex,l,e);const{startCallback:h,cancelCallback:p}=Xo({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&$u(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return v=a.focusedIndex,k(()=>{const e=w.current;if(null===v||f)return;const{node:t,metadata:n}=eh(v,T,C);return A.lastOpenedIndex!==v&&n?.hasCascading&&(A.closeCurrentCascade(),I({focusedIndex:v,node:t,listElement:e})),()=>S()},[v,f=o,w=r,A=e,S=p,T=d,C=u,I=h]),function(e,t,n,r){k(()=>{const{metadata:a}=eh(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),m(()=>({register:s,unregister:c,map:u,focusedIndex:a.focusedIndex,listRef:r,isMousing:o,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,u,a.focusedIndex,r,o,i,l?.nodeId]);var v,f,T,C,w,A,I,S}const nh=v(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function rh({style:e,children:t}){const n=Kt(Ut["popup-list"],Rl,e),r=function(){const[e,t]=y(null),[n,r]=y(!1),[a,o]=y(null),i=x((n,a)=>{n&&e!==a?(o(a),t(a)):n||e!==a||(r(!1),t(null))},[e,r]),l=x(()=>{t(null),o(null),r(!1)},[t,o,r]),s=x(()=>{t(null),o(null),r(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:n,setFocus:r,lastOpenedIndex:a,closeCurrentCascade:s}}(),a=th(r);return I("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:I(Qu.Provider,{value:a,children:I(nh.Provider,{value:r,children:t})})})}function ah({searchTerm:e,setSearchTerm:t,onClick:n,placeholder:r,SearchInput:a,SearchList:o,DefaultList:i,extraProps:l,listLength:s,forceSearchVisible:c}){const d=c||s>=5,u=Rn(e),h=e=>{n?.(e)};return N(S,{children:[d&&I(a,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?I(o,{...l??{},onClick:h,searchTerm:e}):I(i,{...l??{},onClick:h})]})}const oh=Ot(Xt({body:"default"}),Dt({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function ih({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=g(null);return k(()=>{r.current?.focus({preventScroll:!0});const e=e=>{const t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement;!r.current||document.activeElement===r.current||n||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||r.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),I("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:oh})}function lh({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=Vl(),[c,d]=y(""),u=Rn(c),h=l?.(u);return I(Gl,{children:I(rh,{style:h,children:I(ah,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s.close()},placeholder:t,SearchInput:ih,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i})})})}function sh({hasCascading:e=!1}={}){const t=g(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=b(Qu);A(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=m(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;A(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=x(()=>{l?.current?.focus()},[l]),u=m(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const ch=C(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return I("button",{...Ll,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),dh=C(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=sh(),l=he([i,r]);return I(ch,{...Ll,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})});function uh({promptText:e}){return N(S,{children:[I(Mo,{Component:$i}),I(xl,{children:e})]})}function hh({text:e}){return I("div",{...Ll,children:e?I(fa,{children:e}):I(Ya,{styles:Dt({width:"100%",height:"16px"})})})}const ph=Kt(Ut["popup-list"],Rl),gh=()=>N("div",{...ph,children:[I(hh,{}),I(hh,{}),I(hh,{}),I(hh,{}),I(hh,{})]});function mh({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?I(gh,{}):N(S,{children:[r&&I(dh,{onClick:()=>Ei("BankAccountForm"),children:I(uh,{promptText:"Add bank account"})}),e?.map(e=>I(dh,{onClick:()=>t(e),children:I(fa,{wrap:"wrap",children:hd(e?.name,e?.mask)})},e?.id))]})}const vh={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function bh({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=m(()=>new Ce(e??[],vh),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(gh,{}):N(S,{children:[a&&I(dh,{onClick:()=>Ei("BanksAndIntegrations"),children:I(uh,{promptText:"Add bank account"})}),0===i.length?I(hh,{text:"No results found"}):i.map(e=>I(dh,{onClick:()=>n(e),children:I(fa,{wrap:"wrap",children:hd(e?.name,e?.mask)})},e?.id))]})}function fh({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return I(lh,{onClick:e,placeholder:"Search bank accounts...",SearchList:bh,DefaultList:mh,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const yh=Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function xh({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:r=>I(su,{label:e,popupTriggerProps:r,disabled:t,children:I("button",{className:yh,type:"button",disabled:t,children:I(fa,{children:hd(n?.name??"",n?.mask??"")})})})}),I(fh,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const kh=(e,t)=>e?.find(e=>e.glAccountId===t),Th=e=>{const{query:t}=fd({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},Ch=e=>{if(Sn(e))return!1;const t=e.filter(e=>Rd(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||Nn(e.lastSyncedDate))},wh=()=>{const e=fd({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function Eh(e){return e?.filter(e=>Md(e.apiName)&&"ACTIVE"===e.status)}function Ah(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Ih(e){return fd({select:t=>({...t,data:Ah(t?.data,e)})})}const Sh=()=>["expenses/categories"],Nh=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await Qo(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Hi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Hi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function Ph(e){return Wn({...e,queryKey:["expenses/categories"],queryFn:Nh})}function Mh(){return Ph({select:e=>({...e,data:e.data?Lh(e.data):void 0})})}function Rh(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentCategoryId){const e=t.get(n.parentCategoryId)??[];e.push(n),t.set(n.parentCategoryId,e)}return t}function Dh(e){if(0===e.length)return[];const t=Rh(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function Lh(e){if(0===e.length)return[];const t=Rh(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function Oh(){return Jo({prefetchFn:jo(Sh,Nh)})}const Fh=e=>({id:e.id,name:e.name}),Bh=Kt(Ut.text,Xt({label:"strongLabel"}),Dt({maxWidth:"100%"}),ea);function Vh({children:e,stylists:t=[]}){const n=Qt([Bh,...t]);return I("div",{...n,children:e})}const Uh={keys:[{name:"name"}],threshold:.1};function Wh(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function Hh(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(l=r,t.find(e=>e.children?.some(e=>e.id===l.id))),o=!(a||0!==r?.children?.length&&r.children),i=!a&&r.children&&r.children.length>0;var l;a?Wh(a,r,n):o?Wh(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{Wh(e,n,t)})}(r,n)}),n}const qh=Kt(null,Dt({whiteSpace:"normal"})),jh=[Kt(null,Dt({marginLeft:"6px",marginRight:"6px"}))];function zh({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=Ph({select:e=>({...e,data:e.data?Dh(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=m(()=>new Ce(o??[],Uh),[o]),s=m(()=>o?Hh(l.search(e),o):[],[o,e,l]);return a?I(gh,{}):i?I(hh,{text:"No data"}):0===s.length?I(hh,{text:"No results found"}):I(S,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return I(dh,{onClick:()=>t(Fh(n)),children:I(Vh,{stylists:[qh],children:r?n.name:N(S,{children:[e.name,I(Mo,{Component:Ao,stylists:jh}),n.name]})})},`${e.id}_${n.id}`)})})}const Kh=C(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=he([a,t?.ref]);return I(ch,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function Yh({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=b(nh),{itemRef:o,index:i,itemProps:l}=sh({hasCascading:!0}),{isScrolling:s}=b(Qu);return N(Bl,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[I(Ul,{children:t=>I(Kh,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),I(Gl,{initialFocus:a,children:t})]})}const _h=Kt(null,Dt({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Zh({icon:e,displayLabel:t}){return N("div",{..._h,children:[e,I(fa,{wrap:"wrap",children:t}),I(Mo,{Component:Ao})]})}function Gh({category:e,handleCategoryChange:t}){return I(rh,{children:e.children?.map(e=>I(dh,{onClick:()=>t(Fh(e)),children:I(fa,{wrap:"wrap",children:e.name})},e.id))})}function Qh({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=Mh(),a=t?.data,o=!r&&n&&void 0===a;return r?I(gh,{}):o?I(hh,{text:"No data"}):I(S,{children:a?.map(t=>t.hasChilds?I(Yh,{triggerChildren:I(Zh,{displayLabel:t.name}),popupChildren:I(Gh,{category:t,handleCategoryChange:e})},t.id):I(dh,{onClick:()=>e(Fh(t)),children:I(fa,{wrap:"wrap",children:t.name})},t?.id))})}const Xh=({onClick:e})=>{const{query:{data:t}}=Mh();return I(lh,{onClick:e,placeholder:"Search expense categories...",SearchList:zh,DefaultList:Qh,listLength:(t?.data??[]).length})},Jh=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),$h=wo(e=>p.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),ep=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),tp=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),np=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),rp=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),ap=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),op=wo(e=>p.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function ip(e){switch(e){case"Advertising":case"Advertising and Marketing":return Jh;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return tp;case"Health & Fitness":case"Sports":case"Sporting Goods":return np;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return rp;case"Plane / Train / Bus":case"Airlines":case"Airfare":return ap;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return op;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return ep;default:return $h}}const lp=Kt(Ut["category-text"],Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",padding:0,outline:"none",border:"none",background:"none",borderRadius:"md",color:"typography.intent.action",flex:"1 1 0",minWidth:0,cursor:"pointer",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),No),sp=Kt(null,Dt({color:"inherit"})),cp=Kt(Ut["amount-input-container"],Dt({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{color:"typography.intent.action.hover"}},"& .Tight-amount-input, & .Tight-text":{color:"inherit"},"&[data-clicked='true']:focus-within":{outline:"1px solid",outlineOffset:"2px",outlineColor:"border.layout.strong"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"}}),No),dp=()=>["accounting/glAccounts"],up=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await Qo(n);return mp(r)};function hp(e){return Wn({...e,queryKey:["accounting/glAccounts"],queryFn:up})}function pp(){return hp({select:fp})}function gp(){return hp({select:yp})}const mp=e=>e.map(e=>({...e,id:Hi({id:e.id,prefix:"GL_ACCOUNT"})}));function vp(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>vp(e,t))}const bp=e=>!e.parentAccountNo;function fp(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentAccountNo){const e=t.get(n.parentAccountNo)??[];e.push(n),t.set(n.parentAccountNo,e)}return t}(e);return e.filter(bp).map(e=>({...e,children:vp(e,t)}))}function yp(e){return fp(e).flatMap(e=>[e,...e.children])}const xp=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function kp(e,t){return m(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Tp=Dt({display:"grid",textWrap:"nowrap",width:"100%"});function Cp({children:e,rows:t,cols:n}){return I("div",{className:Tp,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const wp=Bt({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function Ep({option:e,handleClick:t,selected:n,width:r,backgroundColor:a}){const o=Ot(wp({width:r,backgroundColor:a}),nl,el,tl,Io);return void 0===e?null:I("button",{type:"button",className:o,onClick:()=>t(e),"data-active":n?.value===e.value,children:n?.value===e.value?I(fa,{wrap:"wrap",textAlign:"center",children:e.label}):I(xl,{wrap:"wrap",alignment:"center",children:e.label})})}function Ap({options:e,handleClick:t,selected:n,rows:r,cols:a}){return I(Cp,{rows:r,cols:a,children:e?.map(e=>I(Ep,{option:e,handleClick:t,selected:n},e.value))})}function Ip({options:e}){const t=Vl(),n=Wd();return I(Gl,{children:I(rh,{children:e.map(e=>I(dh,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.close()},children:I(xl,{children:e.label})},e.value))})})}const Sp=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),Np=Kt(null,Dt({color:"typography.base.weak"})),Pp=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Mp=Dt({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),Rp=Bt({base:{display:"flex",flexDirection:{base:"row",sm:"column"},alignItems:{base:"center",sm:"start"},justifyContent:"flex-start",textAlign:"start",gap:"4px",maxWidth:"100%",flexWrap:"wrap",minWidth:0},variants:{active:{true:{flexDirection:"column-reverse",alignItems:"start"},false:{flexDirection:{base:"column"},alignItems:{base:"start"}}}}});function Dp({accountName:e,accountNo:t,syncText:n,active:r=!0}){const a=t?`${e} ${ud(t)}`:e;return N("div",{className:Rp({active:r}),children:[n&&I(xa,{intent:r?"normal":"danger",children:n}),I(xl,{wrap:"ellipsis",children:a})]})}const Lp=e=>["plaidInstitutionLogo",e??{}];function Op(e){const t=Ln(),n=Un();return R({queryKey:Lp({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await Zc({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const Fp=Dt({display:"flex",gap:"10px",maxWidth:"100%"});function Bp({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=Op(n);return N("div",{className:Fp,children:[i&&o?I("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):I(Ps,{Component:tp}),I(Dp,{accountName:e,accountNo:t,active:a,syncText:r})]})}const Vp=Dt({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function Up({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return I(hl,{...r,disabled:n,width:"fill-parent",children:I(Vh,{children:e?hd(e.name,e.mask):N("div",{className:Vp,children:[I(xl,{children:t}),I(Mo,{Component:$i})]})})})}const Wp="TRIGGER_ACCOUNT",Hp="FORM_SELECTABLE_ACCOUNT",qp=Dt({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function jp({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return N("div",{className:qp,children:[N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(Up,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===Wp?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),I(fh,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&I(_d,{errorMessage:o})]})}const zp=(e,t,n)=>{if(!n)return;const r=e===Hp?t:n,a=e===Hp?n:t,o=(i=r?.mask,l=a?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=a?.apiName,Rd(c)&&Md(d));var c,d;const u=(h=r?.status,p=a?.status,"ACTIVE"===h&&"INACTIVE"===p);var h,p;return o?"Selected account number does not match destination account number":s?"Merging a linked account into a manually tracked account may result in duplicate transactions":u?"You selected an active account to be merged into an archived account":void 0},Kp=Dt({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),Yp=Dt({display:{base:"block",sm:"none"}}),_p=Dt({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),Zp=Dt({display:"flex",justifyContent:"center",alignItems:"center"}),Gp=Dt({display:{base:"none",sm:"block"}}),Qp=Dt({display:{base:"block",sm:"none"}});function Xp({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return N("div",{className:Kp,children:[N("div",{className:_p,children:[o?I(jp,{selectedAccount:t,setSelectedAccount:a,mergeDestination:Wp,bankAccounts:n,isFilling:r,warningMessage:zp(Wp,e,t??null)}):I(Up,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),N("div",{className:Zp,children:[I("div",{className:Gp,children:I(Vc,{Component:Ao})}),I("div",{className:Qp,children:I(Vc,{Component:uu})})]}),I(Bp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration.apiInstitutionId??""})]}),I("div",{className:Yp,children:I(vi,{alignment:"horizontal"})})]})}const Jp=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await Qo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function $p(){return Wn({queryKey:["expenses/vendors"],queryFn:Jp})}const eg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:Wr(n)};return await Or(r)},tg=Ot(Xt({body:"default"}),Dt({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),ng=Dt({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),rg=Dt({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"});function ag({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return N("div",{className:ng,children:[I("input",{ref:o,type:"text",placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r()):"Escape"===e.key&&(e.preventDefault(),a())},onFocus:e=>{e.stopPropagation()},className:tg}),I("button",{type:"button",onClick:r,className:rg,children:I(xa,{children:"Add"})})]})}function og({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=y(!1),[o,i]=y(""),l=g(null);return k(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),I(dh,{onClick:r?void 0:()=>{a(!0)},children:r?I(ag,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):I(uh,{promptText:e})})}const ig={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function lg({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=m(()=>new Ce(e??[],ig),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(gh,{}):N(S,{children:[I(og,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?I(hh,{text:"No results found"}):i.map(e=>I(dh,{onClick:()=>n(e),children:I(xl,{children:e.name})},e.id))]})}function sg({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?I(gh,{}):N(S,{children:[I(og,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>I(dh,{onClick:()=>t(e),children:I(xl,{children:e.name})},e.id))]})}function cg({onClick:e}){const{query:{data:t,isLoading:n}}=$p(),{mutate:r}=Cd({mutationFn:eg,onSuccess:async()=>Bn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return I(lh,{onClick:e,placeholder:"Search vendors...",SearchList:lg,DefaultList:sg,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const dg=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await Qo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function ug(){return Wn({queryKey:["clientMgmt/clients"],queryFn:dg})}const hg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:Wr(n)};return await Or(r)},pg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function gg({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=m(()=>new Ce(e??[],pg),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(gh,{}):N(S,{children:[I(og,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?I(hh,{text:"No results found"}):i.map(e=>I(dh,{onClick:()=>n(e),children:I(xl,{children:e.name})},e.id))]})}function mg({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?I(gh,{}):N(S,{children:[I(og,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>I(dh,{onClick:()=>t(e),children:I(xl,{children:e.name})},e.id))]})}function vg({onClick:e}){const{query:{data:t,isLoading:n}}=ug(),{mutate:r}=Cd({mutationFn:hg,onSuccess:async()=>Bn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return I(lh,{onClick:e,placeholder:"Search customers...",SearchList:gg,DefaultList:mg,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function bg({frequencies:e,onClick:t}){const n=Vl();return I(Gl,{children:I(rh,{children:e.map(e=>I(dh,{onClick:()=>(t(e),void n.close()),children:I(fa,{children:e.name})},e.value))})})}const{useAppForm:fg,withForm:yg}=ke({formContext:Vd,fieldContext:Ud,formComponents:{SaveButton:jd},fieldComponents:{DiscreteAmountField:function({label:e}){const t=g(null),n=Wd();return I($d,{inputRef:t,label:e,children:I(ou,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=g(null),r=Wd();return I(su,{inputRef:n,label:e,children:I(ou,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=Wd(),i=xe(o.store,e=>e.meta.isDefaultValue),l=g(null),[s,c]=y(()=>o.state.value?fn(o.state.value):/* @__PURE__ */new Date),d=o.state.value?fn(o.state.value):null,[u,h]=y(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const a=bn(r);if(a){let e=a;t&&n?e=kn(xn(a,t),n):t?e=xn(a,t):n&&(e=kn(a,n)),o.handleChange(yn(e)),c(e)}else o.handleChange("")},m=u||(d?mn(d):""),[v,b]=y(!1),f=e=>{v&&(()=>{if(d&&!i){const e=bn(u);(t&&e&&gn(e,t)||n&&e&&gn(n,e))&&h(mn(d))}})(),b(e)},x=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},k=a?su:$d;return N(Bl,{placement:"bottom-start",onOpenChange:f,open:v,children:[I(Ul,{children:t=>I(k,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:I("input",{...Iu,ref:l,type:"text",id:o.name,value:m,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:x,autoComplete:"off"})})}),I(Gl,{initialFocus:!1,children:I(Au,{selectedDate:d,onDateSelect:e=>{o.handleChange(yn(e)),h(mn(e)),c(e)},viewDate:s,onViewDateChange:c,maxDate:t,minDate:n})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:n=!1,resizeable:r=!0}){const a=Wd(),o=g(null);return I(su,{label:e,inputRef:o,children:I("textarea",{...Su,ref:o,value:a.state.value||"",onChange:e=>a.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:r?"both":"none"},autoFocus:n})})},MessageAreaInput:Ku,SplitExpenseCategoryField:function({value:e,onChange:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>N("button",{...lp,...t,type:"button",children:[I(Vc,{Component:ip(e?.name)}),I(fa,{stylists:[sp],children:e?.name||"Uncategorized"})]})}),I(Xh,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=y(!1);return I("div",{...cp,"data-clicked":r,children:I(ou,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Wd(),r=Th(t.id),{query:{data:a},isFilling:o}=fd({select:e=>({...e,data:Eh(e?.data)})}),i=a?.data,l=Sn(e)||!Zu(e);return I(xh,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Wd(),{query:{data:r}}=gp(),a=function(e){const{query:t}=fd({select:t=>({...t,data:kh(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=fd({select:e=>{return{...e,data:(t=e?.data,t?.filter(e=>"ACTIVE"===e.status&&e.isSupported&&e.glAccountId))};var t}}),l=o?.data,s=e?Dd(e.amount):"";return I(xh,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId));var a,o,i;t&&n({id:(i=t).id||"",name:i.name,accountNo:i.accountNo})},bankAccount:a,bankAccountOptions:l,isFilling:i})},ButtonGroupField:function({label:e,options:t}){const n=Wd(),r=t.find(e=>e.value===n.state.value);return I(su,{label:e,disableHover:!0,children:I(Ap,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Ap,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Wd();return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:a=>I(su,{label:t,popupTriggerProps:a,disabled:n,children:I("button",{...Sp,type:"button",children:r.state.value?I(fa,{children:Pp(e,r.state.value)}):I(fa,{stylists:[Np],children:`Select ${t}...`})})})}),I(Ip,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=Wd(),i=g(null);return I(su,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:I("input",{className:Mp,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:Xp,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=g(null),o=r?su:$d;return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(o,{inputRef:a,label:e,popupTriggerProps:t,children:I(fa,{children:n?.name??"Select a vendor..."})})}),I(cg,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=g(null),o=r?su:$d;return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(o,{inputRef:a,label:e,popupTriggerProps:t,children:I(fa,{children:n?.name??"Select a customer..."})})}),I(vg,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=g(null),a=`${n?.name??Ni[0].name}`;return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(su,{inputRef:r,label:e,popupTriggerProps:t,children:I(fa,{children:a})})}),I(bg,{frequencies:Ni,onClick:t})]})}}});const xg=[Kt(null,Dt({"& path":{stroke:"icon.base"}}))];function kg({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return N(hl,{type:"button",onClick:n,children:[e&&I(Mo,{Component:Wl,stylists:xg}),I(fa,{children:t})]})}const Tg=Dt({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),Cg=Dt({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),wg=Dt({maxWidth:"600px"}),Eg=Dt({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),Ag=Dt({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Ig=Dt({display:"flex",justifyContent:"flex-start",alignItems:"center"}),Sg=Dt({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),Ng=Dt({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),Pg=Dt({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),Mg=e=>{eu(e),tu(e)};function Rg({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=fd(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=Pd(),a=Ln(),o=Un(),i=Nn(n),l=i?{selectedAccounts:n}:e;return i&&a&&n.forEach(({duplicateAccount:e})=>{var t,n,r;e&&(t=e.id,n=a,r=o,Si({queryKey:In(Ri({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:Li,accessToken:n,environment:r}))}),fg({defaultValues:l,onSubmit:async e=>{if(await Fd()===ed){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await Bd());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=In(Ri({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await Ii({queryKey:r,queryFn:Li,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o),r=(i=fn(e.tranStartDate||""),l=fn(n||""),s=fn(e.tranMinStartDate||""),Sn(l)?i:Nn(s)?kn(l,s):(Nn(i)&&kn(l,i),i));var i,l,s;return Sn(r)?null:yn(r)})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...Ld(t),duplicateBankAccountIds:[qi(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Bd()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return N("form",{className:Tg,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:Mg,children:[N("div",{className:Cg,children:[I(fa,{children:"Merge Accounts"}),I("div",{className:wg,children:I(xl,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),N("div",{className:Eg,children:[N("div",{className:Ag,children:[I("div",{className:Ig,children:I(fa,{children:"Duplicate Account"})}),I("div",{className:Sg,children:I(fa,{children:"Into"})}),I("div",{className:Ng,children:I(fa,{children:"Destination Account"})})]}),I(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>I(i.AppField,{name:`selectedAccounts[${n}]`,children:t=>{const n=t.state.value.duplicateAccount?.id,o=function(e,t,n,r){const a=function(e,t,n){const r=new Set(e.map(e=>e.id));return t.forEach(({duplicateAccount:e})=>{e&&e.id!==n&&r.add(e.id)}),Array.from(r)}(e,t,n);return r?.filter(e=>!a.includes(e.id)&&Md(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return I(Xp,{destinationAccount:t.state.value.destinationAccount,selectedDuplicate:t.state.value.duplicateAccount,availableAccounts:o,isFilling:a,onSelectionChange:e=>{const n={duplicateAccount:e,destinationAccount:t.state.value.destinationAccount};t.handleChange(n)}},t.state.value.destinationAccount.id)}},n))})]}),I("div",{className:Pg,children:I(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return N(S,{children:[I(kg,{showIcon:!1,onClick:()=>n()}),I(Td,{onClick:()=>i.reset(o),disabled:!t,children:I(fa,{children:"Clear Selections"})}),I(jd,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const Dg=Dt({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",width:"100%",maxWidth:"100%",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative",overflow:"hidden",boxSizing:"border-box"}),Lg=be.createConfirmation(fe(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return I(od,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:I("div",{className:Dg,children:I(Rg,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function Og({plaidItemAccounts:e,matchingAccountPairs:t}){await Lg({matchingAccountPairs:t,plaidItemAccounts:e})}const Fg=Dt({display:"flex",flexDirection:"column",gap:"12px"}),Bg=async(e,t,n)=>{try{const r=await async function({accessToken:e,plaidItemId:t,environment:n}){if(!e)throw new Error("Access token is required to create Plaid link token");const r={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:_c(n)},{url:a,headers:o}=Mr(r);return _o({url:a,includeCredentials:!0,extraHeaders:o,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(Cr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(wr({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),md("NO_LINK_TOKEN"))}catch(r){return wr({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),md("LINK_TOKEN_FAILED")}};async function Vg(e,t,n){const r=await async function(e,t){const n=In(jc({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Ii({queryKey:n,queryFn:zc,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function Ug(e,t,n,r){Cr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||Cr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,Si({queryKey:In(["banks/accounts",{}],{}),queryFn:bd,accessToken:r,environment:a});const o=await Vg(e,t,n);if(o){const e=await yd(t,n);return e?.data?.filter(e=>e.integration.id===o.id)||[]}}var r,a;return[]}(t?.institution?.institution_id,n,r),{plaidItem:o}=await async function({publicToken:e,metadata:t,accessToken:n,environment:r}){if(!n)throw new Error("Access token is required to create Plaid link token");const a={path:"/banks2/webPlaidPublicToken",accessToken:n,endpointManager:_c(r)},{url:o,headers:i}=Mr(a);return await Rr({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(Cr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([Bn.invalidateQueries({queryKey:["integrations"]}),Bn.invalidateQueries({queryKey:["banks/accounts",{}]}),Bn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Nn(e.apiErrorType)&&Nn(e.apiErrorCode),n="RELINK"===vc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return wr({error:new Error("Plaid Item requires relink, plaid reopened automatically"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:o}}),{relinkPlaidItemId:o.id};const i=await yd(n,r),s=i?.data?.filter(e=>Md(e.apiName)&&"ACTIVE"===e.status)||[];return await async function(e,t,n,r,a){const o=n.institution?.name,i=l(e.plaidItemAccounts,t,"id");if(0===i.length)return 0===(e.plaidItemAccounts??[]).length?(wr({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await cd({title:"Uh Oh!",body:"It appears something went wrong fetching the accounts from your bank. Please chat with the support or try again later.",buttons:[{key:$c,label:"Cancel"},{key:td,label:"Chat",type:ld}]})===td&&pd({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(o||"my bank")):void wr({error:new Error("No new accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}});if(!i.some(e=>"ACTIVE"===e.status))return wr({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),cd({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:$c,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return wr({error:new Error("Accounts saved successfully with unsupported accounts"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),function(e,t,n){const r=e.length;return cd({title:"All set! Ready to track your transactions?",body:N("div",{className:gd,children:[I(xl,{wrap:"wrap",children:`Your ${n} ${t} ${dd("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),I(xl,{wrap:"wrap",children:`The following linked ${r>1?"accounts are":"account is"} not supported at this time, so ${r>1?"they":"it"} will remain unsynced.`}),I("ul",{children:e.map(e=>I("li",{children:I(xl,{wrap:"wrap",children:hd(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:td,label:"Get Started",type:ld}]})}(s,o,e.plaidItemAccounts.length);const c=function(e,t){const n=[];for(const r of e){if(!r.apiMask)continue;const e=t.find(e=>e.mask===r.apiMask&&r.isSupported);e&&n.push({destinationAccount:xd(r),duplicateAccount:e})}return n}(i,a);return c.length>0?async function({institutionName:e,matchingAccountPairs:t,plaidItemAccounts:n}){const r=t.slice(0,3),a=t.length>3;await cd({title:"Your transactions are being categorized",body:N("div",{className:Fg,children:[I(xl,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),I(xl,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),N("ul",{children:[r.map(({duplicateAccount:e})=>I("li",{children:I(xl,{wrap:"wrap",children:hd(e?.name??"",e?.mask??"")})},e?.id)),a&&I("li",{children:I(xl,{wrap:"wrap",children:"and more..."})})]}),I(xl,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:$c,label:"No thanks"},{key:td,label:"Review",type:ld}]})===td&&await Og({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(wr({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,cd({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${dd("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:td,label:"Get started",type:ld}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return wr({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await cd({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:$c,label:"Cancel"},{key:td,label:"Chat",type:ld}]})===td&&pd({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function Wg(e,t,n){return Sn(e)?(Cr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(Cr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(wr({error:new Error("Plaid Item sync failed, refreshing Plaid Items"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),!0):("INVALID_UPDATED_USERNAME"===e.error_code&&(wr({error:new Error("Plaid Item sync failed due to invalid updated username"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),await async function(e){const t=await cd({title:e||"Invalid Updated Username",body:'Your bank account has an updated username. To fix it, tap "Banks & Integrations", and unlink your old account, so you can relink it with your new username. If you need any assistance, tap "Chat" to chat with a member of our team.',buttons:[{key:$c,label:"Cancel"},{key:"chat",label:"Chat"},{key:td,label:"Banks & Integrations",type:ld}]});"chat"===t?pd({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==td||(e=>{const t=Ye.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||Ei("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const Hg="PLAID_LINK_NEW",qg="PLAID_LINK_UPDATE",jg="PLAID_LINK_UNLINK";function zg({plaidEvent:e,plaidItemId:t,apiAccessToken:n,apiErrorCode:r,message:a}){return{eventType:"onPlaidLink",message:a,defaultPrevented:!0,data:{plaidEvent:e,integrationId:t,apiAccessToken:n,apiErrorCode:r}}}const Kg=v({});function Yg({onPlaidLink:e,children:t}){return I(Kg.Provider,{value:{onPlaidLink:e},children:t})}function _g(){return b(Kg)}async function Zg(e){const{url:t,headers:n}=Mr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=Sr({extraHeaders:n,authorization:t});Cr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return Cr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),Nr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const Gg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:Wr(n)};return await Or(r)};function Qg(){return Cd({mutationFn:Gg,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})}})}const Xg=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:Wr(t)};return await Or(n)};function Jg(){return Cd({mutationFn:Xg,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})}})}const $g=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(qi(e.id)),removeFromApi:!0},accessToken:t,endpointManager:Wr(n)};return await async function(e){return Zg(e)}(r)};function em(){const{mutate:e}=Jg();return Cd({mutationFn:$g,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})},onError:async t=>{wr({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await cd({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:$c,label:"Cancel"},{key:td,label:"Try Again",type:ld}]})===td&&e()}})}function tm(e){return new Promise(t=>{window.Plaid.create({token:e,onSuccess:(e,n)=>t({status:"success",public_token:e,metadata:n}),onExit:(e,n)=>t({status:"exit",metadata:n,error:e}),onEvent:(e,t)=>{Cr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function nm(e,t,n,r){const a=await Bg(e,t,n);if(!a)return;const o=await tm(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;Cr("Plaid link successful",{public_token:e,metadata:a});const i=await Ug(e,a,t,n);if(i.relinkPlaidItemId)return nm(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;Cr("Plaid link exited",{metadata:e,error:t}),await Wg(t,e,a)&&r()}else wr({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function rm(){const[e,t]=qc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Ln(),r=Un(),{mutate:a}=Jg(),{onPlaidLink:o}=_g();return{linkPlaid:e=>{if(Nn(o)){const t=zg(e);o(t)}else nm(e.plaidItemId?qi(e.plaidItemId):void 0,n,r,a)},loading:e||Nn(t),hasOnPlaidLinkOverride:Nn(o)}}function am(){const[e,t]=qc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Ln(),r=Un(),{mutate:a}=Jg(),{apiPartnerName:o}=b(cs),{onPlaidLink:i}=_g();return{linkPlaid:e=>{if(Nn(i)){const t=zg(e);i(t)}else!async function(e,t,n,r,a){const o=await Bg(e,t,n);if(!o)return;const i=await tm(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;Cr("Plaid link from search successful",{public_token:e,metadata:o});const l=await async function(e,t,n,r,a){if(t?.institution?.institution_id){const i=await Vg(t.institution.institution_id,n,r);if(i)return wr({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,cd({title:"Already Linked",body:`It seems that this bank is already linked${o?` with ${o}`:""}. Please tap "Relink" to update the existing linked institution.`,buttons:[{key:$c,label:"Cancel"},{key:td,label:"Relink",type:ld}]}))===td?{relinkPlaidItemId:qi(i.id)}:{}}var o;return Cr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),Ug(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&nm(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;Cr("Plaid link from search exited",{metadata:e,error:t}),await Wg(t,e,o)&&a()}}(e.plaidItemId?qi(e.plaidItemId):void 0,n,r,o,a)},loading:e||Nn(t),hasOnPlaidLinkOverride:Nn(i)}}const om=Kt(null,el,Dt({position:"absolute",left:1,right:1,bottom:1,width:"calc(100% - 2)",height:"44px",background:"surface.intent.primary",border:"none",borderRadius:0,gap:9,color:"icon.intent.primary",pointerEvents:"all",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),Io);function im(){const{linkPlaid:e,loading:t}=rm();return N("button",{onClick:()=>e({plaidEvent:Hg,message:"Tile Plaid Link button pressed"}),...om,disabled:t,children:[I(Vc,{Component:Bc}),I(xl,{intent:"primary",children:"Link Account"})]})}const lm=Dt({width:266,minHeight:32});function sm(){return I(Ya,{styles:lm})}const cm=Dt({backgroundColor:"money.positive.weak"}),dm=Dt({backgroundColor:"money.negative.weak"}),um=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),hm=({defaultRange:e=an.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return jr({filter:e,select:Fc})}({filter:e});let o;return o=t?ro:r??um,N($r,{isSample:t,children:[I(Gr,{title:"Profit + Loss"}),I(Xr,{children:a?N(Za,{children:[I(sm,{}),I(sm,{})]}):N(S,{children:[I(sa,{title:ma(o.netIncome),label:"Profit"}),N(da,{children:[I(Lc,{amount:o.income,total:o.absoluteSum,colorCss:cm,label:"Income"}),I(Lc,{amount:o.expenses,total:o.absoluteSum,colorCss:dm,label:"Expenses"})]})]})}),t&&I(eo,{size:"sm"}),n&&I(im,{})]})},pm=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],gm={moneyIn:0,moneyOut:0,netMoneyIn:0};const mm=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...sn(n.filter)},accessToken:r,endpointManager:Wr(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||Sn(n)||Sn(n.operatingActivities)||!n.operatingActivities.children?gm:function(e){let t=new F(0),n=new F(0);for(const r of e.children)r.total<0?n=n.plus(F(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await Or(o))},vm=Dt({backgroundColor:"money.positive.weak"}),bm=Dt({backgroundColor:"money.negative.weak"}),fm=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),ym=({defaultRange:e=an.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return Wn({queryKey:pm({filter:e}),queryFn:mm})}({filter:e});let i;i=t?oo:r??fm;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),N($r,{isSample:t,children:[I(Gr,{title:"Cash Flow"}),I(Xr,{children:o?N(Za,{children:[I(sm,{}),I(sm,{})]}):N(S,{children:[I(sa,{title:ma(i.netMoneyIn),label:"Change in Cash"}),N(da,{children:[I(Lc,{amount:i.moneyIn,total:l,colorCss:vm,label:"Money In"}),I(Lc,{amount:i.moneyOut,total:l,colorCss:bm,label:"Money Out"})]})]})}),t&&I(eo,{size:"sm"}),n&&I(im,{})]})},xm=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),km=Kt(null,Dt({display:"flex",justifyContent:"end"}));function Tm({color:e,bulletLabel:t,moneySummary:n}){return N("div",{...xm,children:[I(Sa,{color:e,label:t}),I("div",{...km,children:I(xl,{children:n})})]})}const Cm={total:0,children:[]},wm=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||Sn(n)||Sn(n.expenses)||!n.expenses.children?Cm:{total:n.expenses.total??0,children:(r=n.expenses.children,r.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var r},Em=Kt(null,Dt({display:"flex",gap:"10px",alignItems:"center"})),Am=Dt({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),Im=Kt(null,Am);function Sm({bulletAmount:e=3,shimmer:t=!1}){return I(S,{children:Array.from({length:e},(e,n)=>N("div",{...Em,children:[I(Sa,{color:wa.var("colors.brand.secondary")}),t?I(Ya,{styles:Am}):I("div",{...Im})]},n))})}const Nm=Kt(null,Dt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),Pm=[wa.var("colors.brand.primary"),wa.var("colors.brand.success"),wa.var("colors.brand.action")],Mm=Object.freeze({total:0,children:[]});function Rm({defaultRange:e=an.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=Ye(e=>e.externalOptions).dataVisualizationColors??Pm,{query:{data:o},isFilling:i}=function({filter:e}){return jr({filter:e,select:wm})}({filter:e});let l;l=n?ao:o??Mm;const s=void 0===t?"Total Expenses":`${dn[t]} Total`,c=l.children.length>0;return N($r,{isSample:n,children:[I(Gr,{title:"Expenses"}),I(Xr,{children:i?I(Za,{children:I(Sm,{shimmer:!0})}):N(S,{children:[I("div",{...Nm,children:I(sa,{title:ma(l.total),label:s})}),I(da,{children:c?l.children.map((e,t)=>I(Tm,{color:a[t],bulletLabel:e.name,moneySummary:ma(e.total)},t)):I(Sm,{})})]})}),n&&I(eo,{size:"sm"}),r&&I(im,{})]})}const Dm=Kt(null,Dt({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Lm({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:tn(l=e.year,i,1),endDate:tn(l,i+1,0)});var i,l,s,c,d,u,h,p;return N("div",{...Dm,children:[N(_t,{children:[I($t,{children:"Monthly Review"}),I(Cc,{period:e,setPeriod:t,disableNext:r||(s=e,c=n,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:r})]}),N(Ec,{children:[I(hm,{defaultRange:o,isSample:r,showLinkAccountButton:a}),I(ym,{defaultRange:o,isSample:r,showLinkAccountButton:a}),I(Rm,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const Om="Oldest to Newest",Fm="Newest to Oldest",Bm="A-Z",Vm="Z-A",Um="Lowest to Highest",Wm="Highest to Lowest",Hm="A-Z",qm="Z-A";function jm(){const[e,t]=y(void 0),n=m(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in Pi)??!1,n=(e.direction&&e.direction in Mi)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const zm=Dt({width:"15px",height:"15px",borderRadius:"sm",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,position:"relative","&::before":{content:"''",position:"absolute",top:"-10px",left:"-10px",right:"-10px",bottom:"-10px"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Km=Dt({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Ym=Dt({background:"brand.primary.strong",border:"none"});function _m({checked:e,onClick:t}){const[n,r]=y(e??!1),a=void 0===e?n:e;return I("button",{...Kt(Ut["checkbox-input"],zm,a?Ym:Km,So),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&I(Hl,{Component:qd})})}const Zm=Kt(null,Dt({paddingLeft:"20px",paddingRight:"5px"}));function Gm({checked:e,onClick:t}){return I("div",{...Zm,children:I(_m,{checked:e,onClick:t})})}const Qm=Kt(Ut.text,Dt({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),ea);function Xm({children:e}){return I("div",{...Qm,children:e})}const Jm=Kt(Ut["date-cell"],Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function $m({date:e,annotation:t}){const n=mn(fn(e));return N("div",{...Jm,children:[t&&I(Xm,{children:t}),I(xl,{children:n})]})}const ev=Dt({color:"money.negative"}),tv=Dt({color:"money.positive"}),nv=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Pn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" "),rv=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 10.625H7.5C5.8424 10.625 4.25269 9.96652 3.08058 8.79442C1.90848 7.62231 1.25 6.0326 1.25 4.375V0.625",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M10 14.375L13.75 10.625L10 6.875",stroke:"currentColor",strokeMiterlimit:10})),"ChildRow"),av=Kt(Ut["transaction-date-cell-container"],Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}));function ov({transaction:e,showTypeLabel:t=!1,isChild:n=!1}){const r=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let n;return n=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:n,css:t?tv:ev}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?ev:tv}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?ev:tv};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?ev:tv};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:ev};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=tv;return e.amount<0&&(t="Invoice Payment Refund",n=ev),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:nv(e.type),css:e.amount<0?ev:tv}))(e)}return t})(e),a=Kt(Ut["transaction-type-label"],r.css),o=t?I("span",{...a,children:r.displayName}):void 0;return n?N("div",{...av,children:[I(Vc,{Component:rv}),I($m,{date:e.date,annotation:o})]}):I($m,{date:e.date,annotation:o})}const iv=Dt({display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}),lv=Dt({display:"flex",flexDirection:"column"}),sv=Dt({width:20,minWidth:20,height:20,minHeight:20,borderRadius:"9999px"});function cv({label:e,subLabel:t,iconUrl:n}){return N("div",{className:iv,children:[n?I("img",{src:n,className:sv,alt:void 0,width:24,height:24}):I("span",{className:sv}),N("div",{className:lv,children:[I(xl,{children:e}),I(xa,{children:t})]})]})}const dv={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},uv=[{name:"Active",value:dv.ACTIVE},{name:"Inactive",value:dv.INACTIVE},{name:"Removed",value:dv.REMOVED}],hv=e=>e.map(e=>({id:e.id,status:dv.INACTIVE})),pv={PARTNER_REVIEW_REQUIRED:"PARTNER_REVIEW_REQUIRED",USER_REVIEW_REQUIRED:"USER_REVIEW_REQUIRED",ACCOUNTANT_REVIEW_REQUIRED:"ACCOUNTANT_REVIEW_REQUIRED",RECONCILIATION_STAGED:"RECONCILIATION_STAGED",RECONCILED:"RECONCILED",RECONCILIATION_DISCREPANCY:"RECONCILIATION_DISCREPANCY",RECONCILIATION_AWAITING:"RECONCILIATION_AWAITING"},gv=[{name:"Needs my Review",value:pv.USER_REVIEW_REQUIRED},{name:"Flagged to Accountant",value:pv.ACCOUNTANT_REVIEW_REQUIRED},{name:"Discrepancy",value:pv.RECONCILIATION_DISCREPANCY},{name:"Processing",value:pv.PARTNER_REVIEW_REQUIRED},{name:"Reconciled",value:pv.RECONCILED}],mv=[{name:"Needs my Review",value:pv.ACCOUNTANT_REVIEW_REQUIRED},{name:"Flagged to Business Owner",value:pv.USER_REVIEW_REQUIRED},{name:"Discrepancy",value:pv.RECONCILIATION_DISCREPANCY},{name:"Processing",value:pv.PARTNER_REVIEW_REQUIRED},{name:"Reconciled",value:pv.RECONCILED}];function vv(e){return e in pv}const bv={EXPENSE:"EXPENSE",REVENUE:"REVENUE",BANK_TRANSFER:"BANK_TRANSFER",TAX_PAYMENT:"TAX_PAYMENT",INVOICE_PAYMENT:"INVOICE_PAYMENT",PAYOUT:"PAYOUT",PAYROLL_PAYMENT:"PAYROLL_PAYMENT",BILL_PAYMENT:"BILL_PAYMENT",LOAN_PAYMENT:"LOAN_PAYMENT"},fv=[{name:"Expense",value:bv.EXPENSE},{name:"Income",value:bv.REVENUE},{name:"Bank Transfer",value:bv.BANK_TRANSFER},{name:"Tax Payment",value:bv.TAX_PAYMENT},{name:"Invoice Payment",value:bv.INVOICE_PAYMENT},{name:"Payout",value:bv.PAYOUT},{name:"Payroll Payment",value:bv.PAYROLL_PAYMENT},{name:"Bill Payment",value:bv.BILL_PAYMENT},{name:"Loan Payment",value:bv.LOAN_PAYMENT}],yv=h.object({id:h.string(),type:h.enum(Object.values(bv)),reviewStatus:h.enum(Object.values(pv)),amount:h.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:h.string("Required").refine(e=>(function(e,t){const n=tn(e.getFullYear(),e.getMonth(),e.getDate()),r=tn(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||hn(new Date(e),/* @__PURE__ */new Date))&&gn(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),customer:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),frequency:h.union([h.object({name:h.string(),value:h.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),h.undefined()]),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()})),bankAccount:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}),notes:h.string().nullable()}),xv=yv.extend({children:h.array(h.object({amount:h.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()}))})),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"})}),kv=yv.extend({id:h.string(),type:h.literal(Object.values(bv)),description:h.string(),status:h.literal(Object.values(dv)),reviewStatus:h.literal(Object.values(pv)),apiName:h.literal(Object.values({PLAID:"PLAID",UNIT:"UNIT",STRIPE:"STRIPE",SHOPIFY:"SHOPIFY",SQUARE:"SQUARE",RUTTER:"RUTTER",UBER:"UBER",MOOV:"MOOV",QUALPAY:"QUALPAY",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",QBO:"QBO",XERO:"XERO",BENCH:"BENCH",WAVE:"WAVE"})),apiSourceId:h.string().nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),customer:h.object({id:h.string(),name:h.string().optional(),email:h.string().optional()}).nullable(),vendor:h.object({id:h.string(),name:h.string().optional()}).nullable(),invoiceItem:h.object({id:h.string(),description:h.string().optional()}).nullable(),bill:h.object({id:h.string(),name:h.string().optional()}).nullable(),payroll:h.object({id:h.string(),date:h.string().optional(),checkDate:h.string().optional(),description:h.string().optional()}).nullable(),apiItemId:h.string().nullable()});kv.extend({});const Tv=xv.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);s(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),Cv=xv.extend({matchingBankTransaction:h.object({id:h.string(),description:h.string().optional(),amount:h.number().optional(),date:h.string().optional(),bankAccountId:h.string().optional(),apiName:h.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT"}).optional()}).nullish()}).refine(e=>{const t=e.matchingBankTransaction?.amount,n=e.amount;return!!Sn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>Cv.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success});kv.extend({});const wv=xv.extend({});kv.extend({});const Ev=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],Av=["FEDERAL","STATE","SALES"],Iv=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function Sv(e){if(!Sn(e))return Iv.find(t=>t.value===e)?.label}const Nv=h.object({tax:h.object({paymentInfo:h.object({region:h.enum(Av,{message:`Tax region must be one of: ${Av.join(", ")}`}),quarter:h.enum(["Q1","Q2","Q3","Q4"]).optional(),year:h.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${Av.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),Pv=h.intersection(Nv,xv);h.intersection(Nv,kv);const Mv=async({data:e,accessToken:t,environment:n})=>Dv({data:{data:e},accessToken:t,environment:n}),Rv=async({data:e,accessToken:t,environment:n})=>Mv({data:[e],accessToken:t,environment:n}),Dv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:fo(n)};return await Lr(r)};function Lv(){return Cd({onSuccess:async()=>{const e=["banks/transactions"];return Cr("mutation successful, invalidating BT queries"),Bn.invalidateQueries({queryKey:e}).catch(e=>wr({error:e,severity:"error"}))},mutationFn:Mv})}function Ov(){return Cd({onSuccess:async()=>(Cr("mutation successful, invalidating BT queries"),Bn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>wr({error:e,severity:"error"}))),mutationFn:Rv})}const Fv={id:"",type:"EXPENSE",reviewStatus:"USER_REVIEW_REQUIRED",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:Ni[0],notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function Bv(e){const{mutate:t}=Ov(),{query:{data:n}}=Ph(),r=e?{id:(a=e).id,type:a.type,reviewStatus:a.reviewStatus,amount:Yu(a.amount),category:a.category,date:a.date,vendor:a.vendor,customer:a.customer,frequency:a.frequency,bankAccount:a.bankAccount,glAccount:a.glAccount,notes:a.notes,classSegments:a.classSegments,children:a.children.map(e=>({amount:Yu(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:a.matchingBankTransaction,tax:a.tax}:Fv;var a;return fg({defaultValues:r,validators:{onBlur:xv,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return Tv;case"BANK_TRANSFER":return Cv;case"REVENUE":return wv;case"TAX_PAYMENT":return Pv;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);if(!n.success){const e={};for(const t of n.error.issues){const n=t.path.join(".");e[n]||(e[n]={message:t.message})}return{fields:e}}}},onSubmit:r=>{if(!e)return;const a=function({payload:e,expenseCategories:t}){if("EXPENSE"===e.type){const n=t.find(t=>t.id===e.categoryId)?.accountId;return Sn(n)?e:{...e,glAccountId:Hi({id:n,prefix:"GL_ACCOUNT"})}}return e}({payload:function(e,t){const n={id:e,type:t.type,amount:t.amount?_u(t.amount):0,date:t.date,bankAccountId:t.bankAccount.id,frequency:t.frequency?.value,notes:t.notes,classSegmentIds:t.classSegments.map(e=>e.id),children:t.children.map(e=>({amount:e.amount?_u(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:t.classSegments.map(e=>e.id)}))};switch(t.type){case"EXPENSE":return{...n,vendorId:t.vendor?.id,customerId:t.customer?.id,categoryId:t.category?.id};case"REVENUE":return{...n,customerId:t.customer?.id,glAccountId:t.glAccount?.id};case"BANK_TRANSFER":return{...n,glAccountId:t.glAccount?.id,matchingBankTransactionId:t.matchingBankTransaction?.id,reviewStatus:t.reviewStatus};case"TAX_PAYMENT":return{...n,tax:t.tax};default:return n}}(e.id,r.value),expenseCategories:n?.data??[]});t(a),r.formApi.reset(r.value,{keepDefaultValues:!0})},onSubmitInvalid:()=>{}})}function Vv({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=Bi({id:e});return{transaction:t,form:Bv(t),bankAccount:Th(t?.bankAccount.id??""),isManual:!Sn(t)&&Zu(t),isLoading:r||n&&!t}}function Uv({bankTransaction:e,isChild:t=!1}){const{bankAccount:n}=Vv({transactionId:e.id}),r=n&&n.name&&n.mask?hd(n?.name,n?.mask):e.bankAccount?.name;return t?I("div",{className:Dt({paddingLeft:"25px"}),children:I(cv,{label:e.displayName??e.description,subLabel:e.bankAccount?.name})}):I(cv,{label:e.displayName??e.description,subLabel:r,iconUrl:e.iconUrl})}function Wv(e){return va(Yu(e.amount))}const Hv=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.10632H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.69366H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.28131H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8687H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.71875 10.4749L3.33125 12.8686L0.9375 10.4749",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 1.50635V12.8688",stroke:"currentColor",strokeMiterlimit:10})),"NestedRows"),qv=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.13135H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.71851H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.30682H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8934H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M0.9375 4.5251L3.33125 2.13135L5.71875 4.5251",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 13.4938V2.13135",stroke:"currentColor",strokeMiterlimit:10})),"NestedRowsExpanded"),jv=Dt({display:"flex",alignItems:"center",gap:"8px"});function zv({transaction:e,row:t}){const n=I(xl,{children:Wv(e)});if(t?.getCanExpand()){const e=t.getIsExpanded();return I(ns,{ariaLabel:e?"Collapse children":"Expand children",ariaExpanded:e,children:N("div",{className:jv,children:[I(Vc,{Component:e?qv:Hv}),n]})})}return I("div",{className:Dt({padding:"6px"}),children:n})}const Kv=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 1.25L1.25 13.75",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M13.75 9.84375V1.25H5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Withdraw"),Yv=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 13.75L1.25 1.25",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.15625 13.75H13.75V5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Deposit"),_v=Dt({padding:"10px",height:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"8px"}),Zv=Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"});function Gv({annotation:e,accountName:t}){const n=(e=>{switch(e){case"Withdrawn from":return Kv;case"Deposited to":return Yv;default:return null}})(e);return N("div",{className:_v,children:[n&&I(Vc,{Component:n}),N("div",{className:Zv,children:[e&&I(xa,{children:e}),t&&I(xl,{children:t})]})]})}function Qv(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const Xv=Dt({maxWidth:"100%",width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background","& .Tight-sub-label":{color:"typography.base"},"& .Tight-icon > path":{stroke:"icon.base"}}),Jv=Ot(Xv,Dt({padding:"2.5px"})),$v=Ot(Xv,Dt({padding:"4px 5px",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{}})),eb=Dt({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-label":{color:"typography.intent.secondary"},"& .Tight-icon > path":{stroke:"icon.intent.secondary"}}),tb=Ot(eb,Dt({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),nb=Dt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-label":{color:"typography.intent.action"},"& .Tight-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}}}),rb=Ot(nb,Dt({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),ab=Dt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-label":{color:"typography.intent.success"},"& .Tight-icon > path":{stroke:"icon.intent.success"}}),ob=Ot(ab,Dt({_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}}})),ib=Dt({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-label":{color:"typography.intent.warning"},"& .Tight-icon > path":{stroke:"icon.intent.warning"}}),lb=Ot(ib,Dt({_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}}})),sb=Dt({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-label":{color:"typography.intent.danger"},"& .Tight-icon > path":{stroke:"icon.intent.danger"}}),cb=Ot(sb,Dt({_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}}})),db=Dt({display:"flex",alignItems:"center",gap:"8px",height:"37px",margin:"0 8px",padding:"10px",borderRadius:"sm",cursor:"pointer",minWidth:0,outline:"none","&:focus-visible":{outline:"2px solid",outlineColor:"border.layout",outlineOffset:"2px"}}),ub={default:tb,neutral:tb,warning:lb,success:ob,critical:cb,highlight:rb},hb=C(function({variant:e="default",children:t,stylists:n=[],...r},a){const o=Qt([Kt(Ut["selector-button"],Ot(db,ub[e]),So),...n]);return I("button",{ref:a,...o,...r,children:t})}),pb={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function gb(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function mb(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(o=r,t.find(e=>e.children.some(e=>e.accountNo===o.accountNo)));var o;!a&&r.children.length>0?function(e,t){e.children.forEach(n=>{gb(e,n,t)})}(r,n):a&&gb(a,r,n)}),n}const vb=[Kt(null,Dt({marginLeft:"6px",marginRight:"6px"}))],bb=Kt(null,Dt({whiteSpace:"normal"}));function fb({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=gp(),o=kp(r,e),i=m(()=>new Ce(o,pb),[o]),l=m(()=>mb(i.search(n),o),[o,n,i]);return a?I(gh,{}):l.map(({parent:e,child:n})=>I(dh,{onClick:()=>t(n),children:N(Vh,{stylists:[bb],children:[Qv(e.accountNo,e.name),I(Mo,{Component:Ao,stylists:vb}),Qv(n.accountNo,n.name)]})},`${n.accountNo}`))}function yb({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=pp(),o=kp(n,e);return a?I(gh,{}):a||r||void 0!==n?o.map(e=>{const n=Qv(e.accountNo,e.name);return I(Yh,{triggerChildren:I(Zh,{displayLabel:n}),popupChildren:I(xb,{glAccount:e,onClick:t})},e.accountNo)}):I(hh,{text:"No data"})}function xb({glAccount:e,onClick:t}){return I(rh,{children:e.children.map(e=>I(dh,{onClick:()=>t(e),children:I(fa,{children:Qv(e.accountNo,e.name)})},e.accountNo))})}const kb=Dt({maxWidth:"420px",width:"fit-content"});function Tb({onClick:e,types:t}){const{query:{data:n}}=pp(),r=kp(n,t);return I(lh,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?kb:void 0,SearchList:fb,DefaultList:yb,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}function Cb({transaction:e,parentTransaction:t,accountNo:n,accountName:r}){const{startPrefetch:a,cancelPrefetch:o}=Jo({prefetchFn:jo(dp,up)}),{mutate:i}=Ov(),l=void 0!==t;return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:e=>I(hb,{...e,onMouseEnter:a,onMouseLeave:o,children:I(xl,{children:Qv(n,r)})})}),I(Tb,{onClick:l?n=>{if(n?.id&&l){const{id:r,children:a}=t,{id:o}=e,l=a.map(e=>e.id===o?{...e,glAccountId:n.id.toString()}:e);i({id:r,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:xp})]})}function wb({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=Oh(),a=e.category?.name??"Uncategorized",{mutate:o}=Ov(),i=void 0!==t;return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:e=>N(hb,{...e,onMouseEnter:n,onMouseLeave:r,children:[I(Vc,{Component:ip(a)}),I(xl,{children:a})]})}),I(Xh,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,categoryId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{t?.id&&o({id:e.id,categoryId:t.id.toString()})}})]})}const Eb=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),Ab=Kt(null,Dt({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Ib=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Sb({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=dd("Category","Categories",n.size,!0);return I(Il,{children:N("div",{...Ib,children:[I(Vc,{Component:Eb}),N("div",{...Ab,children:[I(fa,{children:a}),I(xa,{children:r})]})]})})}function Nb({transaction:e,parentTransaction:t}){return e.children?.length>0?I(Sb,{transaction:e}):I(wb,{transaction:e,parentTransaction:t})}function Pb({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return I(Nb,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return I(Gv,{annotation:Dd(e.amount),accountName:e.bankAccount?.name});default:return I(Cb,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Mb({name:e}){return I(S,{children:e&&I(xl,{children:e})})}const Rb=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],Db=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function Lb({onClick:e}){const t=Vl(),{userRole:n}=b(cs),r=(e=>{switch(e){case"OWNER":default:return Rb;case"ACCOUNTANT":return Db}})(n)||[];return I(Gl,{children:I(rh,{children:r.map(({status:n,displayName:r})=>I(dh,{onClick:()=>(e(n),void t.close()),children:r},n))})})}const Ob=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),Fb=wo(e=>p.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),Bb=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),Vb=(e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===pv.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===pv.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===pv.ACCOUNTANT_REVIEW_REQUIRED||l===pv.RECONCILIATION_AWAITING),a=((e,t)=>"ACCOUNTANT"===t&&e===pv.USER_REVIEW_REQUIRED)(e,t),o=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);var l;let s,c,d;return r?(s="Pending Review",c=Ob,d="neutral"):a?(s="Pending User Review",c=Ob,d="neutral"):n?(s="Needs Review",c=Fb,d="warning"):o?(s="Discrepancy",c=zd,d="critical"):i?(s="Reconciled",c=Bb,d="success"):(s="Processing",c=Ob,d="neutral"),{text:s,variant:d,Icon:c}},Ub=Kt(Ut["review-status-selector-button"]);function Wb({status:e,transactionId:t}){const[n,r]=y(!1),{mutate:a}=Ov(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=b(cs),{text:s,variant:c,Icon:d}=Vb(e,l);return t&&((u=t).startsWith(Ui.TRANSACTION_LINE_ITEM)||u.startsWith(Ui.PROCESSOR_TRANSACTION))?null:N(Bl,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,placement:"bottom-start",children:[I(Ul,{children:e=>N(hb,{variant:c,...e,stylists:[Ub],onClick:i,children:[I(Vc,{Component:d}),I(xl,{children:s})]})}),I(Lb,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function Hb({status:e,transactionId:t}){return I(Wb,{status:e,transactionId:t},t)}function qb(){return I(Vc,{Component:Ao})}function jb(){return I(qb,{})}const zb=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),Kb=Kt(null,Dt({stroke:"icon.base.weak"}));function Yb({hasConversation:e,hasUnread:t=!1}){return I(S,{children:e?I(Gs,{hasUnread:t}):I("div",{"data-testid":"no-conversations-dash",children:I(Hl,{Component:zb,stylists:[Kb]})})})}function _b({conversationId:e}){const{query:{data:t}}=ii(e??null),{startPrefetch:n,cancelPrefetch:r}=si(),{startPrefetch:a,cancelPrefetch:o}=_i(),i=Nn(t),l=i&&"READ"===t?.readStatus,s=x(()=>{Nn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=x(()=>{Nn(e)&&(r(),o())},[e,r,o]);return I("div",{onMouseEnter:s,onMouseLeave:c,children:I(Yb,{hasConversation:i,hasUnread:!l})})}const Zb=Kt(Ut["badge-chip"],Jv),Gb=Kt(null,na),Qb=Kt(null,So),Xb=Kt(Ut["neutral-badge"],eb),Jb=Kt(Ut["highlight-badge"],nb),$b=Kt(Ut["success-badge"],ab),ef=Kt(Ut["warning-badge"],ib),tf=Kt(Ut["critical-badge"],sb);function nf({type:e,children:t}){let n;switch(e){case"critical":n=tf;break;case"warning":n=ef;break;case"neutral":n=Xb;break;case"success":n=$b;break;case"highlight":n=Jb}const r=Qt([Zb,Gb,n,Qb]);return I("div",{...r,children:t})}function rf({reviewStatus:e}){const{userRole:t}=b(cs),{variant:n,Icon:r}=Vb(e,t);return I(nf,{type:n,children:I(Vc,{Component:r})})}const af=Dt({padding:"12px 16px",display:"flex",gap:"6px",flexDirection:"row",maxWidth:"100%"}),of=Dt({display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:"8px"}),lf=Dt({display:"flex",gap:"8px",justifyContent:"flex-start",alignItems:"center",minWidth:0}),sf=Dt({display:"flex",alignItems:"center",gap:"12px",minWidth:0}),cf=Dt({display:"flex",gap:"8px",flexDirection:"column",minWidth:0}),df=Dt({width:24,minWidth:24,height:24,minHeight:24,borderRadius:"9999px"});function uf({transaction:e}){return N("div",{className:af,children:[N("div",{className:cf,children:[N("div",{className:lf,children:[e.iconUrl?I("img",{src:e.iconUrl,className:df,alt:void 0,width:24,height:24}):I("span",{className:df}),I(fa,{children:e.description})]}),N("div",{className:sf,children:[I(rf,{reviewStatus:e.reviewStatus}),I(xa,{children:e.bankAccount?.name})]})]}),N("div",{className:of,children:[I(zv,{transaction:e}),I(Mo,{Component:Ao})]})]})}const hf=Z(),pf=[hf.display({id:Ze.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?I(Gm,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),hf.accessor("date",{id:Ze.DATE,cell:e=>{const t=void 0!==e.row.getParentRow();return I(Il,{children:I(ov,{transaction:e.row.original,isChild:t})})},header:()=>I(is,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Om,sortDescDisplay:Fm}),size:130,maxSize:144}),hf.accessor("description",{id:Ze.DESCRIPTION,cell:e=>{const t=void 0!==e.row.getParentRow();return I(Il,{children:I(Uv,{bankTransaction:e.row.original,isChild:t})})},header:()=>I(is,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Bm,sortDescDisplay:Vm}),size:180}),hf.accessor("amount",{id:Ze.AMOUNT,cell:e=>I(Il,{alignVariant:"flexEnd",children:I(zv,{transaction:e.row.original,row:e.row})}),header:()=>I(is,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Um,sortDescDisplay:Wm,align:"right"}),size:130,maxSize:180}),hf.accessor("category.id",{id:Ze.CATEGORY,cell:({row:e})=>e.getCanExpand()?null:I(Pb,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>I(is,{columnName:"Category",padding:"none"}),size:130,meta:{clickable:!0}}),hf.accessor(e=>e.classSegments[0]?.id,{id:Ze.CLASS_SEGMENT,cell:e=>I(Il,{children:I(Mb,{name:e.row.original.classSegments[0]?.name})}),header:()=>I(is,{columnName:"Business"}),size:130}),hf.accessor("reviewStatus",{id:Ze.REVIEW_STATUS,cell:e=>I(Il,{children:I(Hb,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>I(is,{columnName:"Status",sortDef:"REVIEW_STATUS",sortAscDisplay:Hm,sortDescDisplay:qm,padding:"large"}),size:200,maxSize:230,meta:{clickable:!0}}),hf.display({id:Ze.COMMENTS,cell:e=>{const t=e.row.original;return I(Il,{alignVariant:"center",children:I(_b,{conversationId:t.conversation?.id})})},header:()=>I(is,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),hf.display({id:Ze.EXPAND,cell:()=>I("div",{className:Dt({paddingLeft:"25px"}),children:I(jb,{})}),size:40,maxSize:60})],gf=hf.display({id:"MOBILE",cell:e=>I(uf,{transaction:e.row.original})}),mf=v({dimensions:{width:null,height:null}});function vf(){const{dimensions:e}=b(mf);return Nn(e.width)&&e.width<parseInt(wa("sizes.breakpoint-xl"))}const bf=[];function ff({transactions:e,columns:t}){const n=vf(),r=n?["MOBILE"]:t,a=n?{MOBILE:!0}:function(e){if(e)return Object.values(Ze).reduce((t,n)=>(t[n]=e.includes(n),t),{})}(t),o=n?[gf]:(i=t)?pf.filter(e=>i.includes(e.id)):pf;var i;return G({data:e??bf,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??bf.length,columns:o,getCoreRowModel:Q(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,iconUrl:"",matchingBankTransaction:null,displayName:"",rule:null,tax:{paymentInfo:null},customData:null,children:[],suggestedCategories:[],conversation:null};var t}),getExpandedRowModel:X(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:r,columnVisibility:a}})}const yf=[Ze.COMMENTS,Ze.DATE,Ze.DESCRIPTION,Ze.AMOUNT,Ze.CATEGORY,Ze.REVIEW_STATUS];function xf(e,t){return Ei("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function kf(e){const t=e.row,n=e.column.columnDef.meta?.clickable,r=t.getCanExpand(),a="BANK_TRANSFER"===t.original.type,o="category"===e.column.id&&(r||a),i="comments"===e.column.id,l="amount"===e.column.id;if(i){const e=t.getParentRow();xf(e?.original.id??t.original.id,"conversation")}else if(l&&r)t.toggleExpanded();else if(!n||o){const e=t.getParentRow();xf(e?.original.id??t.original.id)}}function Tf({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Vi(),a=x(()=>n({id:e.original.id}),[n,e.original]);return I(wi,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:kf,shouldDisplayDivider:n=>{return r=n,a=t,o=e.getVisibleCells().length,!(0===r||a&&1===r||r===o-1||a||1===r);var r,a,o}})}function Cf(){return N(S,{children:[I(Ps,{Component:Bb}),I(fa,{wrap:"wrap",children:"All caught up"}),I(xa,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const wf=Kt(Ut["button-warning"],Dt({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-text":{color:"typography.intent.warning.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.warning.active",borderColor:"border.intent.warning.active","& .Tight-text":{color:"typography.intent.warning.active"}},"& .Tight-text":{color:"typography.intent.warning"}}));function Ef({children:e,stylists:t=[],...n}){return I(dl,{stylists:[wf,...t],...n,children:e})}function Af(){const{linkPlaid:e,loading:t}=rm();return I(Ef,{onClick:()=>e({plaidEvent:Hg,message:"Plaid Link button pressed"}),disabled:t,children:I(fa,{children:"Link your bank"})})}const If=Kt(null,Dt({whiteSpace:"wrap"}));function Sf(){return N(S,{children:[I(Ps,{Component:tp}),I(fa,{textAlign:"center",stylists:[If],children:"Your bank transactions will be categorized for you"}),I(xa,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),I(Af,{})]})}const Nf=Dt({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Pf(){return N(S,{children:[I("div",{className:Nf,children:I(Vc,{Component:Ob})}),I(fa,{children:"Transactions are being processed"}),I(xa,{children:"Any transactions that require review will show up here."})]})}function Mf(){const{dimensions:e}=b(mf);return Nn(e.width)&&e.width<parseInt(wa("sizes.breakpoint-xl"))}const Rf=Bt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Df({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return ff({transactions:e,columns:t?[...t,Ze.EXPAND]:void 0})}({transactions:e,columns:yf})}({transactions:o}),{query:{data:l},isFilling:s}=Oi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=Mf(),d=!Sn(l?.data?.[0])&&!s,u=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=I(Cf,{})):r=I(Pf,{}):r=I(Sf,{}),r}(e??!1,o.length>0,d);return N("div",{className:Rf({isMobile:c}),children:[I("div",{id:ho}),N(Po.Provider,{value:a,children:[N(_t,{children:[I($t,{children:c?"Transactions":"Transactions For Your Review"}),I(Fs,{children:I(Fo,{})})]}),I(vl,{dashboard:"businessOwnerDashboard",children:r?I(qo,{}):N(S,{children:[I(bl.Provider,{value:{sortInstance:t,setSortInstance:n},children:I(hi,{headerGroups:i.getHeaderGroups()})}),Sn(u)?I(gi,{children:i.getRowModel().rows.map(e=>I(Tf,{rowData:e,hasSelect:!1},e.id))}):I(Ns,{children:u})]})})]})]})}function Lf(){const{sortInstance:e,setSortInstance:t,apiSort:n}=jm(),{query:{data:r},isFilling:a,paginationControls:o}=Oi({filter:go,sort:n,limit:10}),i=r?.data??vo,{hasPlaidLinkedBankAccount:l,isFilling:s}=wh();return I(Df,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const Of=Kt(Ut["button-action"],Dt({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-text":{color:"typography.intent.action.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.active",borderColor:"border.intent.action.active","& .Tight-text":{color:"typography.intent.action.active"}},"& .Tight-text":{color:"typography.intent.action"}}));function Ff({children:e,stylists:t=[],...n}){return I(dl,{stylists:[Of,...t],...n,children:e})}const Bf=wo(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),p.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Vf=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Ys,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:Fb,buttonText:"Review"};case"LINK_BANK":return{Icon:tp,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:tp,buttonText:"Fix"};case"RELINK":return{Icon:tp,buttonText:"Relink"};case"CHAT":return{Icon:zd,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Bf,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Bb,buttonText:""};default:return{Icon:zd,buttonText:""}}},Uf=Kt(null,Dt({display:"flex",alignItems:"center",gap:"8px"})),Wf=Kt(null,Dt({width:"20px",height:"20px"}));function Hf({title:e,type:t}){const{Icon:n}=Vf(t);return N("div",{...Uf,children:[I(Vc,{Component:n,stylists:[Wf]}),I(fa,{wrap:"wrap",children:e})]})}const qf=Kt(null,Dt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:{base:"4px",xl:"5px"},flex:{xl:"1 1 0"},minWidth:{xl:"200px"},width:"100%"}));function jf({title:e,description:t,type:n}){return N("div",{...qf,children:[I(Hf,{title:e,type:n}),I(xa,{wrap:"wrap",children:t})]})}const zf=Kt(Ut["banner-button"],Dt({display:"flex",justifyContent:"center",alignItems:"center",width:{base:"100%",xl:"128px"},gap:{xl:"15px"},flexShrink:{xl:"0"}})),Kf=Kt(Ut["banner-button-text"]),Yf=Kt(Ut["banner-button-icon"]);function _f({priority:e,type:t,handleClick:n}){const{buttonText:r}=Vf(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:Qc};case"HIGH":return{Button:Ef};case"MEDIUM":return{Button:Ff};default:return{Button:dl}}})(e);return N(a,{onClick:n,stylists:[zf],children:[I(fa,{stylists:[Kf],children:r}),I(Mo,{stylists:[Yf],Component:Ao})]})}const Zf=Bt({base:{display:"flex",flexDirection:{base:"column",xl:"row"},padding:{base:"16px",xl:"15px"},gap:{base:"16px",xl:"0"},justifyContent:{xl:"space-between"},alignItems:{base:"flex-start",xl:"center"},alignSelf:"stretch",width:{base:"100%",xl:"auto"},minWidth:{xl:"350px"},borderRadius:{base:"sm",xl:"lg"},border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Gf={HIGH:Ut["banner-high"],MEDIUM:Ut["banner-medium"],LOW:Ut["banner-low"],URGENT:Ut["banner-urgent"]};function Qf({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=Mf()?a:r,s=Kt(Ut.banner,Gf[i],Zf({priority:i}));return N("div",{...s,children:[I(jf,{title:n,description:l,type:o}),I(_f,{priority:i,type:o,handleClick:t})]})}function Xf(e,t){pd({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function Jf(e,t,n,r,a){return()=>cd({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function $f(e,t,n,r,a,o){return{alert:Jf(e,t,a,o,[{key:$c,label:"Cancel"},{key:pc.CHAT,label:"Chat",type:ld}]),actions:{[pc.CHAT]:()=>Xf(t,r)}}}function ey(e){const{mutateAsync:t}=em(),n=Ln(),r=Un(),{apiPartnerName:a}=b(cs),o=Mf(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=rm(),{linkPlaid:c,loading:d}=rm();if(Sn(e))return $f(vc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=vc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case pc.DELETE_OR_RELINK:case pc.RELINK:return l?null:(g=i,m=a,v=o,{alert:Jf(u,(p=e).apiInstitutionName,m,v,[{key:$c,label:"Cancel"},{key:td,label:"Relink",type:ld}]),actions:{success:()=>{g({plaidEvent:qg,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case pc.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:Jf(e,t.apiInstitutionName,a,o,[{key:$c,label:"Cancel"},{key:pc.CHAT,label:"Chat"},{key:td,label:"Unlink and Relink",type:ld}]),actions:{success:async()=>{i||await n({id:String(t.id)}),r({plaidEvent:"PLAID_LINK_UNLINK_RELINK",plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink and Relink Bank Error button pressed"})},[pc.CHAT]:()=>Xf(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case pc.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:Jf(e,t.apiInstitutionName,i,l,[{key:$c,label:"Cancel"},{key:pc.CHAT,label:"Chat"},{key:pc.RELINK,label:"Relink"},{key:td,label:"Go To Bank",type:ld}]),actions:{success:async()=>{const e=await Zc({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[pc.RELINK]:()=>{o({plaidEvent:qg,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[pc.CHAT]:()=>Xf(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case pc.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:Jf(e,t.apiInstitutionName,a,o,[{key:$c,label:"Cancel"},{key:td,label:"Unlink",type:ld}]),actions:{success:()=>{i?r({plaidEvent:jg,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink Bank Error button pressed"}):n({id:String(t.id)})}}}}(u,e,t,c,a,o,s);default:return $f(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,v}const ty=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){wr({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function ny({task:e}){const{linkPlaid:t,loading:n}=rm(),{linkPlaid:r,loading:a}=am(),o=ey(e?.meta?.plaidItem),i=n&&"RELINK"===e.type,l=a&&"LINK_BANK"===e.type&&!1,s="RELINK"!==e.type&&"LINK_BANK"!==e.type&&Sn(o);return i||l||s?null:I(Qf,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:qg,plaidItemId:e?.meta?.plaidItem?.id,apiAccessToken:e?.meta?.plaidItem?.apiAccessToken,apiErrorCode:e?.meta?.plaidItem?.apiErrorCode,message:"Fix Relink Bank Error button pressed"}):"LINK_BANK"===e.type?(Cr("Plaid Banner Link Bank clicked",{plaidItem:e?.meta?.plaidItem}),r({plaidEvent:Hg,message:"Plaid Banner Link Bank pressed"})):Nn(o)&&(Cr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),ty(o))}})}const ry=Kt(Ut.banner,Ut["banner-default"],Zf({priority:"DEFAULT"}));function ay(){const e=Mf()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return I("div",{...ry,children:I(jf,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const oy=Kt(Ut.banner,Ut["banner-default"],Zf({priority:"DEFAULT"}));function iy(){const e=Mf()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return I("div",{...oy,children:I(jf,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ly=Dt({width:"100%",height:72,minWidth:"300px"});function sy(){return N(S,{children:[I(Ya,{styles:ly}),I(Ya,{styles:ly}),I(Ya,{styles:ly})]})}function cy({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?I(sy,{}):a?e.map(e=>{if(void 0===yo[e.type]||"ONBOARDING_FORM"===e.type&&Sn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(pc).includes(e.type))return I(ny,{task:e},e.id);const n=e.actionLink,r=Nn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return I(Qf,{task:e,handleClick:r},e.id)}):I(n?iy:ay,{})}function dy(){const e=fd({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return I("div",{className:Dt({height:{xl:"auto",base:"44px"}}),children:N(hl,{onClick:()=>{Ei(e?"BanksAndIntegrations":"NewConnection")},width:"fill-parent",children:[I(Mo,{Component:Bc}),I(Pl,{children:"Banks & Integrations"})]})})}function uy(){return Kc({filter:{status:{equal:"ACTIVE"}}},{select:e=>({multiAccountIntegrations:e.data?.filter(e=>["PLAID","UNIT"].includes(e.apiName))||[],integrations:e.data?.filter(e=>!["PLAID","UNIT"].includes(e.apiName))||[],cursor:e.cursor})})}const hy=Kt(Ut["business-owner-dashboard"],Dt({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),py=Dt({display:"flex",width:"100%",justifyContent:"center"}),gy=e=>{const t=po[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},my={status:{in:["ACTIVE","INACTIVE"]}},vy={filter:{status:{in:["ACTIVE"]}}};function by({period:e,onChangePeriod:t}){const{sortInstance:n,setSortInstance:r,apiSort:a}=function(){const[e,t]=y(void 0);return{sortInstance:e,setSortInstance:x(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in $o)??!1,n=(e.direction&&e.direction in ei)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=ai({limit:10,sort:a,filter:mo}),s=o?.data??bo,c=Mf(),{query:{data:d},isFilling:u}=(h={select:e=>((e,t)=>{const n=Sn(r=e)||Sn(r.data)?[]:[...r.data].sort((e,t)=>ko[e.priority]-ko[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n})(e,c)},p=vy,Wn({...h,queryKey:p?xo(p):["tasks",{}],queryFn:To}));var h,p;const{query:{data:g}}=fd({select:e=>{return{...e,plaidItemAccountsReadyToSync:Ch(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>Rd(e.apiName)))};var t}}),{query:{data:v}}=Yc({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})}),b=Mf(),f=m(()=>{let e=[];const t=v?.data;t&&(e=t.map(e=>fc(e)));let n=[];!1===g?.hasPlaidLinkedBankAccount&&(n=[bc]);const r=d??[];return[...e,...n,...r]},[d,g,v]),k=function(){const{query:{data:e}}=Oi({filter:my,limit:1});return(e?.data?.length??0)>0}(),T=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(k,g),C=/* @__PURE__ */new Date,w={month:C.getMonth(),year:C.getFullYear()};const[E,A]=Ol(w,e,t),P=(M=E.month,{beginDate:tn((R=E.year)-1,M+1,1),endDate:tn(R,M+1,0)});var M,R;return I("div",{className:py,children:N("div",{...hy,children:[N(_t,{children:[I($t,{children:"Action Items"}),I(dy,{})]}),I(co,{children:I(cy,{taskBanners:f,handleScrollAction:gy,isWaitingForPlaidItemAccountsSync:!k&&!0===g?.plaidItemAccountsReadyToSync,isFilling:u})}),!b&&N(S,{children:[I(Lm,{period:E,handleDateChange:e=>{var t,n;(t=w).year===(n=e).year&&n.month>t.month||n.year>t.year||A(e)},todayPeriod:w,showSamples:T,showLinkAccountButton:T&&!g?.plaidItemAccountsReadyToSync}),I(_t,{children:I($t,{children:"Financial Summary"})}),I(hc,{isSample:T,period:E}),I(lo,{filter:P,isSample:T})]}),I(Us,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:b}),I(Lf,{})]})})}function fy(e){return I(Ar||S,{children:e.children})}function yy({children:e}){return I(fy,{children:I("div",{className:Ht(Ut.component),children:e})})}function xy(e){return I(yy,{children:I(by,{...e})})}function ky(e,t){return e?{...e,...t}:t}function Ty(e){return Be({key:"category",name:"Category",possibleValues:e})}const Cy=async e=>{const t=e.queryKey,n={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Qo(n)};function wy(){return Wn({queryKey:["sdk/introspect"],queryFn:Cy})}const Ey=[{value:"in",label:"In"}];function Ay(e){return Be({key:"reviewStatus",name:"Review Status",possibleValues:e,operators:Ey})}const Iy=({displayInput:e,parsedInput:t,operator:n,model:r,handleFilterClick:a})=>{if(void 0===r.operators)return;const{label:o,value:i}=n;a(r.createFilter({name:`${o} ${e}`,value:{[r.key]:{name:"",value:{[i]:t}}}}))},Sy=h.object({amount:h.number({message:"Required"}),amountOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),Ny=Kt(null,Dt({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),Py=Kt(null,Dt({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function My({children:e,title:t,onCancelClick:n,onSubmit:r}){return N("form",{onSubmit:e=>{e.preventDefault(),r()},...Ny,children:[I(fa,{children:t}),e,N("div",{...Py,children:[I(kg,{showIcon:!1,onClick:n}),I(jd,{showIcon:!1,textContent:"Apply"})]})]})}function Ry({model:e,handleFilterClick:t}){const n=Vl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Sy},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:ga(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:_u(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return N(My,{title:"Amount...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"amountOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),I(r.AppField,{name:"amount",children:e=>I(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const Dy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"greaterThan",label:"Greater than"},{value:"greaterThanEqual",label:"Greater than or equal to"},{value:"lessThan",label:"Less than"},{value:"lessThanEqual",label:"Less than or equal to"}],Ly=h.object({date:h.string().refine(e=>""!==e,{message:"Required"}),dateOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["On","Not on","After","Before","On or after","On or before"])})});function Oy({model:e,handleFilterClick:t}){const n=Vl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:Ly},onSubmit:n=>{const r={displayInput:mn(fn(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return N(My,{title:"Date...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"dateOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),I(r.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Fy=[{value:"equal",label:"On"},{value:"notEqual",label:"Not on"},{value:"greaterThan",label:"After"},{value:"greaterThanEqual",label:"On or after"},{value:"lessThan",label:"Before"},{value:"lessThanEqual",label:"On or before"}],By=h.object({description:h.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Vy({model:e,handleFilterClick:t}){const n=Vl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:By},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return N(My,{title:"Description...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"descriptionOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),I(r.AppField,{name:"description",children:e=>I(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Uy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function Wy(e){return Be({key:"bankAccount",name:"Bank Account",possibleValues:e})}const Hy=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await Qo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function qy(e){return Be({key:"classSegments",name:"Business",possibleValues:e})}function jy(e){return Be({key:"customer",name:"Customer",possibleValues:e})}function zy(e){return Be({key:"vendor",name:"Vendor",possibleValues:e})}function Ky(){return{values:[...fv].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}function Yy(){const e="in";return{values:[...uv].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const _y=h.object({notes:h.string().refine(e=>""!==e,{message:"Required"}),notesOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Zy({model:e,handleFilterClick:t}){const n=Vl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:_y},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return N(My,{title:"Notes...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"notesOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),I(r.AppField,{name:"notes",children:e=>I(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Gy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],Qy=(Xy={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,matchingBankTransaction:!0,invoiceItem:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(Xy));var Xy;function Jy(e){return Be({key:"glAccount",name:"GL Account",possibleValues:e})}function $y(){const{filters:e,addFilters:t,removeFilter:n}={filters:Ye(e=>e.transactionsDashFilters),addFilters:Ye(e=>e.addTransactionsDashFilters),removeFilter:Ye(e=>e.removeTransactionsDashFilter)},{getCategories:r,getBankAccounts:a,getClassSegments:o,getVendors:i,getCustomers:l,getGlAccounts:c,getReviewStatuses:d}=function(){const e=function(){const{query:{data:e},isFilling:t}=Ph(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Uncategorized";var n;return{name:t,value:{category:{name:t,value:{id:{in:[(n=e).id?n.id.toString():""]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),t=function(){const{query:{data:e},isFilling:t}=fd(),n=e?.data,r=m(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=hd(t,n);return{name:r,value:{bankAccount:{name:r,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),n=function(){const{query:{data:e},isFilling:t}=ug(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Customer";return{name:t,value:{customer:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),r=function(){const{query:{data:e},isFilling:t}=$p(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Vendor";return{name:t,value:{vendor:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[t,r])}(),a=function(){const{query:{data:e},isFilling:t}=Wn({queryKey:["clientMgmt/businesses","classSegments"],queryFn:Hy}),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Class Segment";return{name:t,value:{classSegments:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),o=function(){const{query:{data:e},isFilling:t}=gp(),n=m(()=>e?.map(e=>{const t=e.name;return{name:t,value:{glAccount:{name:t,value:{id:{in:[e.id]}}}}}}),[e]);return x(()=>({values:n??[],isFilling:t}),[n,t])}(),i=function(){const e=function(){const{query:{data:e}}=wy();return"ACCOUNTANT"===e?.userRole}(),t=m(()=>function(e){const t="in";return[...e].map(e=>({name:e.name,value:{reviewStatus:{name:e.name,value:{[t]:[e.value]}}}}))}(e?mv:gv),[e]);return x(()=>({values:t,isFilling:!1}),[t])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:o,getReviewStatuses:i}}(),u=m(()=>({reviewStatus:Ay(d),amount:Be({key:"amount",name:"Amount",operators:Dy,ModalComponent:Ry}),bankAccount:Wy(a),category:Ty(r),classSegments:qy(o),customer:jy(l),date:Be({key:"date",name:"Date",operators:Fy,ModalComponent:Oy}),description:Be({key:"description",name:"Description",operators:Uy,ModalComponent:Vy}),glAccount:Jy(c),notes:Be({key:"notes",name:"Notes",operators:Gy,ModalComponent:Zy}),status:Be({key:"status",name:"Status",possibleValues:Yy}),vendor:zy(i),type:Be({key:"type",name:"Type",possibleValues:Ky}),search:Ue}),[a,o,r,i,l,c,d]),h=m(()=>[u.reviewStatus,u.amount,u.bankAccount,u.category,u.classSegments,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor],[u.reviewStatus,u.amount,u.bankAccount,u.category,u.classSegments,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor]),p=m(()=>function(e){const t={...e};return Qy.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(ex,{})),[e]),g=x(e=>u[e],[u]);return{filters:e,filterPopupModels:h,addFilters:t,removeFilter:n,apiFilters:p,getModel:g}}function ex(e,t){const n={},r=t.value;var a,o,i,l;return r.date&&(n.date=(a=e.date,o=r.date.value,a?{...a,...o}:o)),r.amount&&(n.amount=(i=e.amount,l=r.amount.value,i?{...i,...l}:l)),r.description&&(n.description=r.description.value),r.category&&(n.category=function(e,t){return ky(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e&&e.in?t.in?{...e,in:[.../* @__PURE__ */new Set([...e.in,...t.in])]}:e:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return ky(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return ky(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return ky(e,t)}(e.glAccount,r.glAccount.value)),r.type&&(n.type=function(e,t){return e?{...e,...t}:t}(e.type,r.type.value)),r.search&&(n.search=r.search.value),r.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return ky(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return ky(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}function tx(e,t=500,n){const r=g();!function(e){const t=g(e);t.current=e,k(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=m(()=>{const a=c(e,t,n),o=(...e)=>a(...e);return o.cancel=()=>{a.cancel()},o.isPending=()=>!!r.current,o.flush=()=>a.flush(),o},[e,t,n]);return k(()=>{r.current=c(e,t,n)},[e,t,n]),a}const nx=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),rx=Dt({animation:"linear 1s spin infinite"}),ax={background:"conic-gradient(from 90deg,rgba(255, 255, 255, 0) 0deg,rgba(148, 216, 232, 1) 360deg)",height:"100%",width:"100%",opacity:1};function ox({size:e}){const t=e??15;return N("svg",{className:rx,width:t,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[I("g",{clipPath:"url(#paint0_angular_27751_8190_clip_path)","data-figma-skip-parse":"true",children:I("g",{transform:"matrix(0 0.0075 -0.0075 0 8.5 8.5)",children:I("foreignObject",{x:"-1266.67",y:"-1266.67",width:"2533.33",height:"2533.33",children:I("div",{style:ax})})})}),I("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"stopsVar":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"transform":{"m00":-9.1848822316819949e-16,"m01":-14.999998092651367,"m02":15.999998092651367,"m10":14.999998092651367,"m11":-9.1848822316819949e-16,"m12":1.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),I("defs",{children:I("clipPath",{id:"paint0_angular_27751_8190_clip_path",children:I("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z"})})})]})}const ix=Kt(Ut["filter-bar"],Dt({display:"flex",padding:"16px",flexDirection:"column",alignItems:"flexStart",gap:"8px",flex:"1 0 0",borderRadius:"2px",border:"1px solid {colors.border.layout}",background:"surface.foreground",minWidth:0,xl:{display:"flex",flex:"1 0 0",flexDirection:"column",height:"35px",padding:"0 10px",justifyContent:"center",alignItems:"flex-start",gap:"10px",borderRadius:"sm",background:"surface.background"}})),lx=Kt(Ut["filter-search-bar"],Dt({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),sx=Kt(null,Dt({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),cx=Kt(null,Dt({border:"none",outline:"none",background:"transparent",fontSize:"16px",fontStyle:"normal",fontWeight:"sm",lineHeight:"18px",letterSpacing:"0.96px",display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",height:"100%",minWidth:0,padding:0,_placeholder:{color:"typography.base.weak"},xl:{fontSize:"14px",lineHeight:"16px"}}));function dx({onChange:e,searchTerm:t,isFetching:n}){const[r,a]=y(t),[o,i]=y(!1),l=tx(x(t=>{e(t),i(!1)},[e,i]),280),s=Dt({width:25});return I("div",{...ix,children:N("div",{...lx,children:[I("div",{className:s,children:n||o?I(ox,{}):I(Vc,{stylists:[sx],Component:nx})}),I("input",{...cx,value:r,onChange:e=>{return t=e.target.value,a(t),o||i(!0),void l(t);var t},placeholder:"Search",onKeyDown:tu})]})})}const ux=Dt({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),hx=Kt(Ut["filter-pill"],Dt({display:"inline-flex",height:"25px",padding:"5px 10px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"md",border:"{borderWidths.lg} solid",borderColor:"border.intent.secondary",background:"surface.intent.secondary",fontSize:"sm",fontWeight:"sm",lineHeight:"14px",color:"typography.intent.secondary"})),px=Kt(null,Dt({border:"none",background:"none",padding:0,cursor:"pointer"})),gx=Kt(null,Dt({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function mx({text:e,onClickRemove:t}){return N("div",{...hx,children:[I("div",{...gx,children:e}),I("button",{...px,onClick:t,children:I(Hl,{Component:Wl,stylists:[Kt(null,ux)]})})]})}function vx({filters:e,removeFilter:t}){return e.map((e,n)=>{if(e.modelKey===Ve)return;const r=`${e.name}`;return I(mx,{text:r,onClickRemove:()=>{t(n)}},e.id)})}const bx=wo(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_24404_41655)"},p.createElement("path",{d:"M1 1V3.366L6.317 9.866V14L8.683 12.817V9.866L14 3.366V1H1Z",strokeWidth:1,strokeMiterlimit:10}))),"Filter");function fx({children:e,forceMount:t,fadeIn:n=!0}){const r={transform:"none",willChange:"auto",...n?{}:{animation:"none"}};return I(Gl,{style:r,forceMount:t,children:e})}const yx=Dt({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),xx=Kt(null,yx);function kx({children:e,clickHandler:t}){const n=Vl();return t||(t=()=>{n.close()}),I(pe,{lockScroll:!0,...xx,onClick:t,children:e})}const Tx=Bt({base:{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative"},variants:{width:{lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"}},sm:{minWidth:{sm:"360px",base:"100dvw"},maxWidth:{sm:"392px",base:"100dvw"}}}}});function Cx({width:e="lg",children:t}){const n=Kt(Ut["modal-popup"],Tx({width:e}));return I("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function wx({model:e,handleFilterClick:t}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Ul,{children:t=>I(dh,{...t,children:I(fa,{children:e.name})})}),I(fx,{children:I(kx,{children:I(Cx,{children:e.ModalComponent&&I(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function Ex({filterModels:e,addFilters:t}){const n=Vl(),r=e=>{t([e]),n.close()};return I(Gl,{children:I(rh,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return Sn(t)?I(wx,{model:e,handleFilterClick:r},e.key):I(Ax,{model:e,handleFilterClick:r},e.key)})})})}function Ax({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return I(Yh,{triggerChildren:I(Zh,{icon:e.icon,displayLabel:e.name}),popupChildren:r?I(gh,{}):I(Ix,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function Ix({values:e,handleValueClick:t}){return I(rh,{children:e.length>0?e.map(e=>I(Sx,{handleClick:()=>t(e),value:e},e.name)):I(hh,{text:"No data"})})}function Sx({value:e,handleClick:t}){return I(dh,{onClick:t,children:I(fa,{children:e.name})})}function Nx({Component:e,stylists:t}){return I(e,{stylists:[Kt(Ut["medium-icon"],Ut.icon),...t??[]],size:17})}const Px=Dt({display:"flex",padding:"18px",gap:"8px",xl:{padding:"10px"}});function Mx({addFilters:e,filterModels:t}){const n=Mf();return N(Bl,{modal:!1,placement:"bottom-start",children:[I(Ul,{children:e=>I(hl,{popupTriggerProps:e,stylists:[Kt(null,Px)],children:n?I(Nx,{Component:bx}):N(S,{children:[I(Mo,{Component:bx}),"Filters"]})})}),I(Ex,{filterModels:t,addFilters:e})]})}const Rx=Kt(Ut["dashboard-header"],Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),Dx=Kt(null,Dt({display:"flex",alignItems:"center",gap:"8px",padding:"15px 15px 0 15px",width:"100%",xl:{gap:"12px"}})),Lx=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"}));function Ox({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a,isFetching:o}){const i=m(()=>Sn(t)?"":t.find(e=>e.modelKey===Ve)?.value.search?.value,[t]);return N("div",{...Rx,children:[N("div",{...Dx,children:[I(dx,{isFetching:o,searchTerm:i,onChange:e=>{const t=a(Ve);if(void 0===t)return;const r=t.createFilter({name:"Search",value:{search:{name:e,value:e}}});n([r])}}),I(Mx,{addFilters:n,filterModels:e}),I("div",{className:Dt({display:"none",xl:{display:"flex"}}),children:I(Fo,{})})]}),I("div",{...Lx,children:I(vx,{filters:t,getModel:a,removeFilter:r})})]})}const Fx=Ge.filter(e=>e!==Ze.COMMENTS&&e!==Ze.CLASS_SEGMENT),Bx=Kt(null,Dt({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function Vx(){return I("div",{...Bx,children:I(Fo,{})})}const Ux=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2768)"},p.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),p.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),p.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots");function Wx(){return N(S,{children:[I(Vc,{Component:Ux}),I(fa,{wrap:"wrap",children:"No transactions found"}),I(xa,{wrap:"wrap",children:"Try a different set of filters."})]})}const Hx=v({resetSelected:void 0});function qx({Icon:e,label:t,children:n,onClick:r}){return n?N(Bl,{placement:"bottom-start",children:[I(Ul,{children:n=>N(ns,{popupTriggerProps:n,children:[e&&I(Vc,{Component:e}),I(Pl,{children:t})]})}),n]}):N(ns,{onClick:r,children:[e&&I(Vc,{Component:e}),I(Pl,{children:t})]})}const jx=wo(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function zx({transactions:e,id:t,label:n}){const{mutate:r}=Lv(),a=Vl(),{resetSelected:o}=b(Hx);return vv(t)?I(dh,{onClick:()=>(t=>{if(e.length>0){const a=(n=t,e.map(e=>({id:e.id,reviewStatus:n})));r(a)}var n;a.close(),o&&o()})(t),children:n}):null}const Kx=[{id:"delete",label:"Delete",Icon:jx,component:function({transactions:e,...t}){const{mutate:n}=Lv(),r=()=>{const t=hv(e);n(t)};return I(qx,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&cd({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:$c,label:"Cancel"},{key:ed,label:"Delete",type:sd}]}).then(e=>{e===ed&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:wo(e=>p.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.36217 8.45534H7.95444C8.20781 8.45534 8.45081 8.35469 8.62998 8.17552C8.80914 7.99636 8.9098 7.75336 8.9098 7.49998C8.9098 7.24661 8.80914 7.00361 8.62998 6.82444C8.45081 6.64528 8.20781 6.54463 7.95444 6.54463H7.31753C7.06416 6.54463 6.82116 6.44397 6.64199 6.26481C6.46283 6.08564 6.36217 5.84265 6.36217 5.58927C6.36217 5.33589 6.46283 5.09289 6.64199 4.91373C6.82116 4.73456 7.06416 4.63391 7.31753 4.63391H8.9098",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.54074 14.1875L4.23491 12.9137L5.93545 14.1875L7.62962 12.9137L9.33015 14.1875L11.0307 12.9137L12.7312 14.1875L13.3681 13.5506V0.8125H1.90384V13.5506L2.54074 14.1875Z",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"})),"Expenses"),filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=Lv(),a=e.length;return a>0&&I(qx,{label:`${t} ${dd("Expense","Expenses",a,!0)}`,...n,children:I(Xh,{onClick:function(t){var n,a;t?.id&&r((n=e,a=t.id.toString(),n.map(e=>({id:e.id,categoryId:a}))))}})})}},{id:"review",label:"Change Review Status",Icon:Bb,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:zx},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:zx},{id:"RECONCILED",label:"Reconciled",component:zx}]},{id:"more",label:"More",Icon:Ux,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=Vl(),{mutate:n}=Lv(),{resetSelected:r}=b(Hx),a="Recategorize "+dd("Revenue","Revenues",e.length,!0);return I(Yh,{triggerChildren:I(Zh,{displayLabel:a}),popupChildren:I(Tb,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.close(),r&&r()},types:xp})})},filter:e=>"REVENUE"===e.type}]}];function Yx({subActionList:e}){return I(rh,{children:e})}function _x({subActions:e,transactions:t,label:n,Icon:r}){const a=m(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?I(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return I(qx,{label:n,Icon:r,children:I(Gl,{children:a.length>0?I(Yx,{subActionList:a}):I(dh,{children:I(xl,{children:"No Actions Available for Selection"})},"no-actions")})})}const Zx=Kt(Ut["bulk-select"],Dt({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function Gx({table:e}){const t=e.getSelectedRowModel(),n=m(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=m(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return N("div",{...Zx,children:[I(Gm,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),I(Hx.Provider,{value:o,children:a&&N(S,{children:[I(fa,{children:`${r} selected`}),Kx.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?I(_x,{subActions:r,transactions:n,...i},a):t&&I(t,{transactions:l,...i},a)})]})})]})}function Qx({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=vf(),o=function({transactions:e,columns:t}){const n=vf(),r=ff({transactions:e,columns:t?[Ze.SELECT,...t,Ze.EXPAND]:void 0});return function(e,t,n=!0){const r=n&&!Sn(t.getColumn(_e.SELECT)),a=g(r?e:null);if(r){if(a.current!==e&&void 0!==a.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}a.current=e}}(e,r,!n),r}({transactions:e,columns:t});let i;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?i=I(Wx,{}):r&&0===e?.length&&(i=I(Pf,{})):i=I(Sf,{}),N(vl,{dashboard:"transactionDashboard",children:[Sn(i)&&!a&&I(Gx,{table:o}),I(hi,{headerGroups:o.getHeaderGroups()}),Sn(i)?I(gi,{children:o.getRowModel().rows.map(e=>I(Tf,{rowData:e},e.id))}):I(Ns,{children:i})]})}const Xx=Dt({display:"flex",padding:"16px 12px",border:"0.75px",borderStyle:"solid",borderRadius:["borderWidths.sm"],borderColor:["border.layout"]}),Jx=Ot(Xx,Dt({flexDirection:"column",alignItems:"flex-start",gap:"16px",flex:1}));function $x({children:e}){return I("div",{className:Jx,children:e})}const ek=Bt({base:{display:"flex",alignItems:"center",gap:"10px",alignSelf:"stretch"}});function tk({children:e}){return I("div",{className:ek(),children:e})}const nk=Bt({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"12px",alignSelf:"stretch"}});function rk({children:e}){return I("div",{className:nk(),children:e})}const ak=Bt({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}});function ok({children:e,type:t,isSample:n=!1}){return I("div",{className:ak({type:t,isSample:n}),children:e})}const ik=e=>["banks/transactions/summary",e],lk=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query/summary",bodyParams:t[1],accessToken:t[2].accessToken,endpointManager:fo(t[2].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null},sk=[{key:"NEEDS_REVIEW",apiStatuses:[pv.USER_REVIEW_REQUIRED],label:"Needs Review",variantKey:"NeedsReview",icon:Fb,count:0},{key:"DISCREPANCY",apiStatuses:[pv.RECONCILIATION_DISCREPANCY],label:"Discrepancy",variantKey:"Discrepancy",icon:zd,count:0},{key:"PROCESSING",apiStatuses:[pv.RECONCILIATION_STAGED],label:"Processing",variantKey:"Processing",icon:Ob,count:0},{key:"RECONCILED",apiStatuses:[pv.RECONCILED],label:"Reconciled",variantKey:"Reconciled",icon:Bb,count:0}];const ck=Bt({base:{display:"flex",width:"200px",height:"48px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",cursor:"pointer"},variants:{filterStatus:{inactive:{},active:{borderRadius:["borderWidths.sm"],borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:["brand.action.strong"],background:["surface.background.hover"]}}},defaultVariants:{filterStatus:"inactive"}});function dk({addFilters:e,filters:t,getModel:n,removeFilter:r,filterNames:a,filterStatus:o="inactive",filterModelKey:i,extractFilterValue:l,children:s}){const c=[],d=n(i);return d?(t.forEach((e,t)=>{const n=e.value[i]?.value;if(!n)return;const r=d.operators;r&&r.forEach(e=>{n[e.value]?.forEach(e=>{a.includes(e)&&c.push(t)})})}),I("div",{className:ck({filterStatus:o}),onClick:"inactive"===o?()=>{const t=n(i);if(!t||!t.possibleValues)return;const r=[];t.possibleValues().values.forEach(e=>{const n=l(e.value);if(n&&a.includes(n)){const n=t.createFilter(e);r.push(n)}}),e(r)}:()=>{c.forEach(e=>{r(e)})},children:s})):null}const uk=Bt({base:{display:"flex",padding:"8px",alignItems:"center",gap:"8px",alignSelf:"stretch",background:["surface.background"]},variants:{filterStatus:{inactive:{paddingLeft:"8px"},active:{paddingLeft:"4px"}}},defaultVariants:{filterStatus:"inactive"}}),hk=Bt({base:{display:"flex",padding:"10px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:["borderWidths.sm"],borderWidth:"1px",borderStyle:"solid"},variants:{reviewStatus:{Processing:{borderColor:["border.layout"],background:["surface.background"]},NeedsReview:{borderColor:["surface.intent.warning.active"],background:["surface.intent.warning"]},Discrepancy:{borderColor:["surface.intent.danger.weak"],background:["surface.intent.danger.opaque"]},Reconciled:{borderColor:["surface.intent.success.active"],background:["surface.intent.success"]}}},defaultVariants:{reviewStatus:"NeedsReview"}}),pk=Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",flex:"1 0 0"}),gk=Bt({base:{display:"flex",padding:"1px 0",alignItems:"center",gap:"10px",alignSelf:"stretch",fontFamily:["label"],fontSize:"14px",fontStyle:"normal",lineHeight:"16px",letterSpacing:"0.84px"},variants:{filterStatus:{inactive:{fontWeight:["label.sub"]},active:{fontWeight:["label.strong"]}}},defaultVariants:{filterStatus:"inactive"}}),mk=Dt({display:"flex",padding:"1px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function vk({filters:e,addFilters:t,removeFilter:n,getModel:r}){const{apiFilters:{reviewStatus:a,...o}}=$y(),{data:i}=function(e){const{query:{data:t},isFilling:n,isRehydrating:r}=function({groupBy:e,filter:t}){return Wn({queryKey:ik({groupBy:e,filter:t}),queryFn:lk})}({groupBy:"REVIEW_STATUS",filter:e});return{data:t?.data??void 0,isFilling:n,isRehydrating:r}}(o),l=["Needs Review","Discrepancy","Processing","Reconciled"],s=function(e){const t=sk.map(e=>({...e}));return e&&0!==e.length?(e.forEach(e=>{if(e.value&&vv(e.value)&&void 0!==e.count){if("ACCOUNTANT_REVIEW_REQUIRED"===e.value||"PARTNER_REVIEW_REQUIRED"===e.value)return;const n=t.find(t=>t.apiStatuses.includes(e.value));n&&(n.count+=e.count)}}),t):t}(i).sort((e,t)=>l.indexOf(e.label)-l.indexOf(t.label));return I(ok,{children:N($x,{children:[I(tk,{children:I(xl,{children:"Review Status"})}),I(rk,{children:s.map(o=>{const i=o.apiStatuses.some(e=>{return t=e,a?.in?.includes(t)??!1;var t})?"active":"inactive";return I(dk,{addFilters:t,filters:e,removeFilter:n,getModel:r,filterStatus:i,filterNames:o.apiStatuses,filterModelKey:"reviewStatus",extractFilterValue:e=>e.reviewStatus?.value.in?.[0],children:N("div",{className:uk({filterStatus:i}),children:[I("div",{className:hk({reviewStatus:o.variantKey}),children:I(Mo,{Component:o.icon},o.key)}),I("div",{className:pk,children:I("div",{className:gk({filterStatus:i}),children:o.label})}),I("div",{className:mk,children:String(o.count)})]})},o.key)})})]})})}const bk=Dt({display:"none",xl:{display:"flex",height:"318px",maxHeight:"318px",alignItems:"flex-start",gap:"16px",alignSelf:"stretch",borderRadius:["borderWidths.sm"]}});function fk(e){return I("div",{className:bk,children:e.children})}const yk=Kt(null,Dt({display:"flex",flexDirection:"column",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"12px",gap:"8px",minWidth:"180px"})),xk=Kt(null,Dt({width:"100%",height:"1px",backgroundColor:"border.layout"})),kk=Kt(null,Dt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"20px"})),Tk=wa.var("colors.money.positive"),Ck=wa.var("colors.money.negative");function wk({active:e,payload:t}){if(!e||!t||0===t.length)return null;const n=t.find(e=>"income"===e.dataKey),r=t.find(e=>"expense"===e.dataKey),a=t[0]?.payload?.month||"",o=n?.value??0,i=r?.value??0;return N("div",{...yk,children:[I(fa,{children:a}),I("div",{...xk}),N("div",{...kk,children:[I(Sa,{color:Tk,label:"Income",diameter:12}),I(xa,{children:ma(Number(o))})]}),N("div",{...kk,children:[I(Sa,{color:Ck,label:"Expense",diameter:12}),I(xa,{children:ma(Number(i))})]})]})}const Ek={top:20,right:20,left:20,bottom:5},Ak=Kt(Ut["profit-loss-graph"],Dt({"& .recharts-surface":{outline:"none"}})),Ik=wa.var("colors.border.layout"),Sk={fill:wa.var("colors.typography.base"),fontSize:wa.var("fontSizes.metric.sm")},Nk=wa.var("colors.money.positive.weak"),Pk=wa.var("colors.money.negative.weak");function Mk({data:e}){return I(B,{width:"100%",height:"100%",...Ak,style:{flexGrow:1},children:N(V,{data:e,accessibilityLayer:!0,barCategoryGap:"20%",margin:Ek,children:[I(H,{dataKey:"shortMonth",interval:0,tickLine:!1,stroke:Ik,tick:Sk}),I(j,{content:({active:e,payload:t})=>I(wk,{active:e,payload:t}),isAnimationActive:!1,cursor:{fill:"transparent"}}),I(z,{name:"Expense",dataKey:"expense",minPointSize:2,fill:Pk,isAnimationActive:!1,activeBar:{fill:"#f45c5c"}}),I(z,{name:"Income",dataKey:"income",minPointSize:2,fill:Nk,isAnimationActive:!1,activeBar:{fill:"#009c75"}})]})})}const Rk=Dt({display:"flex",flexDirection:"row",gap:"8px",justifyContent:"flex-end"}),Dk=wa.var("colors.money.positive.weak"),Lk=wa.var("colors.money.negative.weak");function Ok(){return N("div",{className:Rk,children:[I(Sa,{color:Dk,label:"Income",diameter:10}),I(Sa,{color:Lk,label:"Expense",diameter:10})]})}const Fk=Bt({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function Bk({width:e,children:t}){return I("div",{className:Fk({width:e}),children:t})}function Vk({options:e,handleClick:t,selected:n}){return I(Bk,{width:"full",children:e.map(e=>I(Ep,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground"},e.value))})}const Uk=Kt(null,Dt({display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"20px"})),Wk=Kt(null,Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px"})),Hk=Kt(null,Dt({flexDirection:"column",alignItems:"flex-end",gap:"10px",width:"300px",display:"flex"})),qk=Ot(Xx,Dt({flexGrow:1,flexShrink:0,minHeight:"100%",flexDirection:"column"})),jk=e=>"QUARTERLY"===e?function(e){const t=/* @__PURE__ */new Date,n=3*(e-1),r=function(e){const t=e.getMonth(),n=t-t%3+3;return en(tn(e.getFullYear(),n,0))}(t);return{beginDate:function(e){const t=e.getMonth(),n=t-t%3;return en(tn(e.getFullYear(),n,1))}(tn(t.getFullYear(),t.getMonth()-n,t.getDate())),endDate:r}}(4):"PAST_YEAR",zk=[{label:"Months",value:"MONTHLY"},{label:"Quarters",value:"QUARTERLY"},{label:"Years",value:"YEARLY"}];function Kk(){const[e,t]=y({label:"Months",value:"MONTHLY"}),n=function(e){const{query:{data:t}}=jr({filter:jk(e),grouping:e,select:e=>{if("SUCCESS"!==e.result)return[];const t=e.json?.data;return void 0===t?[]:t.map(e=>{const t=e.period?.beginDate,n=fn(t??"");return{month:n?Tn(n,{abbreviateMonth:!1,abbreviateYear:!1}):"",income:e.income?.total??0,expense:e.expenses?.total??0,shortMonth:Kr(t)}})}});return t??[]}(e.value),r=n.reduce((e,t)=>e+t.income-t.expense,0);return N("div",{className:qk,children:[N("div",{...Uk,children:[N("div",{...Wk,children:["All Transactions",I(sa,{title:ma(r),label:void 0})]}),N("div",{...Hk,children:[I(Vk,{options:zk,handleClick:e=>t(e),selected:e}),I(Ok,{})]})]}),I(Mk,{data:n})]})}const Yk=Dt({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1440px"}),_k=Dt({display:"flex",justifyContent:"center"});function Zk({limit:e=100,columns:t=Fx}){const{sortInstance:n,setSortInstance:r,apiSort:a}=jm(),{filters:o,filterPopupModels:i,addFilters:l,removeFilter:s,apiFilters:c,getModel:d}=$y(),u={limit:e,sort:a,filter:{...c}},{isFilling:h,paginationControls:p,query:{data:g,isError:m,error:v,isFetching:b}}=Oi(u),f=g?.data,{hasPlaidLinkedBankAccount:y}=wh(),x=y??!1;if(m)return I("div",{children:`Error: ${v?.message}`});if(h)return I(qo,{});if(void 0!==f){const e=function(e,t){let n;return n=0===e?"FILTERS_NOT_APPLIED":e>0&&0===t?"FILTERS_MATCHED_NONE":"FILTERS_MATCHED_ANY",n}(o.length,f.length);return I("div",{className:_k,children:I("div",{className:Yk,children:N(Po.Provider,{value:p,children:[N(fk,{children:[I(vk,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d,isFetching:b}),I(Kk,{})]}),I(Ox,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d,isFetching:b}),I(bl.Provider,{value:{sortInstance:n,setSortInstance:r},children:I(Qx,{hasLinkedBankAccount:x,filterState:e,transactions:f,columns:t})}),I(Vx,{})]})})})}return"zero state"}const Gk=e=>I(yy,{children:I(Zk,{...e})}),Qk=Kt(Ut["drawer-header"],Dt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function Xk({hideDivider:e=!1,children:t}){return N(S,{children:[I("div",{...Qk,children:t}),!e&&I(vi,{alignment:"horizontal",color:"normal"})]})}const Jk=Ot(Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),ea);function $k({children:e}){return I("div",{className:Jk,children:e})}const eT=Kt(null,Dt({display:"flex",backgroundColor:"surface.intent.action.discrete",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),So),tT=()=>Ai();function nT({Icon:e=Wl,handleClose:t=tT}={}){return I("button",{...eT,onClick:t,type:"button",children:I(Vc,{Component:e,...eT})})}const rT=Dt({display:"flex",flexDirection:"column"});function aT({task:e}){return I("div",{className:rT,children:I(ny,{task:e})})}const oT=Dt({padding:"20px 16px 8px 16px",backgroundColor:"surface.background"}),iT=Dt({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),lT=Dt({width:"120px",height:"20px"}),sT=Dt({width:"80px",height:"12px"}),cT=Dt({width:"150px",height:"16px"}),dT=Dt({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),uT=Dt({userSelect:"none",cursor:"pointer"});function hT(){return N("div",{className:dT,children:[N("div",{className:uT,children:[I("div",{className:oT,children:I(Ya,{styles:lT})}),N("div",{className:iT,children:[I(Ya,{styles:cT}),I(Ya,{styles:sT})]})]}),N("div",{className:uT,children:[I("div",{className:oT,children:I(Ya,{styles:lT})}),N("div",{className:iT,children:[I(Ya,{styles:cT}),I(Ya,{styles:sT})]}),N("div",{className:iT,children:[I(Ya,{styles:cT}),I(Ya,{styles:sT})]})]})]})}const pT=Dt.raw({"&::before":{content:{base:"''",sm:"none"},position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function gT({children:e,stylists:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:e=>I(ns,{extraClassNames:[pT],popupTriggerProps:e,children:I(Mo,{Component:Ux,stylists:t})})}),I(Gl,{children:e})]})}const mT=wo(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),p.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),vT=Dt({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),bT=Dt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),fT=Dt({display:"flex",flexDirection:"column",gap:"12px"}),yT=Dt({display:"flex",flexDirection:"row",gap:"10px"}),xT=Dt({display:"flex",flexDirection:"column",gap:"10px"}),kT=({acknowledged:e,setAcknowledged:t})=>N("div",{className:fT,children:[I(xl,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),N("div",{className:yT,children:[I(_m,{checked:e,onClick:()=>t(!e)}),I(xl,{wrap:"wrap",children:"I understand."})]})]});function TT({bankAccounts:e}){const{apiPartnerName:t}=b(cs),n=e.reduce((e,t)=>{const n=fn(t.tranStartDate||""),r=fn(e.tranStartDate||"");return n&&r&&gn(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=Pd();return fg({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;cd({title:"Start Date Updated",body:N("div",{className:xT,children:[I(xl,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),I(xl,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:td,type:ld}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:qi(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=Vl(),o=()=>{a.close()},[i,l]=y(!1),{query:{data:s}}=Yc(),c=s?.data?.find(t=>t.id===(e[0]?.integration.id??""))?.apiInstitutionName||"bank",d=fn(e.reduce((e,t)=>{const n=fn(t.tranMinStartDate||""),r=fn(e.tranMinStartDate||"");return n&&r&&gn(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${hd(e[0]?.name,e[0]?.mask)} account dating back to ${wn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${wn(d)}.`;return N("form",{className:vT,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.close()},children:[I(fa,{children:"Set Bank Transaction Start Date"}),I(xl,{wrap:"wrap",children:u}),I(xl,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),I(r.AppField,{name:"tranStartDate",children:e=>I(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),I(r.Subscribe,{selector:e=>e,children:e=>{const t=fn(e.values.tranStartDate||""),r=fn(n),a=t&&r&&gn(t,r);return N(S,{children:[e.isDirty&&a&&I(kT,{acknowledged:i,setAcknowledged:l}),N("div",{className:bT,children:[I(kg,{showIcon:!1,onClick:o}),I(jd,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function CT({bankAccounts:e}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Ul,{children:e=>N(dh,{...e,children:[I(Vc,{Component:mT}),I(fa,{children:"Edit Start Date"})]})}),I(fx,{children:I(kx,{children:I(Cx,{width:"sm",children:I(TT,{bankAccounts:e})})})})]})}const wT=wo(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M7.49998 14.4245C11.3242 14.4245 14.4244 11.3244 14.4244 7.50011C14.4244 3.67585 11.3242 0.575684 7.49998 0.575684C3.67573 0.575684 0.575562 3.67585 0.575562 7.50011C0.575562 11.3244 3.67573 14.4245 7.49998 14.4245Z",strokeMiterlimit:10}),p.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),ET=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),p.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),AT=Dt({display:"flex",flexDirection:"column",gap:"16px"}),IT=Kt(null,Dt({color:"brand.danger"}));function ST({integration:e,accounts:t}){const{mutate:n}=em(),r=Vl(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=rm(),{query:{data:l}}=(s=e.id,Kc({},{select:e=>{return{...e,data:(t=e.data,n=s,t?.find(e=>e.id===n))};var t,n}}));var s;const c=l?.data,{query:{data:d}}=Ih(e.id),u=d?.data,h="PLAID"===e.apiName,p="UNIT"===e.apiName;return N(rh,{children:[h&&!o&&N(dh,{onClick:()=>(a({plaidEvent:qg,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r.close()),children:[I(Vc,{Component:$i}),I(fa,{children:"Add Account"})]}),h&&u&&I(CT,{bankAccounts:u}),t.length>0&&N(dh,{onClick:()=>Og({plaidItemAccounts:t}),children:[I(Vc,{Component:ET}),I(fa,{children:"Merge Accounts"})]}),!p&&N(dh,{onClick:()=>(async()=>{const t=await(async e=>cd({title:"Remove Institution",body:I("div",{className:AT,children:I(xl,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:$c,label:"Cancel"},{key:ed,label:"Remove",type:sd}]}))(e.apiInstitutionName);var o;r.close(),t===ed&&(h&&i?a({plaidEvent:jg,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(o=e.id,n({id:o})))})(),children:[I(Vc,{stylists:[IT],Component:wT}),I(fa,{stylists:[IT],children:"Delete Connection"})]})]})}const NT=Dt({userSelect:"none"});function PT({children:e}){return I("div",{className:NT,children:e})}const MT=Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBlock:"{borderWidths.md} solid",borderColor:"border.layout.weak"});function RT({children:e}){return I("div",{className:MT,children:e})}const DT=Kt(Ut.badge,$v),LT=Kt(null,na),OT=Kt(null,So),FT=Kt(Ut["neutral-badge"],tb),BT=Kt(Ut["highlight-badge"],rb),VT=Kt(Ut["success-badge"],ob),UT=Kt(Ut["warning-badge"],lb),WT=Kt(Ut["critical-badge"],cb);function HT({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=WT;break;case"warning":o=UT;break;case"neutral":o=FT;break;case"success":o=VT;break;case"highlight":o=BT}const i=Qt([DT,LT,o,OT]);return I("button",{...i,onClick:n,disabled:r,...a,children:t})}function qT({plaidItem:e}){const t=ey(e);return N(HT,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(Cr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),ty(t))},disabled:Sn(t),children:[I(Vc,{Component:zd}),I(xa,{children:"Fix Bank Error"}),I(Mo,{Component:Ao})]})}const jT=Bt({base:{padding:"16px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}}),zT=Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",overflow:"hidden"});function KT({bankAccountId:e,name:t,mask:n,syncText:r,active:a,integration:o}){const i="PLAID"===o?.apiName,l=Ot(jT({active:a}),So);return N("button",{className:l,onClick:t=>{t.stopPropagation(),Ei("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[N("div",{className:zT,children:[i?I(Vc,{Component:rv}):I(Ps,{Component:tp}),I(Dp,{accountName:t,accountNo:n,syncText:r,active:a})]}),a&&I(Vc,{Component:Ao})]})}const YT={QBO:"QuickBooks Online",XERO:"Xero",STRIPE:"Stripe",SHOPIFY:"Shopify",SQUARE:"Square",RUTTER:"Rutter",UBER:"Uber",MOOV:"Moov",QUALPAY:"Qualpay",BENCH:"Bench",WAVE:"Wave",MANUAL_ENTRY:"Manual Entry",CSV_IMPORT:"CSV Import",PARTNER_IMPLEMENTATION:"Partner Implementation",FRESHBOOKS:"FreshBooks",FRESHBOOKS2:"FreshBooks"};function _T(e){const{apiPartnerName:t,unitIntegrationBankName:n}=b(cs);return"UNIT"===e?n??t??"Unit":YT[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const ZT=Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"12px"}),GT=Dt({display:"flex",flexDirection:"column",gap:"4px"}),QT=Dt({display:"flex",alignItems:"center",gap:"8px"}),XT=Kt(null,Dt({color:"brand.primary.weak"})),JT=Dt({overflow:"hidden"}),$T=e=>{const t=e.find(e=>e.isSupported&&e.lastSyncedDate);if(t&&t.lastSyncedDate)return`Last synced ${Cn(t.lastSyncedDate)}`},eC=e=>{let t;return t=e.isSupported?e.lastSyncedDate?void 0:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function tC({integration:e}){const{query:{data:t}}=Ih(e.id),n=t?.data,r="PLAID"===e.apiName,a=Op(r?e.apiInstitutionId??void 0:void 0),o=_T(e.apiName);return Fe(n)?N(PT,{children:[N(RT,{children:[N("div",{className:ZT,children:[I("img",{src:a,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}),N("div",{className:GT,children:[I(xl,{children:e.apiInstitutionName??o}),I(xa,{children:$T(n)})]})]}),N("div",{className:QT,children:[r&&Nn(e.apiErrorCode)&&I(qT,{plaidItem:e}),I(gT,{stylists:[XT],children:I(ST,{integration:e,accounts:n})})]})]}),I("div",{className:JT,children:n.map(t=>I(KT,{bankAccountId:t.id,mask:t.mask,name:t.name,syncText:eC(t),active:t.isSupported,integration:e},t.id))})]}):null}const nC=Dt({objectFit:"contain"});function rC(e,t,n){const r=({size:n=24})=>I("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:nC});return r.displayName=t,r}const aC=rC("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj3dOl9A+pf7A3WH3gwN+++/GhlEOJ6e23f3h6sHf3R3sTvff31ZQcmR0GipR97PcZyukhL5OD0aQ351CyIgCBiX46yNh8ywWuaXloulKuzXbCO2NCbngdG135HBOTlYZwySLRAwXwie+fWPpg+Yf3LFXJUkjO2r7dX+z1+2+hOsaTYywczQrQ0A5V520UIc3tvMYtualT3WiBaE5ix6uxigWPSbVhOjZcnp6FDzH0ianDoEsvkpHUC/t2EsdYqsT9T7y4/A6S5HKIyonkINuCY1IDH08OwSHXZAk2nWJMpV0sOSRQfJ8Mxg4cY4w1gUfPh0YHlnHDTjsR8Kpsr4fNvjG6yQF/vQ8Y6310Ab3l1u3TH7XpfW/8s9vnt1z7KJfVAIqanfPAUwebQYRjeFVbTQJOIiOTNRg5VUUanuZrKZ99leleppUUgQvF+iRBLf1gHL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3ZlH7O1siINKDo6mh49eiRbzl76+fl5qq+v3zt2cwdT2bIi3cUmJiZoZwfL99SEXSRqiha1tra2aHp6WjoXaUAo5MOHD9IFaQromj9+/NAOTW9VdPSZYz5/dnZWH2VqX7qL8cumbyEBhu4qcv36dcrLy6Px8XEp9Xv37pHKOEYrZGRkhNbX17VD01tpQMj5xYsX9PDhQ9OF6BPyFBH19fUR+7L10QH38Q7GE4J07ty5gOkCnUSdVUX6DZeXrYjPnz8rv1m7rYg1AqqTidL3IFwFdndQd3e36gVxXY99QVItdn8FpVsQZyBycnLEt2/f3G4M0uXxfUdkZGQo2Qg7AUtZGQuZjrs0NjYq22cZEC+pc2UNkOpF4EGpwKIKK43AUgtCwRUVFar1d1SPB7OipKTEKhzoq3cxTRdL4Y6b2NC1NLjWAfF0jBgYGDg2jHjM45sx0S6gxa11QKgAxhlYvHTUMjg4KHgNtnb17djaA0iD9Pr16yNjhJZjMxx77kH6JoyVXVhR4bY0NDTY2a30Lc++FqQHVV5eLvCYdVowIVhaWqo3yO59ZwABVnx8vGhubhYYzdotmIbGk4q9CnYD2Z+fc4C0FpWdnS2ampoE+5Esc8K0N8DwBOZ+Qxw5dvUfh1ihUVBQ4PszC/w7vIwm6DQ0HGVw0/ISY3r58iXxcIIw+eiWuApIbxT8Qpgrx1+iMOMJZ5g2b6X/OxT+CgVPoIqzS1+e6v6RAVKtsNt6Sv4gtyt5lOV5gILQ9wCZACTv6g+S6Qk6vY4W9O4EGWS3Ke8AqN/uXE9Qfv14zHufxzn8ivo+j6OdesI7jgzVf+N8wWRPvE90+TeQA5/oAilAAjWssDytrQm2g4Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","Uber")};function dC(e){return cC[e]??tp}const uC=Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}),hC=Dt({display:"flex",flexDirection:"column",gap:"4px"}),pC=Kt(null,Dt({color:"brand.danger"})),gC=Dt({display:"flex",flexDirection:"column",gap:"16px"}),mC=({integration:e})=>{const{mutate:t}=em(),n=Vl(),r=_T(e.apiName);return I(rh,{children:N(dh,{onClick:()=>(async()=>{const a=await(async e=>cd({title:"Remove Institution",body:I("div",{className:gC,children:I(xl,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:$c,label:"Cancel"},{key:ed,label:"Remove",type:sd}]}))(r);n.close(),a===ed&&t({id:String(e.id)})})(),children:[I(Vc,{stylists:[pC],Component:wT}),I(fa,{stylists:[pC],children:"Delete Connection"})]})})};function vC({integration:e}){const t=_T(e.apiName),n=function(e){if(e)return`Last synced ${Cn(e)}`}(e.lastSyncedDate),r=dC(e.apiName);return I(PT,{children:N(RT,{children:[I($k,{children:N("div",{className:uC,children:[I(Ps,{Component:r}),N("div",{className:hC,children:[I(xl,{wrap:"wrap",children:e.apiUsername?`${t} (${e.apiUsername})`:t}),n&&I(xa,{intent:"normal",children:n})]})]})}),I(gT,{children:I(mC,{integration:e})})]})})}const bC=Dt.raw({color:"typography.base.weak"}),fC=Dt({overflow:"hidden"});function yC({manualBankAccounts:e}){return N(PT,{children:[N("div",{className:Dt({display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:"16px",marginBottom:"8px"}),children:[I(xl,{extraClassNames:[bC],children:"Manually Tracked Accounts"}),I(ns,{onClick:()=>Ei("BankAccountForm"),active:!1,children:I(Vc,{Component:$i})})]}),I("div",{className:fC,children:e.map(e=>I(KT,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const xC=Ot(Dt(al,{backgroundColor:"surface.foreground",minWidth:"100%",justifyContent:"start",marginBottom:"5px",padding:"16px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"}),Io),kC=Dt({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),TC=Dt({display:"flex",alignItems:"center",gap:"8px"}),CC=Dt({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",gap:"4px"});function wC(){const{linkPlaid:e,loading:t}=am();return I("button",{className:xC,disabled:t,onClick:()=>{Cr("Add New Connection button pressed"),e({plaidEvent:Hg,message:"Add New Connection button pressed"})},children:N("div",{className:kC,children:[N("div",{className:TC,children:[I(Ps,{stylists:[Kt(null,Dt({width:"20px",height:"20px"}))],Component:tp}),N("div",{className:CC,children:[I(xl,{children:"Connect your bank"}),I(xa,{children:"Find your banking institution with Plaid"})]})]}),I(Vc,{Component:Ao})]})})}const EC=Dt({paddingInline:"16px",paddingBottom:"8px"}),AC=Dt.raw({color:"typography.base.weak",fontWeight:"label"});function IC({title:e,children:t}){return N("div",{children:[I("div",{className:EC,children:I(xl,{extraClassNames:[AC],children:e})}),t]})}const SC=Dt({minWidth:"100%",height:"45px"});function NC(){return N(S,{children:[I(Ya,{styles:SC}),I(Ya,{styles:SC}),I(Ya,{styles:SC})]})}const PC=Ot(Dt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Io),MC=Dt({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),RC=Dt({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),DC=Dt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function LC({integration:e}){const{linkPlaid:t,loading:n}=rm(),r=Op(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=dC(e.apiName),i=_T(e.apiName);return I("button",{className:PC,disabled:n||!a,onClick:()=>{Cr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:qg,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:N("span",{className:MC,children:[N("div",{className:RC,children:[r?I("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):I(Ps,{Component:o}),I(xl,{children:e.apiInstitutionName??i??void 0})]}),a&&N("div",{className:DC,children:[I(Mo,{Component:Bc}),I(xl,{children:"Relink"})]})]})})}const OC=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},p.createElement("g",{fill:"none",fillRule:"nonzero"},p.createElement("path",{fill:"#95BF47",d:"M48.024 12.24a.567.567 0 0 0-.536-.495c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69c-.357-.36-1.073-.27-1.341-.18-.045 0-.716.225-1.878.585-1.118-3.285-3.086-6.255-6.529-6.255h-.313C27.768.585 26.517 0 25.487 0c-8.048 0-11.894 10.125-13.1 15.255-3.13.99-5.367 1.665-5.635 1.755-1.744.54-1.789.585-2.012 2.25C4.56 20.52 0 56.07 0 56.07l35.549 6.705L54.82 58.59c0-.045-6.752-46.035-6.797-46.35zm-14.443-3.6c-.894.27-1.922.585-2.996.945V8.91c0-1.98-.268-3.6-.715-4.905 1.789.27 2.951 2.295 3.711 4.635zm-5.947-4.185c.492 1.26.805 3.015.805 5.445v.36c-1.967.63-4.07 1.26-6.215 1.935 1.207-4.635 3.487-6.885 5.41-7.74zm-2.37-2.295c.358 0 .716.135 1.029.36-2.594 1.215-5.321 4.275-6.484 10.44-1.7.54-3.354 1.035-4.919 1.53 1.342-4.68 4.606-12.33 10.374-12.33z"}),p.createElement("path",{fill:"#5E8E3E",d:"M47.488 11.7c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69a.716.716 0 0 0-.492-.225l-2.683 55.35 19.273-4.185s-6.752-46.035-6.797-46.35a.776.776 0 0 0-.581-.54z"}),p.createElement("path",{fill:"#FFF",d:"M29.02 22.41l-2.37 7.11S24.55 28.395 22 28.395c-3.756 0-3.935 2.385-3.935 2.97 0 3.24 8.407 4.5 8.407 12.105 0 5.985-3.757 9.855-8.854 9.855-6.126 0-9.211-3.825-9.211-3.825l1.654-5.445s3.22 2.79 5.902 2.79c1.789 0 2.504-1.395 2.504-2.43 0-4.23-6.886-4.41-6.886-11.385 0-5.85 4.159-11.52 12.61-11.52 3.22-.045 4.83.9 4.83.9z"}),p.createElement("path",{fill:"#000",d:"M77.835 35.263c-1.938-1.032-2.93-1.93-2.93-3.141 0-1.526 1.398-2.513 3.56-2.513 2.524 0 4.777 1.032 4.777 1.032L85 25.256S83.378 24 78.6 24c-6.669 0-11.31 3.814-11.31 9.154 0 3.051 2.163 5.34 5.047 7 2.343 1.301 3.154 2.243 3.154 3.634 0 1.436-1.171 2.603-3.334 2.603-3.2 0-6.264-1.66-6.264-1.66L64 50.115S66.794 52 71.526 52c6.85 0 11.807-3.365 11.807-9.423-.045-3.32-2.524-5.61-5.498-7.314zM103.897 24.304c-3.316 0-5.925 1.62-7.914 4.053l-.089-.045L98.768 13h-7.472L84 52h7.473l2.476-13.33c.972-5.044 3.537-8.152 5.925-8.152 1.68 0 2.343 1.171 2.343 2.838 0 1.035-.088 2.341-.31 3.377L99.078 52h7.473l2.919-15.762c.31-1.666.53-3.648.53-4.999.045-4.368-2.166-6.935-6.102-6.935zM127.92 24C118.943 24 113 32.23 113 41.4c0 5.859 3.565 10.6 10.255 10.6C132.058 52 138 43.994 138 34.6c.044-5.456-3.081-10.6-10.08-10.6zm-3.653 22.185c-2.552 0-3.609-2.191-3.609-4.965 0-4.338 2.201-11.405 6.25-11.405 2.641 0 3.521 2.326 3.521 4.562 0 4.652-2.244 11.808-6.162 11.808zM157.168 24c-5.102 0-8.01 4.489-8.01 4.489h-.09l.447-4.045h-6.713c-.313 2.712-.94 6.89-1.521 10L136 62h7.563l2.104-11.156h.179s1.566.978 4.43.978c8.906 0 14.724-9.066 14.724-18.222 0-5.067-2.282-9.6-7.832-9.6zm-7.25 22.133c-1.969 0-3.133-1.11-3.133-1.11L148.04 38c.895-4.711 3.356-7.822 5.996-7.822 2.328 0 3.044 2.133 3.044 4.133 0 4.889-2.91 11.822-7.16 11.822zM176.287 14A4.25 4.25 0 0 0 172 18.284c0 2.186 1.414 3.716 3.536 3.716h.088c2.343 0 4.332-1.574 4.376-4.284 0-2.186-1.459-3.716-3.713-3.716zM166 52h7.736L179 25h-7.782zM198.487 25.574h-5.453l.277-1.276c.462-2.642 2.034-4.965 4.668-4.965 1.387 0 2.496.41 2.496.41l1.525-6.06S200.66 13 197.748 13c-2.773 0-5.546.774-7.672 2.551-2.681 2.233-3.929 5.467-4.53 8.747l-.23 1.276h-3.652l-1.156 5.831h3.652L180 53h7.81l4.16-21.595h5.408l1.11-5.831z"}),p.createElement("path",{fill:"#000",d:"M216.005 25s-4.788 11.928-6.912 18.45h-.09c-.135-2.1-1.897-18.45-1.897-18.45h-8.04l4.607 24.615c.09.536.045.894-.18 1.251-.904 1.698-2.395 3.35-4.157 4.557-1.445 1.027-3.071 1.697-4.336 2.144L197.123 64c1.536-.313 4.788-1.608 7.498-4.11 3.479-3.216 6.731-8.22 10.029-15.01L224 25h-7.995z"}))),FC=Ot(Dt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Io),BC=Dt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),VC=Dt({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),UC=Dt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),WC=Dt({border:"{borderWidths.lg} solid ",borderColor:"border.layout.strong",outline:"none",backgroundColor:"surface.foreground",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",padding:"12px 16px",borderRadius:"md",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"}}),HC=Dt({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function qC(){const e=Vl(),{mutateAsync:t}=Qg(),[n,r]=y("");return N("div",{className:VC,children:[I(fa,{children:"Enter your shop name"}),I("div",{className:HC,children:I(OC,{})}),I(xl,{children:"Please enter the name of your shop below."}),I("input",{className:WC,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),N("div",{className:UC,children:[I(kg,{showIcon:!1,onClick:()=>{e.close()}}),I(Jc,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.close()},children:I(fa,{children:"Connect"})})]})]})}function jC(){const e=dC("SHOPIFY")??Bc;return N(Bl,{placement:"bottom",modal:!0,children:[I(Ul,{children:t=>N("button",{className:FC,...t,children:[N("div",{className:BC,children:[I(Ps,{Component:e}),I(xl,{children:"Shopify"})]}),I(Vc,{Component:Ao})]})}),I(fx,{children:I(kx,{children:I(Cx,{width:"sm",children:I(qC,{})})})})]})}const zC=Ot(Dt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Io),KC=Dt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function YC({apiName:e}){const{mutateAsync:t}=Qg(),n=_T(e);if("SHOPIFY"===e)return I(jC,{});const r=dC(e)??Bc;return N("button",{className:zC,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[N("div",{className:KC,children:[I(Ps,{Component:r}),I(xl,{children:n})]}),I(Vc,{Component:Ao})]})}const _C=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function ZC(e){return _C.includes(e)}const GC=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],QC=Dt({display:"flex",flexDirection:"column",paddingTop:"16px",gap:"16px",overflowY:"auto",height:"100%",backgroundColor:"surface.background"}),XC=Dt({display:"flex",flexDirection:"column",borderTop:"{borderWidths.md} solid {colors.border.layout.weak}"});function JC(){const{query:{data:e},isFilling:t}=uy(),n=e?.multiAccountIntegrations,r=e?.integrations,a=Nn(n)&&n.length>0||Nn(r)&&r.length>0,o=function({connectedIntegrations:e}){const t=b(cs),n=Ye(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(ZC),a=e?.map(e=>e.apiName)||[];let o=r??GC;return t&&(o=o.filter(e=>{switch(e){case"GUSTO":return t.hasPayroll;case"SHOPIFY":return t.hasShopify;case"SQUARE":return t.hasSquare;case"STRIPE":return t.useStripeInvoicePaymentProcessing;default:return!0}})),o=o.filter(e=>!a.includes(e)),o}({connectedIntegrations:r});return N("div",{className:QC,children:[(t||a)&&I(IC,{title:"Already Connected",children:t?I(NC,{}):N(S,{children:[n?.map(e=>I(LC,{integration:e},e.id)),r?.map(e=>I(LC,{integration:e},e.id))]})}),I(IC,{title:"Available Banks",children:I(wC,{})}),o&&o.length>0&&I(IC,{title:"Integrations",children:I("div",{className:XC,children:o.map(e=>I(YC,{apiName:e},e))})})]})}const $C=Dt({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}),ew=Dt({marginTop:"16px"}),tw=Dt.raw({color:"typography.base.weak",fontWeight:"label",paddingInline:"16px",marginBottom:"8px"});function nw({showPlaidItems:e,showNewConnectionContent:t,multiAccountIntegrations:n,integrations:r,manualBankAccounts:a}){return t?I(JC,{}):e?N(S,{children:[N("div",{className:ew,children:[I(xl,{extraClassNames:[tw],children:"Connected Accounts"}),n?.map(e=>I(tC,{integration:e},e.id))]}),N("div",{children:[Fe(r)&&I(xl,{extraClassNames:[tw],children:"Integrations"}),r?.map((e,t)=>I(vC,{integration:e,isLastItem:t===r.length-1},e.id))]}),a&&a.length>0&&I(yC,{manualBankAccounts:a})]}):a&&a.length>0?I(yC,{manualBankAccounts:a}):N("div",{className:$C,children:[I(Ps,{Component:tp}),I(fa,{wrap:"wrap",textAlign:"center",children:"If you prefer to manually input your transactions as opposed to having them automatically tracked, you can add your Manually Tracked Bank Account(s) here."})]})}const rw=Dt({display:"flex",flexDirection:"column",gap:"16px",height:"100%"}),aw=Bt({base:{overflowY:"auto",height:{base:"100%",sm:"fit-content"}},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),ow=Dt({padding:"20px 16px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.background",width:"100%"}),iw=Dt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"16px",margin:"16px"}),lw=Kt(null,Dt({minWidth:"100%",padding:"16px",border:"1px solid {colors.border.intent.primary}"})),sw=Bt({base:{},variants:{refreshLoading:{true:{animation:"spin 1s linear infinite"},false:{animation:"none"}}}});function cw({showCloseButton:e=!1,onPlaidLink:t,hideManualBanks:n}){rm();const{query:{data:r},isFilling:a}=uy(),o=r?.multiAccountIntegrations,i=r?.integrations,{query:{data:l}}=fd({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>Rd(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Eh(e?.data)};var t}}),{mutate:s,isPending:c}=Jg(),d=l?l.manualAccounts:null,u=o&&i?o.length+i.length:0,h=o?.find(e=>e.apiErrorCode),p=h&&fc(h,!1),g=Ye(e=>e.externalOptions.banksAndIntegrations),m=g?.integrations,v=n??(void 0!==m&&!m.includes("MANUAL_ENTRY")),b=Ye(e=>e.banksAndIntegrationsSelectedTab),f=v||"connected"===b.value,y=0===u&&f,x=f?"Add New Connection":"Add New Account",k=()=>{Ei(f?"NewConnection":"BankAccountForm")};return N(Yg,{onPlaidLink:t,children:[N(Xk,{hideDivider:v,children:[N($k,{children:[e&&I(nT,{}),I(fa,{children:"Banks & Integrations"})]}),N("div",{className:Dt({display:"flex",gap:"8px"}),children:[0!==u&&I(ns,{onClick:()=>s(),active:!1,disabled:c,children:I(Vc,{Component:Bc,stylists:[Kt(null,sw({refreshLoading:c}))]})}),I(ns,{onClick:()=>k(),active:!1,children:I(Vc,{Component:$i})})]})]}),p&&I("div",{className:iw,children:I(aT,{task:p})}),a?I(hT,{}):N(S,{children:[I("div",{className:aw({height:y?"fill":void 0,background:y?"foreground":void 0}),children:I("div",{className:rw,children:I(nw,{showPlaidItems:f,showNewConnectionContent:y,multiAccountIntegrations:o,integrations:i,manualBankAccounts:d})})}),!(f&&y)&&I("div",{className:ow,children:N(hl,{stylists:[lw],onClick:()=>k(),disabled:f&&!1,children:[I(Vc,{Component:$i}),I(fa,{children:x})]})})]})]})}const dw=Dt({display:"flex",justifyContent:"center"}),uw=Dt({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1440px",border:"{borderWidths.md} solid {colors.border.layout.weak}",borderRadius:"lg",backgroundColor:"surface.background"});function hw({onPlaidLink:e,hideManualBanks:t}){return I(yy,{children:I("div",{className:dw,children:I("div",{className:uw,children:I(cw,{showCloseButton:!1,onPlaidLink:e,hideManualBanks:t})})})})}const pw=we("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),gw={queryClient:Bn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await pw).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await pw).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await pw).delete("queryClient",e)}(e)}}}(),maxAge:Fn,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function mw({children:e}){return I(Ee,{client:Bn,persistOptions:gw,children:e})}const vw=Dt({position:"absolute",top:0,left:0,width:{base:0,sm:"100dvw"},height:{base:0,sm:"100dvh"},minWidth:{base:0,sm:"100dvw"},minHeight:{base:0,sm:"100dvh"},maxHeight:{base:0,sm:"100dvh"},maxWidth:{base:0,sm:"100dvw"},overflow:"hidden",backgroundColor:"overlay"}),bw=Dt({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100dvw",height:"100dvh",minWidth:"100dvw",minHeight:"100dvh",maxHeight:"100dvh",maxWidth:"100dvw",overflow:"hidden"}),fw=Kt(null,Ut.component,bw);function yw({children:e}){const t=g(null),n=g(null);return N(pe,{lockScroll:!0,children:[I("div",{className:vw}),I("div",{onMouseDown:e=>{n.current=e.target},onClick:e=>{const r=n.current===t.current,a=e.target===t.current;r&&a&&(n.current=null,Ye.getState().requestCloseAllDrawers())},ref:t,...fw,children:e})]})}const xw=v({drawerHistory:[]});function kw({children:e}){const t=Ye(e=>e.drawerHistory),n=m(()=>({drawerHistory:t}),[t]),r=t.length>0;return I(xw.Provider,{value:n,children:r&&I(yw,{children:e})})}const Tw=v({isActive:!0,isInHistory:!0});function Cw({Component:e,name:t}){const{drawerHistory:n}=b(xw),r=n.at(-1);if(void 0===r)return null;const a=n.find(e=>void 0!==e[t]),o=void 0!==r[t],i=void 0!==a;return a&&a[t]?I(Tw.Provider,{value:{isActive:o,isInHistory:i},children:I(e,{...a[t].routeProps})}):void 0}const ww=Bt({base:{position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",_focus:{outline:"none"}},variants:{shouldDisplay:{true:{},false:{display:"none"}},animationVariant:{slideInRight:{animation:"slideIn.right"},slideInUp:{animation:"slideIn.up"},slideOutRight:{animation:"slideOut.right"},slideOutDown:{animation:"slideOut.down"},none:{}}},defaultVariants:{shouldDisplay:!0,animationVariant:"none"}});function Ew({children:e}){const t=g(null),{isActive:n,isInHistory:r}=b(Tw),{animationState:a,handleAnimationEnd:o,shouldDisplay:i}=function({isActive:e,isInHistory:t,focusRef:n}){const r=g(!1),a=g(!1),[o,i]=y("none"),l=Ye(e=>e.closingDrawerCount),s=l>0,c=e&&s,d=e||s||t;A(()=>{e&&t&&!a.current&&!s&&i("opening"),r.current=e,a.current=t},[e,t,s]),A(()=>{c&&"closing"!==o&&i("closing")},[c,o]);const u=x(e=>{("slide-out-right"===e.animationName||"slide-out-down"===e.animationName)&&(l>1?Ye.getState().confirmCloseAllDrawers():Ye.getState().confirmCloseDrawer()),i("none")},[l]);return k(()=>{e&&!s&&n.current?.focus()},[e,s,n]),{animationState:o,handleAnimationEnd:u,shouldDisplay:d}}({isActive:n,isInHistory:r,focusRef:t});return I("div",{ref:t,tabIndex:-1,className:ww({shouldDisplay:i,animationVariant:/* @__PURE__ */function(e){return"none"===e?"none":"opening"===e?"slideInRight":"slideOutRight"}(a)}),onAnimationEnd:o,children:e})}const Aw=Kt(null,Dt({display:"flex",backgroundColor:"surface.foreground",flexDirection:"column",height:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",minWidth:"fit-content",borderLeft:"1px solid {colors.border.layout.strong}",justifyContent:"flex-start",alignItems:"center",padding:5,gap:"10px"}));function Iw({children:e}){return I("div",{tabIndex:-1,...Aw,children:e})}const Sw=Bt({base:{display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"},variants:{background:{foreground:{backgroundColor:"surface.foreground"}}}});function Nw({background:e,children:t}){return I("div",{className:Sw({background:e}),children:t})}const Pw=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function Mw(e){return void 0!==Pw[e]}function Rw(e){return Pw[e]}const Dw=wo(e=>p.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},p.createElement("defs",null,p.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),p.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),p.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),Lw=Dt({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function Ow({cldrShortName:e}){return I("div",{className:Lw,children:Rw(e)})}const Fw=Bt({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),Bw=Dt({display:"flex",gap:"4px",backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",padding:"4px 8px",alignItems:"center",justifyContent:"center",scrollbar:"hidden",overflow:"hidden"});function Vw({reactions:e,type:t,handleClick:n}){return I("div",{className:Bw,children:e.map((e,r)=>I("button",{className:Fw({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:I(Ow,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const Uw=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:fo(n)};return await Lr(o)},Ww=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:fo(n)};return await async function(e){return Zg(e)}(o)};function Hw(e,t,n){return An(ji({id:e}),t,n)}async function qw(e){const t=ji({id:e});return Cr("mutation successful, invalidating messages queries"),Bn.invalidateQueries({queryKey:t}).catch(e=>wr({error:e,severity:"error"}))}function jw(e,t,n){const r=[...e];return r[n]=t,r}const zw=Dt({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),Kw=Object.keys(Pw).filter(Mw).map(e=>({emojiCode:e,authorInfo:[]}));function Yw({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=b(cs),{mutate:l}=function(e){const{userId:t,userEmail:n}=b(cs);return Cd({mutationFn:Uw,onMutateFn:({data:r,accessToken:a,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a,userEmail:o}){const i=Hw(n,t,r);await Bn.cancelQueries({queryKey:i});const l=Bn.getQueryData(i);return Bn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:jw(t,(r=t[n],i=e,l=a,s=o,{...r,reactions:[...r.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),n);var r,i,l,s}),{oldMessages:l}}({data:r,accessToken:a,conversationId:e,environment:o,userId:t,userEmail:n})},onSettled:()=>qw(e)})}(e);return N(Bl,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[I(Ul,{children:e=>I("button",{className:zw,...e,children:I(Vc,{Component:Dw})})}),I(Gl,{type:"reaction",children:I(Vw,{reactions:Kw,type:n,handleClick:e=>{r.some(t=>{const n=t.emojiCode===e,r=t.authorInfo.some(e=>e.userId===i);return n&&r})||(l({id:t,emojiCode:e}),o(!1))}})})]})}const _w=Bt({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function Zw({reactions:e,type:t,handleClick:n}){const r=_w({type:t});return I("div",{className:r,children:I(Vw,{reactions:e,handleClick:n,type:t})})}const Gw=Bt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),Qw=Bt({base:{position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"column",alignItems:"flex-start",borderRadius:"md",borderWidth:1,borderStyle:"solid",flexShrink:1,overflow:"wrap",wordBreak:"break-word",whiteSpace:"pre-wrap"},variants:{type:{sent:{color:"typography.intent.primary",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary"},received:{color:"typography.base",borderColor:"border.layout",backgroundColor:"surface.foreground"}}}}),Xw=Dt({position:"relative",display:"flex",flexDirection:"column"});function Jw({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=g(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=y(!1),[r,a]=y(!1);return k(()=>{if(null===o.current||!i||s)return;const e=o.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,o=e,s=r,l=n]),{isHover:t,reactionIsOpen:r,setIsHover:n,setReactionIsOpen:a};var o,i,l,s}(o),{mutate:d}=function(e){const{userId:t}=b(cs);return Cd({mutationFn:Ww,onMutateFn:({data:n,accessToken:r,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a}){const o=Hw(n,t,r);await Bn.cancelQueries({queryKey:o});const i=Bn.getQueryData(o);return Bn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return Sn(r)||0===r.reactions.length?t:jw(t,function(e,t,n){const r=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===n));return{...e,reactions:r}}(r,e.emojiCode,a),n)}),{oldMessages:i}}({data:n,accessToken:r,conversationId:e,environment:a,userId:t})},onSettled:()=>qw(e)})}(e),u=n?"sent":"received",h=a.filter(e=>Mw(e.emojiCode)),p=h.length>0;return N("div",{className:Gw({type:u,hasReactionsOnMessage:p}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[N("div",{className:Xw,children:[I("div",{className:Qw({type:u}),children:r}),p&&I(Zw,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&I(Yw,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const $w=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),p.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),p.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),eE=Bt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),tE=Dt({position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"12px",borderRadius:"md",borderWidth:1,borderStyle:"solid",borderColor:"border.layout",backgroundColor:"surface.foreground",flexShrink:1}),nE=Dt({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),rE=Dt({textDecoration:"none",color:"inherit",cursor:"pointer"});function aE({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:a}=t,o=Mf();return I("div",{className:eE({type:e?"sent":"received"}),children:I("div",{onClick:async()=>{if(o)window.open(a,"_self","noopener,noreferrer");else try{if(a){const e=await fetch(a),t=await e.blob(),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n??"attachment",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}}catch(e){await wr({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(a,"_blank","noopener,noreferrer")}},className:rE,children:N("div",{className:tE,children:[N("div",{className:nE,children:[I(xl,{children:n}),I(xa,{children:`${r}`})]}),I(Vc,{Component:$w})]})})})}const oE=Kt(null,Dt({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function iE({children:e}){return I("div",{...oE,children:e})}const lE=Kt(null,Dt({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),sE=Dt({minHeight:1,width:"100%"}),cE=C(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=g(null);t&&r?.current?.focus();const i=x(()=>{t&&Nn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){k(()=>{const r=e.current;if(null!==r){let e=r.scrollTop,a=Date.now();const o=()=>{if(t){const{scrollVelocity:t,currentScrollTop:o,currentTime:i}=function(e,t,n){const r=e.scrollTop,a=Date.now(),o=Math.abs(r-t),i=a-n;return{scrollVelocity:i>0?o/i:0,currentScrollTop:r,currentTime:a}}(r,e,a);t>5&&n(),e=o,a=i}};return r.addEventListener("scroll",o),()=>{r.removeEventListener("scroll",o)}}},[t,n,e])}(o,t,i),N("div",{tabIndex:-1,...lE,ref:o,children:[I("div",{className:sE,ref:a}),e]})}),dE=Object.freeze({message:{text:"",attachments:[]}});function uE(e){const t=0==e?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}const hE=Dt({display:"flex",flex:"1 1 0",flexDirection:"row",justifyContent:"space-between",backgroundColor:"surface.foreground",borderWidth:"1px",borderStyle:"solid",borderColor:"border.layout",padding:"8px 16px",marginBottom:"8px"}),pE=Dt({display:"flex",flexDirection:"row",gap:"8px"}),gE=Dt({display:"grid",flexDirection:"column"});function mE({attachment:e,onRemove:t}){const n=(r=e).isPending?{text:"Uploading...",accent:"active"}:null===r.id?{text:"Failed to upload. Try uploading again.",intent:"danger"}:{text:uE(r.size)};var r;return N("div",{className:hE,children:[N("div",{className:pE,children:[I(Vc,{Component:us}),N("div",{className:gE,children:[I(xl,{children:e.name}),I(xa,{intent:n.intent,accent:n.accent,children:n.text})]})]}),!e.isPending&&I(ns,{onClick:()=>t(e),children:I(Mo,{Component:Wl})})]})}const vE=Dt({width:"100%"});function bE({conversationId:e,addMessage:t,blockSubmit:n,isMobile:r,scrollRef:a,setActiveKeyboard:o,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:fg({defaultValues:t??dE,onSubmit:t=>{Ou.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=g(null),d=x(e=>{s.setFieldValue("message",t=>({...t,attachments:[...t.attachments,...e.map(e=>({localId:e.localId,name:e.name,size:e.size,id:null,isPending:!0}))]}))},[s]),u=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.map(t=>e.find(e=>e.localId===t.localId)||t)}))},[s]),{mutate:h}=Cd({mutationFn:Mu,onSuccess:async()=>Bn.invalidateQueries({queryKey:["files/attachments"]})}),p=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.filter(t=>t.localId!==e.localId)})),null!==e.id&&h({id:e.id})},[s,h]);return I("form",{className:vE,ref:c,onKeyDown:e=>function(e,t,n,r){if(!r&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!n)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,n,r),onSubmit:e=>{if(!n)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:I(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>N(S,{children:[e.map(e=>I(mE,{attachment:e,onRemove:p},e.localId)),I(s.AppField,{name:"message",children:t=>I(t.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function fE(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text??"",reactions:[],attachments:[]}}async function yE(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return Cr("mutation successful, invalidating messages queries"),Promise.all([Bn.invalidateQueries({queryKey:e}),Bn.invalidateQueries({queryKey:t}),Bn.invalidateQueries({queryKey:n})]).catch(e=>wr({error:e,severity:"error"}))}const xE=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>li({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),kE=async({data:e,accessToken:t,environment:n})=>li({data:{data:[e]},accessToken:t,environment:n}),TE=Dt({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),CE=Dt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),wE=Dt({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),EE="Marked As Resolved";function AE({resolver:e}){const t=e?`${e} ${EE}`:EE;return N("div",{className:CE,children:[I("div",{className:TE}),I("div",{className:wE,children:t}),I("div",{className:TE})]})}const IE=Bt({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function SE({width:e="md",height:t="md"}){return I(Ya,{styles:IE({width:e,height:t})})}const NE=Dt({display:"flex",flexDirection:"row-reverse"});function PE(){return N(S,{children:[I(SE,{width:"lg",height:"lg"}),I("div",{className:NE,children:I(SE,{width:"md",height:"lg"})}),I("div",{className:NE,children:I(SE,{width:"lg",height:"xl"})}),I(SE,{width:"md",height:"lg"})]})}const ME=Dt({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function RE({isConversationLoading:e,isFilling:t,message:n}){return e?n?I(iE,{children:I(Jw,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?I(iE,{children:I(PE,{})}):N("div",{className:ME,children:[I(fa,{textAlign:"center",wrap:"wrap",children:"Send your bookkeeper a message"}),I(xl,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const DE=Kt(null,Dt({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",flexDirection:"column",position:"relative",backgroundColor:"surface.background",borderTop:"{borderWidths.lg} solid",borderTopColor:"border.layout",padding:"12px 15px"}));function LE({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=b(cs),{mutate:s}=function(){const{userId:e}=b(cs);return Cd({mutationFn:Yi,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=An(ji({id:e.conversationId}),t,n);await Bn.cancelQueries({queryKey:a});const o=Bn.getQueryData(a);return Bn.setQueryData(a,t=>[fE(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:yE})}(),{query:{data:c},isFilling:d}=function(e){const t=Nn(e);return Wn({queryKey:ji({id:e??""}),queryFn:Ki,select:zi,enabled:t})}(e),{mutate:u,isPending:h,variables:p}=(C=t,w=o,Cd({mutationFn:kE,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(Sn(e)||Sn(t))return;C(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(Nn(w)){const e={id:w};Wi(w,Ui.BANK_TRANSACTION)?o=async()=>{const t=Di(e);return await Bn.invalidateQueries({queryKey:t})}:Wi(w,Ui.FINANCIAL_SUMMARY)&&(i=async()=>await Bn.invalidateQueries({queryKey:a}))}return Cr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([Bn.invalidateQueries({queryKey:n}),Bn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>wr({error:e,severity:"error"}))}})),{mutate:m}=Cd({mutationFn:xE,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return Cr("mutation successful, invalidating conversations queries"),Promise.all([Bn.invalidateQueries({queryKey:e}),Bn.invalidateQueries({queryKey:t})]).catch(e=>wr({error:e,severity:"error"}))}}),[v,f]=y(!1),x=g(null),T=g(null);var C,w;k(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),k(()=>{Nu(T)},[c,T]);const E=Sn(e)||Sn(c)||d;return N(S,{children:[E?I(cE,{ref:T,inputRef:x,activeKeyboard:v,setActiveKeyboard:f,children:I(RE,{isConversationLoading:h,isFilling:d,message:p?.message?.text})}):N(cE,{ref:T,activeKeyboard:v,setActiveKeyboard:f,inputRef:x,children:[n&&I(AE,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return I(iE,{children:t.map(t=>N(S,{children:[t.attachments.filter(e=>!Sn(e)).map(e=>I(aE,{sentByCurrentUser:r,attachment:e},e?.id)),t.text&&I(Jw,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),I("div",{...DE,children:I(bE,{scrollRef:T,inputRef:x,conversationId:e,blockSubmit:h,isMobile:a,addMessage:({value:t})=>{const{text:n,attachments:r}=t.message,a=n.trim(),i=r.filter(e=>null!==e.id&&!e.isPending),l=i.map(e=>`att_${e.id}`),c=a.length>0,d=l.length>0;if(c||d)if(Sn(e)){let e="";const t=40;if(c){const t=40;e=a.slice(0,t)}else d&&(e=i[0].name?.slice(0,t));const n=(h=a,p=l,{subject:e,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Nn(g=o)&&{attachedEntityId:g},message:{text:h,...p.length>0&&{attachmentIds:p}}});u(n)}else s({conversationId:e,text:a,...d&&{attachmentIds:l}});var h,p,g},setActiveKeyboard:f,defaultValues:i})})]})}function OE({conversationId:e,attachedEntityId:t}){const[n,r]=y(e),{query:{data:a}}=ii(n),o="CLOSED"===a?.resolutionStatus;return N(Nw,{children:[I(Xk,{}),I(LE,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const FE=Kt(Ut["form-body"],Dt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",minWidth:{base:0,sm:"512px"}}));function BE({children:e}){return I("div",{...FE,children:e})}function VE({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:a}){return I(ns,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:a,children:I(Ps,{Component:t})})}function UE({activeTab:e,onClick:t,popupTriggerProps:n}){return I(VE,{active:"conversation"===e,onClick:()=>t("conversation"),icon:Ys,ariaLabel:"conversation-tab",popupTriggerProps:n})}const WE=Dt({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function HE({conversationId:e,attachedEntityId:t}){const n=Vl(),[r,a]=y(e),{query:{data:o}}=ii(r),i="CLOSED"===o?.resolutionStatus;return I(fx,{children:N("div",{className:WE,children:[I(Xk,{children:N($k,{children:[I(nT,{Icon:Eo,handleClose:()=>n.setOpen(!1)}),I(fa,{children:"Back"})]})}),I(LE,{conversationId:r,setConversationId:a,isResolved:i,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})})}const qE=Kt(null,Dt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),jE=Kt(null,Dt({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),zE=Dt({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),KE=e=>{eu(e),tu(e)},YE=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const i=Mf(),[l,s]=y(r??null),c=e=>s(e===l?null:e);return I(Ew,{children:N("div",{...qE,children:[I(Nw,{children:N("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:KE,...jE,children:[n,I(BE,{children:e})]})}),null!==l&&I("div",{className:zE}),"conversation"===l&&I(OE,{conversationId:a,attachedEntityId:o}),I(Iw,{children:i?N(Bl,{children:[I(Ul,{children:e=>I(UE,{onClick:c,activeTab:l,popupTriggerProps:e})}),I(HE,{conversationId:a,attachedEntityId:o})]}):I(UE,{onClick:c,activeTab:l})})]})})},_E=Kt(null,Dt({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function ZE({transaction:e,bankAccount:t}){const n=e?e.description:"",r=Sn(t)||Sn(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=Dd(t.amount);return`${n?`${r} `:""}${hd(e.name,e.mask)}`})(t,e);return N("div",{..._E,children:[I(fa,{wrap:"wrap",children:n}),t&&I(xa,{children:r})]})}function GE({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=Vl();return N(dh,{onClick:()=>{r&&a.close(),t()},children:[n&&I(Vc,{Component:n}),I(fa,{children:e})]})}function QE({transaction:e}){const{mutate:t}=Lv(),n=()=>t(hv([e]));return I(GE,{onClick:()=>{return e=n,void cd({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:$c,label:"Cancel"},{key:ed,label:"Delete",type:sd}]}).then(t=>{t===ed&&e()});var e},children:"Delete"})}function XE({transaction:e}){const{mutate:t}=Lv();return I(GE,{onClick:()=>{t([e].map(e=>({id:e.id,status:dv.ACTIVE})))},children:"Restore"})}const JE=yg({defaultValues:Fv,render:function({form:e}){return I(GE,{onClick:()=>{or()},closeOnClick:!0,children:"Attach Bill(s)"})}}),$E=yg({defaultValues:Fv,render:function({form:e}){return I(GE,{onClick:()=>{or()},closeOnClick:!0,children:"Attach Payroll"})}}),eA=yg({defaultValues:Fv,render:function({form:e}){return I(GE,{onClick:()=>{or()},Icon:Bf,closeOnClick:!0,children:"Attach Invoice(s)"})}}),tA=Ni.filter(e=>"ONE_TIME"!=e.value);function nA({onClick:e}){const t=Vl();return I(Yh,{triggerChildren:I(Zh,{displayLabel:"Make recurring"}),popupChildren:I(bg,{frequencies:tA,onClick:n=>{e(n),t.close()}})})}const rA=yg({defaultValues:Fv,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=Ye(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Ne(),o=!Sn(n)&&Zu(n)&&"EXPENSE"===n.type;return N(Xk,{children:[N($k,{children:[I(nT,{}),I(fa,{children:t}),I(gT,{children:N(rh,{children:[n?.status===dv.ACTIVE&&I(QE,{transaction:n}),n?.status===dv.INACTIVE&&I(XE,{transaction:n}),r&&N(S,{children:["EXPENSE"===n?.type&&I(JE,{form:e}),"EXPENSE"===n?.type&&I($E,{form:e}),"REVENUE"===n?.type&&I(eA,{form:e})]}),o&&I(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return a&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&I(nA,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]}),I(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:I(e.SaveButton,{})})]})}}),aA=[{value:"EXPENSE",label:"Expense"},{value:"REVENUE",label:"Income"},{value:"TAX_PAYMENT",label:"Tax Pmt"},{value:"BANK_TRANSFER",label:"Transfer"}],oA=Bt({base:{display:"flex",flexDirection:"column",position:"fixed",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",width:{base:"100%",sm:"562px"},minWidth:{base:"100%",sm:"fit-content"},backgroundColor:"surface.background"},variants:{status:{unmounted:{},initial:{animation:"slideIn.right"},open:{animation:"slideIn.right"},close:{animation:"slideOut.right"}}},defaultVariants:{status:"unmounted"}}),iA=Dt({display:"flex",padding:"16px 16px 45px 16px",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"});function lA({children:e,title:t}){const n=Vl(),{isMounted:r,status:a}=function(e){const{isMounted:t,status:n}=ve(e,{duration:300});return{isMounted:t,status:n}}(n.context),o=x(e=>{e.stopPropagation()},[]);return r?I(fx,{fadeIn:!1,forceMount:!0,children:N("div",{className:oA({status:a}),onAnimationEnd:o,children:[I(Xk,{children:N($k,{children:[I(nT,{Icon:Eo,handleClose:n.close}),I(fa,{children:t})]})}),I("div",{className:iA,children:e})]})}):null}const sA=Dt({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"});function cA({text:e,handleClick:t,LeftIcon:n,RightIcon:r,popupTriggerChildrenProps:a}){return I(hl,{onClick:t,stylists:[Ll],popupTriggerProps:a,children:N("div",{className:sA,children:[N("div",{className:sA,children:[n&&I(Vc,{Component:n}),I(fa,{wrap:"wrap",children:e})]}),r&&I(Vc,{Component:r})]})})}const dA=Dt({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function uA({children:e}){return I("div",{className:dA,children:e})}const hA=Dt({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function pA(){return I(Ya,{styles:Ot(Dl,hA)})}const gA=Dt({width:"70px",height:"24px"}),mA=Dt({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function vA(){return N("div",{className:mA,children:[I(Ya,{styles:gA}),N(uA,{children:[I(pA,{}),I(pA,{}),I(pA,{})]}),I(Ya,{styles:gA}),N(uA,{children:[I(pA,{}),I(pA,{}),I(pA,{})]})]})}function bA({title:e,category:t,onClick:n,currentCategory:r}){return N(Bl,{children:[I(Ul,{children:e=>I(cA,{text:t.name??"",LeftIcon:ip(t.name),RightIcon:Ao,popupTriggerChildrenProps:e},t.id)}),I(lA,{title:e,children:I(DA,{listLabel:t.name??"",onClick:n,nestedCategories:t.children??[],type:"EXPENSE",currentCategory:r})})]})}function fA({onClick:e,showSuggestedCategories:t,listLabel:n,categories:r,isFilling:a,currentCategory:o}){const i=Pe();return a?I(vA,{}):N(uA,{children:[i&&t&&I(fa,{children:"Suggested"}),I(fa,{children:n}),I("div",{children:r?.map(t=>t.hasChilds?I(bA,{title:"All Categories",category:t,onClick:e,currentCategory:o},t.id):I(cA,{text:t.name??"",handleClick:()=>e(t),LeftIcon:ip(t.name),RightIcon:o?.id===t.id?Bb:void 0},t.id))})]})}function yA(e){const t={};for(const{parent:n,child:r}of e){const e=n.id;n.id===r.id?t[e]={parent:n,children:[]}:t[e]?t[e].children.push(r):t[e]={parent:n,children:[r]}}return t}const xA=Dt({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function kA({singularSearchCTANoun:e,pluralNounNotFound:t,showSearchCTA:n}){return N("div",{className:xA,children:[I(Vc,{Component:Ux}),I(fa,{wrap:"wrap",children:`No ${t} found`}),n&&I(xa,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}const TA=Dt({display:"flex",flexDirection:"column",gap:"16px"}),CA=Dt({display:"flex",flexDirection:"column",gap:"8px"});function wA({searchTerm:e,onClick:t,categories:n,isFilling:r,currentCategory:a}){const o=m(()=>Oe(n),[n]),i=m(()=>Dh(o),[o]),l=m(()=>new Ce(i??[],Uh),[i]),s=m(()=>i?yA(Hh(l.search(e),i)):{},[i,e,l]);return r?I(vA,{}):0===Object.keys(s).length?I(kA,{singularSearchCTANoun:"category",pluralNounNotFound:"categories",showSearchCTA:!0}):I(uA,{children:I("div",{className:TA,children:Object.entries(s).map(([e,{parent:n,children:r}])=>{const o=r.length>0;return N("div",{className:CA,children:[o&&I(fa,{children:n.name}),I("div",{children:o?r.map(e=>I(cA,{text:e.name??"",handleClick:()=>t(e),LeftIcon:ip(e.name),RightIcon:a?.id===e.id?Bb:void 0},e.id)):I(cA,{text:n.name??"",handleClick:()=>t(n),LeftIcon:ip(n.name),RightIcon:a?.id===n.id?Bb:void 0},e)})]},e)})})})}const EA=Dt({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),AA=Dt({display:"flex",padding:"16px",flexDirection:"row",alignItems:"center",gap:"8px",flex:"1 0 0",borderRadius:"sm",border:"1px solid {colors.border.layout}",backgroundColor:"surface.foreground",maxHeight:"49px",minWidth:"fit-content"}),IA=Ot(Dt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),Xt({label:"strongLabel"})),SA=Kt(null,Dt({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function NA({searchTerm:e,setSearchTerm:t,placeholder:n}){return N("div",{className:EA,children:[I(fa,{children:"Search"}),N("div",{className:AA,children:[I(Vc,{Component:nx}),I("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:IA}),Rn(e)&&I(hl,{stylists:[SA],onClick:()=>t(""),children:I(Vc,{Component:Wl})})]})]})}function PA({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o}){const[i,l]=y("");return I(ah,{searchTerm:i,setSearchTerm:l,onClick:t=>{e?.(t)},placeholder:t,SearchInput:NA,SearchList:n,DefaultList:r,extraProps:a,listLength:o})}const MA="Search expense categories...",RA=[];function DA({listLabel:e="All Expense Categories",onClick:t,showSuggestedCategories:n,nestedCategories:r,currentCategory:a}){const{query:{data:o,isFetched:i},isFilling:l}=Mh(),s=r??o?.data??RA,c=Vl();return I(PA,{placeholder:MA,onClick:e=>{t(e),c.close()},SearchList:wA,DefaultList:fA,listLength:s.length,extraProps:{categories:s,listLabel:e,isFetched:!!Sn(r)&&i,isFilling:!!Sn(r)&&l,showSuggestedCategories:n,currentCategory:a}})}function LA({title:e,glAccount:t,onClick:n,currentGlAccount:r}){return N(Bl,{children:[I(Ul,{children:e=>I(cA,{text:Qv(t.accountNo,t.name),RightIcon:Ao,popupTriggerChildrenProps:e},t.id)}),I(lA,{title:e,children:I(HA,{headerLabel:e,listLabel:Qv(t.accountNo,t.name),nestedGlAccounts:t.children,parentAccount:t,onClick:n,type:"REVENUE",currentGlAccount:r})})]})}function OA({onClick:e,showSuggestedCategories:t,glAccounts:n,listLabel:r,isFilling:a,currentGlAccount:o}){const i=Pe(),l=kp([...n],xp);return a?I(vA,{}):N(uA,{children:[i&&t&&I(fa,{children:"Suggested"}),I(fa,{children:r}),I("div",{children:l?.map(t=>t.hasChilds?I(LA,{glAccount:t,title:"All Categories",onClick:e,currentGlAccount:o},t.id):I(cA,{text:Qv(t.accountNo,t.name),handleClick:()=>e(t),RightIcon:o?.id===t.id?Bb:void 0},t.id))})]})}const FA=Dt({display:"flex",flexDirection:"column",gap:"16px"}),BA=Dt({display:"flex",flexDirection:"column",gap:"8px"});function VA({searchTerm:e,onClick:t,glAccounts:n,isFilling:r,parentAccount:a,currentGlAccount:o}){const i=m(()=>n.flatMap(e=>[e,...e.children]),[n]),l=m(()=>a?[a,...i]:i,[a,i]),s=kp(i,xp),c=m(()=>new Ce(s,pb),[s]),d=m(()=>yA(mb(c.search(e),l)),[l,e,c]);return r?I(vA,{}):0===Object.keys(d).length?I(kA,{singularSearchCTANoun:"category",pluralNounNotFound:"income categories",showSearchCTA:!0}):I(uA,{children:I("div",{className:FA,children:Object.entries(d).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return N("div",{className:BA,children:[a&&I(fa,{children:Qv(n.accountNo,n.name)}),I("div",{children:a?r.map(e=>I(cA,{text:Qv(e.accountNo,e.name),handleClick:()=>t(e),RightIcon:o?.id===e.id?Bb:void 0},e.id)):I(cA,{text:Qv(n.accountNo,n.name),handleClick:()=>t(n),RightIcon:o?.id===n.id?Bb:void 0},e)})]},e)})})})}const UA="Search income categories...",WA=[];function HA({listLabel:e="All Income Categories",onClick:t,showSuggestedCategories:n,nestedGlAccounts:r,parentAccount:a,currentGlAccount:o}){const{query:{data:i,isFetched:l},isFilling:s}=pp(),c=r??i??WA,d=Vl();return I(PA,{placeholder:UA,onClick:e=>{t(e),d.close()},SearchList:VA,DefaultList:OA,listLength:c.length,extraProps:{glAccounts:c,listLabel:e,isFetched:l,isFilling:s,showSuggestedCategories:n,parentAccount:a,currentGlAccount:o}})}function qA({onClick:e,showSuggestedCategories:t,currentRegion:n}){const r=Pe(),a=Vl();return N(uA,{children:[r&&t&&I(fa,{children:"Suggested"}),I(fa,{children:"All Tax Categories"}),I("div",{children:Iv.map(t=>I(cA,{text:t.label,handleClick:()=>(e(t.value),void a.close()),RightIcon:n===t.value?Bb:void 0},t.value))})]})}function jA({onClick:e,onNeedsMatchClick:t,showSuggestedCategories:n,bankTransfers:r,holdingAccount:a,listLabel:o,isFetched:i,isFilling:l,currentTransfer:s}){const c=Pe(),d=!l&&i&&0===r.length;return l?I(vA,{}):N(uA,{children:[a&&I(cA,{text:"Needs Match",handleClick:t}),c&&n&&I(fa,{children:"Suggested"}),!d&&N(S,{children:[I(fa,{children:o}),I("div",{children:r?.map(t=>I(cA,{text:Gu(t),handleClick:()=>e(t),RightIcon:s?.id===t.id?Bb:void 0},t.id))})]})]})}const zA={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function KA({searchTerm:e,onClick:t,bankTransfers:n,isFilling:r,currentTransfer:a}){const o=m(()=>new Ce(n??[],zA),[n]),i=m(()=>n?o.search(e).map(e=>e.item):[],[n,e,o]);return r?I(vA,{}):0===i.length?I(kA,{singularSearchCTANoun:"matching bank transaction",pluralNounNotFound:"matching bank transactions",showSearchCTA:!0}):I(uA,{children:I("div",{children:i.map(e=>I(cA,{text:Gu(e),handleClick:()=>t(e),RightIcon:a?.id===e.id?Bb:void 0},e.id))})})}const YA=[];function _A({listLabel:e="All Matching Bank Transactions",onClick:t,showSuggestedCategories:n,transactionId:r,transactionAmount:a,transactionDate:o,currentTransfer:i}){const{query:{data:l,isFetched:s},isFilling:c}=Oi(function(e,t,n){const r=fn(n);if(!r)throw new Error(`Invalid date string: ${n}`);return{filter:{status:{in:["ACTIVE"]},type:{in:["BANK_TRANSFER",t>0?"EXPENSE":"REVENUE"]},amount:{equal:-t},date:{greaterThanEqual:yn(En(r,-3)),lessThanEqual:yn(En(r,3))},bankAccount:{id:{notIn:[e]}},matchingBankTransaction:{id:{equal:null}}}}}(r,a,o)),d=l?.data??YA,{query:{data:u}}=hp({select:e=>e.find(e=>"CLEARING_ACCOUNT"===e.assetType)}),h=Vl();return I(PA,{placeholder:"Search matching bank transfers...",onClick:e=>{t({transfer:e}),h.close()},SearchList:KA,DefaultList:jA,listLength:d.length??0,extraProps:{listLabel:e,bankTransfers:d,isFetched:s,isFilling:c,holdingAccount:u,showSuggestedCategories:n,transactionDate:o,onNeedsMatchClick:()=>{u&&t({glAccount:u}),h.close()},currentTransfer:i}})}const ZA=yg({defaultValues:Fv,props:{},render:function({form:e,...t}){const{transactionType:n,onExpenseClick:r,onRevenueClick:a,onTaxPaymentClick:o,onBankTransferClick:i,transaction:l}=t;switch(n){case"EXPENSE":return I(e.Subscribe,{selector:e=>e.values.category,children:e=>I(DA,{...t,type:"EXPENSE",onClick:r,currentCategory:e})});case"REVENUE":return I(e.Subscribe,{selector:e=>e.values.glAccount,children:e=>I(HA,{...t,type:"REVENUE",onClick:a,currentGlAccount:e})});case"TAX_PAYMENT":return I(e.Subscribe,{selector:e=>e.values.tax?.paymentInfo?.region,children:e=>I(qA,{...t,type:"TAX_PAYMENT",onClick:o,currentRegion:e})});case"BANK_TRANSFER":return I(e.Subscribe,{selector:e=>e.values.matchingBankTransaction,children:n=>I(_A,{...t,type:"BANK_TRANSFER",onClick:i,transaction:l,transactionId:l?.id??e.store.state.values.id,transactionAmount:l?.amount??0,transactionDate:l?.date??e.store.state.values.date,currentTransfer:n})})}}}),GA=yg({defaultValues:Fv,props:{},render:function({form:e,...t}){const{headerLabel:n="Back",initialType:r}=t,[a,o]=y(r);return N(lA,{title:n,children:[I(Ap,{rows:1,cols:4,options:aA,handleClick:e=>o(e.value),selected:(i=a,aA.find(e=>e.value===i))}),I(ZA,{form:e,transactionType:a,onExpenseClick:t=>{e.setFieldValue("category",t),e.setFieldValue("type","EXPENSE")},onRevenueClick:t=>{e.setFieldValue("glAccount",t),e.setFieldValue("type","REVENUE")},onTaxPaymentClick:t=>{e.setFieldValue("tax.paymentInfo.region",t),e.setFieldValue("type","TAX_PAYMENT")},onBankTransferClick:({transfer:t,glAccount:n})=>{Nn(t)&&e.setFieldValue("matchingBankTransaction",t),Nn(n)&&(e.setFieldValue("glAccount",n),e.setFieldValue("reviewStatus","RECONCILIATION_AWAITING")),e.setFieldValue("type","BANK_TRANSFER")},...t})]});var i}}),QA=Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),XA=Dt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),JA=yg({defaultValues:Fv,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(e.AppField,{name:"category",children:e=>I(su,{label:"Category",popupTriggerProps:t,children:N("button",{className:QA,type:"button",children:[N("div",{className:XA,children:[I(Vc,{Component:ip(e.store.state.value?.name)}),I(fa,{wrap:"wrap",children:e.store.state.value?.name||"Uncategorized"})]}),I(Vc,{Component:Ao})]})})})}),I(GA,{initialType:"EXPENSE",form:e,transaction:t})]})}}),$A=yg({defaultValues:Fv,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=Ne();return N(S,{children:[I(e.AppField,{name:"vendor",children:e=>I(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),I(e.AppField,{name:"customer",children:e=>I(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),I(e.Subscribe,{selector:e=>e.values.frequency,children:a=>{return r&&n&&(o=t.type,void 0!==(i=a)&&"ONE_TIME"!==i.value&&"EXPENSE"===o)&&I(e.AppField,{name:"frequency",children:e=>I(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var o,i}}),I(JA,{form:e,transaction:t}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),eI=Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),tI=yg({defaultValues:Fv,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(e.AppField,{name:"glAccount",children:e=>{const n=e.state.value;return I(su,{label:"Account",popupTriggerProps:t,children:N("button",{className:eI,type:"button",children:[I(fa,{children:Qv(n.accountNo,n.name)}),I(Vc,{Component:Ao})]})})}})}),I(GA,{initialType:"REVENUE",form:e,transaction:t})]})}}),nI=yg({defaultValues:Fv,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return N(S,{children:[I(e.AppField,{name:"customer",children:e=>I(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),I(tI,{form:e,transaction:t}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),rI=Kt(null,Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"})),aI=Kt(null,Dt({color:"typography.base.weak"})),oI=yg({defaultValues:Fv,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(e.AppField,{name:"matchingBankTransaction",children:e=>{const n=e.state.value,r=n?Gu(n):"Select",a=n?[]:[aI];return I(su,{label:"Matching Bank Transfer",popupTriggerProps:t,children:N("button",{...rI,children:[I(fa,{stylists:a,children:r}),I(Vc,{Component:Ao,stylists:a})]})})}})}),I(GA,{initialType:"BANK_TRANSFER",form:e,transaction:t})]})}}),iI=yg({defaultValues:Fv,props:{transaction:{}},render:function({form:e,transaction:t}){return N(S,{children:[I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})}),I(e.AppField,{name:"glAccount",children:e=>I(e.BankGlAccountField,{transaction:t})}),I(oI,{form:e,transaction:t})]})}}),lI=Dt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),sI=yg({defaultValues:Fv,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Ul,{children:t=>I(e.AppField,{name:"tax.paymentInfo.region",children:e=>I(su,{label:"Category",popupTriggerProps:t,children:N("button",{className:lI,type:"button",children:[I(fa,{children:Sv(e.state.value)??"Select region..."}),I(Vc,{Component:Ao})]})})})}),I(GA,{initialType:"TAX_PAYMENT",form:e,transaction:t})]})}}),cI=yg({defaultValues:Fv,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return N(S,{children:[I(sI,{form:e,transaction:t}),I(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>I(e.ButtonGroupField,{label:"Quarter",options:Ev})}),I(e.AppField,{name:"tax.paymentInfo.year",children:e=>I(e.GenericSelectorField,{label:"Year",options:un({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),dI=Dt({display:"flex",flexDirection:"column",gap:"8px"}),uI=yg({defaultValues:Fv,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const{startPrefetch:r,cancelPrefetch:a}=Oh();return I("div",{className:dI,onMouseEnter:r,onMouseLeave:a,children:I(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return I($A,{form:e,transaction:t,isManual:n});case"REVENUE":return I(nI,{form:e,transaction:t,isManual:n});case"BANK_TRANSFER":return I(iI,{form:e,transaction:t});case"TAX_PAYMENT":return I(cI,{form:e,transaction:t,isManual:n});default:return null}}})})}}),hI={EXPENSE:"Expense",REVENUE:"Income",BANK_TRANSFER:"Bank Transfer",TAX_PAYMENT:"Tax Payment",INVOICE_PAYMENT:"Invoice Payment",PAYOUT:"Payout",PAYROLL_PAYMENT:"Payroll Payment",BILL_PAYMENT:"Bill Payment",LOAN_PAYMENT:"Loan Payment"};function pI({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:a,transactionId:o,initialTab:i,currentType:l}){const s=I(rA,{form:t,transaction:e,title:hI[l]});return N(YE,{onSubmit:t.handleSubmit,Header:s,initialTab:i,conversationId:a,transactionId:o,children:[e.description&&I(ZE,{transaction:e,bankAccount:n}),I(t.AppField,{name:"amount",children:e=>I(r?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),I(t.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),I(uI,{form:t,transaction:e,isManual:r}),I(t.AppField,{name:"notes",children:e=>I(e.TextAreaInput,{label:"Note"})}),I(t.AppField,{name:"type",children:()=>null})]})}function gI({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=Vv({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return I(r.Subscribe,{selector:e=>e.values.type,children:i=>I(pI,{transaction:n,form:r,bankAccount:a,isManual:o,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function mI({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=Bi({id:e});return k(()=>{!r&&Sn(n)&&Ai()},[n,r]),Sn(n)?null:I(gI,{transactionId:e,initialTab:t})}const vI={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},bI=(e={})=>{const t=wt(vI,e);return vI.transform(t,Ct)},fI=e=>Dt(bI(e));fI.raw=bI;const yI={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},xI=(e={})=>{const t=wt(yI,e);return yI.transform(t,Ct)},kI=e=>Dt(xI(e));function TI({subject:e,children:t}){return N(Xk,{children:[N($k,{children:[I(nT,{}),I(fa,{children:e})]}),I("div",{className:kI({alignItems:"center",gap:15}),children:t})]})}function CI({conversationId:e,defaultValues:t}){const[n,r]=y(e),{query:{data:a}}=ii(n),o="CLOSED"===a?.resolutionStatus;return I(Ew,{children:N(Nw,{children:[I(TI,{subject:a?.subject??"Conversation"}),I(LE,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}kI.raw=xI;const wI=wo(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_18201_5557)"},p.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_18201_5557"},p.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function EI({onClick:e,active:t}){return I(hl,{type:"button",onClick:e,active:t,children:I(Vc,{Component:wI})})}const AI=Dt({display:"flex",flexDirection:"column"});function II({label:e,data:t,isFilling:n,shimmerWidth:r}){return N("div",{className:AI,children:[I(xa,{children:e}),n?I(SE,{width:r}):I(fa,{wrap:"wrap",children:t??""})]})}function SI({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=Bi({id:e}),a=Th(n?.bankAccount.id??"");if(Sn(n))return null;const o=fI({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return N("div",{"data-open":t,className:o,children:[N("div",{className:kI({justifyContent:"space-between"}),children:[I(II,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),I(II,{label:"Amount",data:va(Yu(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),I(II,{label:"Bank Account",data:hd(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),I(II,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function NI({conversationId:e,transactionId:t}){const[n,r]=y(e),[a,o]=y(!0),{query:{data:i}}=ii(n),l="CLOSED"===i?.resolutionStatus;return I(Ew,{children:N(Nw,{children:[I(TI,{subject:i?.subject??"Conversation",children:Nn(t)&&I(EI,{onClick:()=>o(!a),active:a},"infoButton")}),Nn(t)&&I(SI,{transactionId:t,isOpen:a}),I(LE,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function PI(){const e=Ye(e=>e.drawerHistory).length>1;return I(Ew,{children:N(Nw,{background:"foreground",children:[I(Xk,{children:N($k,{children:[I(nT,e?{Icon:Eo}:{}),I(fa,{children:"Add New Connection"})]})}),I(JC,{})]})})}function MI(){return I(Xk,{children:N($k,{children:[I(nT,{}),I(fa,{children:"Financial Summary"})]})})}const RI=Dt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),DI=Xt.raw({body:"default"}),LI=Dt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},DI);function OI({summaryText:e}){return I("div",{className:RI,children:I("div",{className:LI,children:e})})}const FI=Dt({display:"flex",flexDirection:"column",overflow:"auto"});function BI({summary:e}){return N("div",{className:FI,children:[I(MI,{}),I(OI,{summaryText:e})]})}const VI=Dt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function UI({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return Wn({queryKey:Gi({id:e}),queryFn:Xi})}({id:e});return I(Ew,{children:N("div",{className:VI,children:[I(Nw,{children:I(BI,{summary:n?.summary})}),I(vi,{}),I(OE,{conversationId:t??null,attachedEntityId:e})]})})}function WI(){return I(Ew,{children:I(Nw,{children:I(cw,{showCloseButton:!0})})})}const HI=h.object({id:h.string(),name:h.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:h.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),type:h.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),qI={mergeDestination:Hp,selectedAccount:null};const jI=Dt({display:"flex",flexDirection:"column",gap:"20px"}),zI=Dt({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),KI=Dt.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),YI=Dt(KI,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),_I=Dt(KI,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),ZI=Dt(KI,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),GI=Dt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),QI=Dt({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),XI=Dt({width:"100%",display:"flex",justifyContent:"flex-start"}),JI=Dt({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),$I=Dt({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),eS=e=>{eu(e),tu(e)};function tS({account:e}){const t=Vl(),n=function(e,t){const{mutateAsync:n}=Nd();return fg({defaultValues:qI,onSubmit:async r=>{if(await Fd()===ed&&Nn(e)&&Nn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===Hp?{...Ld(i),duplicateBankAccountIds:[qi(a.id)]}:{...Ld(a),duplicateBankAccountIds:[qi(i.id)]});try{await n(l),t.close(),r.value.mergeDestination===Hp&&Ai()}catch{await Bd()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=fd();if(!(r&&r.data||a))return null;const o=r?.data?.filter(t=>t.glAccountId&&t.isSupported&&t.id!==e?.id&&t.integration.id!==e?.integration.id);return N("form",{className:jI,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:eS,children:[I(fa,{children:"Merge Accounts"}),I("div",{className:zI,children:I(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>N(S,{children:[N("div",{className:YI,children:[I("div",{className:XI,children:I(fa,{children:"Duplicate Account"})}),t===Hp?I(Bp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):I(n.AppField,{name:"selectedAccount",children:n=>I(jp,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:zp(t,e,n.state.value)})})]}),N("div",{className:_I,children:[I("div",{className:JI,children:I(fa,{children:"Into"})}),I(n.AppField,{name:"mergeDestination",children:e=>I("div",{className:QI,children:I(hl,{onClick:()=>e.handleChange(e.state.value===Hp?Wp:Hp),children:I(Vc,{Component:Ao})})})})]}),N("div",{className:ZI,children:[I("div",{className:$I,children:I(fa,{children:"Destination Account"})}),t===Hp?I(n.AppField,{name:"selectedAccount",children:n=>I(jp,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:zp(t,e,n.state.value)})}):I(Bp,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),N("div",{className:GI,children:[I(kg,{showIcon:!1,onClick:()=>{t.close()}}),I(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>I(jd,{disabled:Sn(e),showIcon:!1,textContent:"Merge"})})]})]})}function nS({bankAccount:e}){return I(rh,{children:N(Bl,{placement:"right-start",modal:!0,children:[I(Ul,{children:e=>N(dh,{...e,children:[I(Vc,{Component:ET}),I(fa,{children:"Merge Account"})]})}),I(fx,{children:I(kx,{children:I(Cx,{children:I(tS,{account:e})})})})]})})}const rS=Dt({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"left",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}}),aS=({tranStartDate:e})=>N(S,{children:[I(xa,{children:"Start Date"}),Rn(e)?I(fa,{children:`${wn(fn(e))}`}):I(fa,{children:"Set Start Date"})]});function oS({bankAccount:e}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Ul,{children:t=>I("button",{className:Ot(rS,So),...t,type:"button",children:I(aS,{tranStartDate:e.tranStartDate})})}),I(fx,{children:I(kx,{children:I(Cx,{width:"sm",children:I(TT,{bankAccounts:[e]})})})})]})}const iS=e=>["accounting/manualJournalEntry",e.id],lS=async e=>{const t=e.queryKey,n=t[2].accessToken,r=t[2].environment,a={path:"/accounting/manualJournalEntry?id={id}",pathParams:{id:t[1]},accessToken:n,environment:r};return await Qo(a)};function sS({id:e}){return Wn({queryKey:iS({id:String(qi(e))}),queryFn:lS,enabled:Nn(e)})}const cS=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/accounting/manualJournalEntry",bodyParams:{manualJournalEntry:e},accessToken:t,endpointManager:Wr(n)};return await Or(r)})({data:e,accessToken:t,environment:n});const dS=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:Wr(n)};return await Or(r)},uS=h.object({amount:h.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:h.string("Required")}),hS=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===qi(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},pS=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=sS({id:t??null}),r=function(){const{query:{data:e}}=gp();return kp(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=Cd({mutationFn:dS,onSuccess:async()=>{Cr("beginning balance mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}}});const{mutate:o}=Cd({onSuccess:async()=>{Cr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([Bn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),Bn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},mutationFn:cS}),i=Vl(),l=((e,t)=>{const n=hS(e,t);return{amount:Nn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Nn(t?.date)?t.date:""}})(e,n);return fg({defaultValues:l,validators:{onBlur:uS},onSubmit:l=>{if(i.close(),Sn(t)||Sn(n))a({bankAccountId:qi(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(Sn(e.id))return null;const o={...e,id:e.id},i=a.map(e=>qi(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===qi(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),Sn(l)?null:(o.transactions?.forEach(e=>{i.includes(e.glAccountId)&&(e.drAmount?e.drAmount=Number(e.drAmount)-l:e.crAmount&&(e.crAmount=Number(e.crAmount)-l))}),o.date=yn(t)??o.date,o)})(n,fn(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Nn(t)&&o(t)}}})},gS=Dt({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),mS=Dt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function vS({bankAccount:e}){const t=pS(e),n=Vl(),r=()=>{n.close()};return N("form",{className:gS,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[I(fa,{children:"Set Beginning Balance"}),I(t.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),I(t.AppField,{name:"amount",children:e=>I(e.EditableAmountField,{label:"Beginning Balance Amount"})}),I(t.Subscribe,{selector:e=>e,children:e=>N("div",{className:mS,children:[I(kg,{showIcon:!1,onClick:r}),I(jd,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const bS=Bt({base:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"right",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}},variants:{layout:{left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}}}}),fS=Dt({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function yS({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=Ot(bS({layout:a}),So),i=Ot(bS({layout:"right"}),So),l=r&&wn(r);return N(Bl,{placement:"right-start",modal:!0,children:[I(Ul,{children:e=>N("div",{className:fS,children:[N("button",{className:o,...e,type:"button",children:[I(xa,{children:"Beginning Balance"}),I(fa,{children:Nn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&N("button",{className:i,...e,type:"button",children:[I(xa,{children:"Migration Date"}),I(fa,{children:l})]})]})}),I(fx,{children:I(kx,{children:I(Cx,{width:"sm",children:I(vS,{bankAccount:e})})})})]})}const xS=Bt({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function kS({bankAccount:e,showStartDate:t}){const{query:{data:n}}=sS({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=hS(e,n),a=Nn(n?.date)?fn(n?.date):null,o=Nn(e.tranStartDate)?fn(e.tranStartDate):null,i=Nn(a)&&Nn(o)&&!hn(a,o),l=i?"left":t?"right":"left";return N("div",{className:xS({layout:i?"stacked":"inline"}),children:[t&&I(oS,{bankAccount:e}),I(yS,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const TS=Dt({marginTop:"15px",marginBottom:"15px"}),CS={id:"",name:"",mask:"",type:void 0};const wS=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],ES=e=>{eu(e),tu(e)};function AS({bankAccountId:e}){const t=Th(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:CS,[r,a]=y(n),o=function(e,t){const{mutate:n}=Nd(),{mutateAsync:r}=Sd({mutationFn:Ed}),a=Rn(String(e.id));return fg({defaultValues:e,validators:{onBlur:HI},onSubmit:async e=>{if(a)n(Ld(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const n=await r((o=e.value,{apiAccountName:o.name,apiAccountNo:o.mask,apiAccountType:o.type||"DEPOSITORY",duplicateBankAccountIds:[]})),a={id:Hi({id:n?.dataObject?.id,prefix:"BANK_ACCOUNT"}),name:n?.dataObject?.apiAccountName??"",mask:n?.dataObject?.apiAccountNo??"",type:e.value.type};t(a),e.formApi.reset(a,{keepDefaultValues:!0})}var o},onSubmitInvalid:()=>{}})}(r,a),i=!t||Md(t.apiName),l=!!t&&Rd(t.apiName),s=hd(r?.name??"",r?.mask??""),c=Rn(s)?s:"New Bank Account",d=l&&Nn(t?.tranStartDate),u=Nn(t)&&(d||!0);return I(Ew,{children:I(Nw,{children:N("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:ES,children:[N(Xk,{children:[N($k,{children:[I(nT,{}),I(fa,{children:c}),Nn(t)&&I(gT,{children:I(nS,{bankAccount:t})})]}),I(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:I(o.SaveButton,{})})]}),N(BE,{children:[I(o.AppField,{name:"name",children:e=>I(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),I(o.AppField,{name:"mask",children:e=>I(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),I(o.AppField,{name:"type",children:e=>I(e.GenericSelectorField,{label:"Account Type",options:wS,disabled:!i})}),u&&N(S,{children:[I("div",{className:TS,children:I(vi,{alignment:"horizontal"})}),I(kS,{bankAccount:t,showStartDate:d})]})]})]})})})}function IS(){return N(kw,{children:[I(Cw,{name:"BankTransactionFormRouter",Component:mI}),I(Cw,{name:"Conversation",Component:CI}),I(Cw,{name:"MobileConversation",Component:NI}),I(Cw,{name:"FinancialSummary",Component:UI}),I(Cw,{name:"BanksAndIntegrations",Component:WI}),I(Cw,{name:"BankAccountForm",Component:AS}),I(Cw,{name:"NewConnection",Component:PI})]})}const SS=({environment:e,children:t})=>I(Vn.Provider,{value:e,children:t});function NS({children:e}){const{query:{data:t}}=wy(),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Hi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName,clientId:t?.clientId,useStripeInvoicePaymentProcessing:t?.useStripeInvoicePaymentProcessing,hasPayroll:t?.hasPayroll,hasShopify:t?.hasShopify,hasSquare:t?.hasSquare,unitIntegrationBankName:t?.unitIntegrationBankName??null};return I(cs.Provider,{value:n,children:e})}const PS=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const MS="SSE connection failed with status";function RS({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Un();k(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Ur[o]}/sse/v1/subscribe`);var o;return a.searchParams.append("customerPartnerId",n),t.forEach(e=>a.searchParams.append("events",e)),r&&a.searchParams.append("companyId",r),a.toString()}(r,n,t,e);let i=0;return Ae(o,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${MS} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case PS.CONNECTED:return void Cr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case PS.ERROR:throw wr({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case PS.CACHE_BUST:return Cr("cache bust event received",{sseTypes:JSON.stringify(Array.from(r))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{Bn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>wr({error:e,severity:"error"}))},500*Math.random()),Cr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void wr({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:a.event,data:a.data,env:r,sseTypes:n,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw wr({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(MS))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>wr({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const DS=[PS.CACHE_BUST];function LS({children:e}){const{companyId:t,customerPartnerId:n}=b(cs);return RS({companyId:t,customerPartnerId:n,sseTypes:DS}),e}const OS="undefined"!=typeof window?A:k,FS="undefined"==typeof window;const BS=({children:e})=>{const{width:t,height:n}=function(e={}){let{initializeWithValue:t=!0}=e;FS&&(t=!1);const[n,r]=y(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=tx(r,e.debounceDelay,{leading:!0});function o(){(e.debounceDelay?a:r)({width:window.innerWidth,height:window.innerHeight})}return function(e,t,n,r){const a=g(t);OS(()=>{a.current=t},[t]),k(()=>{const t=window;if(!t||!t.addEventListener)return;const n=e=>{a.current(e)};return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}},[e,void 0,r])}("resize",o),OS(()=>{o()},[]),n}({debounceDelay:150}),r={dimensions:{width:t,height:n}};return I(mf.Provider,{value:r,children:e})};function VS({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return k(()=>{var e,r;e=n,r=t,fr.setProperties(kr),xr=r,yr=e},[n,t]),I(SS,{environment:t,children:I(mw,{children:I(Dn.Provider,{value:r,children:I(NS,{children:I(LS,{children:N(BS,{children:[I(be.ConfirmationRoot,{}),e,I(IS,{})]})})})})})})}export{hw as BanksAndIntegrations,xy as BusinessOwnerDashboard,VS as Tight,Gk as TransactionsDashboard,rt as useOptions};
1
+ import{create as e}from"zustand";import{devtools as t,persist as n}from"zustand/middleware";import"zustand/react/shallow";import{cloneDeep as r,entries as a,mapValues as o,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import{v4 as d}from"uuid";import*as u from"zod";import{z as h}from"zod";import*as p from"react";import{useRef as g,useMemo as m,createContext as v,useContext as b,Component as f,useState as y,useCallback as x,useEffect as k,createElement as T,forwardRef as w,useImperativeHandle as C,useReducer as A,useLayoutEffect as E,Fragment as I}from"react";import{jsx as S,Fragment as N,jsxs as P}from"react/jsx-runtime";import{QueryClient as R,useIsRestoring as D,useQuery as M,keepPreviousData as L,useMutation as O}from"@tanstack/react-query";import F from"yocto-queue";import B from"big.js";import{ResponsiveContainer as U,BarChart as V,Legend as W,CartesianGrid as H,XAxis as q,YAxis as j,Tooltip as z,Bar as K,ReferenceLine as Y,Line as _}from"recharts";import{flexRender as Z,createColumnHelper as G,useReactTable as Q,getCoreRowModel as X,getExpandedRowModel as J}from"@tanstack/react-table";import{useFloatingNodeId as $,useFloating as ee,offset as te,flip as ne,shift as re,size as ae,autoUpdate as oe,useClick as ie,useDismiss as le,useRole as se,useInteractions as ce,useFloatingParentNodeId as de,FloatingTree as ue,FloatingNode as he,useMergeRefs as pe,FloatingOverlay as ge,FloatingPortal as me,FloatingFocusManager as ve,useTransitionStatus as be}from"@floating-ui/react";import{ContextAwareConfirmation as fe,confirmable as ye}from"react-confirm";import{createFormHookContexts as xe,useStore as ke,createFormHook as Te}from"@tanstack/react-form";import{NumericFormat as we}from"react-number-format";import Ce from"fuse.js";import{openDB as Ae}from"idb";import{PersistQueryClientProvider as Ee}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ie}from"@microsoft/fetch-event-source";function Se(e,t){return`${e.trim()}:${t.trim()}`}const Ne=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,FEATUREFLAG_SUGGESTED_CATEGORIES:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Se("featureFlags","updateFlags"))});function Pe(){return Xe(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Re(){return Xe(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}let De=null,Me=!1;function Le(){const e=document.querySelector("meta[name='viewport']");if(!e)return null;const t=Object.fromEntries((e.getAttribute("content")??"").split(",").map(e=>{const[t,n=""]=e.trim().split("=");return[t.trim(),n.trim()]}));return{meta:e,params:t}}function Oe(e,t){e.setAttribute("content",Object.entries(t).map(([e,t])=>t?`${e}=${t}`:e).join(", "))}function Fe(){const e=Le();if(!e)return;const{meta:t,params:n}=e;if(Me)return t.remove(),Me=!1,void(De=null);De?n["interactive-widget"]=De:delete n["interactive-widget"],De=null,Oe(t,n)}const Be="drawerNavigation",Ue=(e,t)=>({drawerHistory:[],closingDrawerCount:0,openDrawer:(t,n={})=>e(e=>{const{replaceHistory:a,routeProps:o}=n,i={[t]:{routeProps:o}};if(a||0===e.drawerHistory.length)return 0===e.drawerHistory.length&&function(){let e=Le();if(!e){const t=document.createElement("meta");t.name="viewport",document.head.appendChild(t),Me=!0,e={meta:t,params:{}}}const{meta:t,params:n}=e;De=n["interactive-widget"]??null,n["interactive-widget"]="resizes-content",Oe(t,n)}(),{drawerHistory:[i],closingDrawerCount:0};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t,closingDrawerCount:0}}},void 0,Se(Be,"openDrawer")),closeDrawer:()=>{e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:0}},void 0,Se(Be,"closeDrawer")),0===t().drawerHistory.length&&Fe()},closeAllDrawers:()=>{e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Se(Be,"closeAllDrawers")),Fe()},requestCloseDrawer:()=>e(e=>0===e.drawerHistory.length?{}:{closingDrawerCount:1},void 0,Se(Be,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>({closingDrawerCount:e.drawerHistory.length}),void 0,Se(Be,"requestCloseAllDrawers")),confirmCloseDrawer:()=>{e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:Math.max(0,e.closingDrawerCount-1)}},void 0,Se(Be,"confirmCloseDrawer")),0===t().drawerHistory.length&&Fe()},confirmCloseAllDrawers:()=>{e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Se(Be,"confirmCloseAllDrawers")),Fe()}}),Ve=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Se("externalOptions","setOptions"))});function We(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e={...n};if(delete e.children,t.push(e),n.children&&n.children.length>0){const e=We(n.children);t.push(...e)}}return t}function He(e){return Array.isArray(e)&&e.length>0}function qe(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:d()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}const je="search",ze=qe({key:je,name:"Search"}),Ke="transactionsDashFilters";function Ye(e){if(0===e.length)return e;const t=function(e,t){if(0===e.length)return-1;let n=e.length-1;for(;n>-1;){if(t(e[n]))return n;n--}return-1}(e,e=>e.modelKey===je);return-1===t?e:e.filter((e,n)=>n===t||e.modelKey!==je)}const _e=e=>({transactionsDashFilters:[],hasInitializedTransactionFilters:!1,addTransactionsDashFilters:t=>e(e=>{const n=Ye([...e.transactionsDashFilters,...t]);return{...e,transactionsDashFilters:n}},void 0,Se(Ke,"addFilter")),removeTransactionsDashFilter:t=>e(e=>{const n=(r=e.transactionsDashFilters,(a=t)>-1&&a<=r.length-1?[...r.slice(0,a),...r.slice(a+1)]:[...r]);var r,a;return{...e,transactionsDashFilters:n}},void 0,Se(Ke,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:Ye(t)}),void 0,Se(Ke,"setFilters")),initializeDefaultFilters:({userRole:t,hasNonReconciledTransactions:n})=>e(e=>{if(e.hasInitializedTransactionFilters)return e;const r=[];return r.push({modelKey:"status",id:d(),name:"Active",value:{status:{name:"Active",value:{in:["ACTIVE"]}}}}),"OWNER"===t&&n&&r.push({modelKey:"reviewStatus",id:d(),name:"Needs Review",value:{reviewStatus:{name:"Needs Review",value:{in:["USER_REVIEW_REQUIRED"]}}}}),{...e,transactionsDashFilters:r,hasInitializedTransactionFilters:!0}},void 0,Se(Ke,"initializeDefaultFilters"))}),Ze={label:"Connected Accounts",value:"connected"},Ge="banksAndIntegrationsState",Qe=e=>({banksAndIntegrationsSelectedTab:Ze,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Se(Ge,"setBanksAndIntegrationsSelectedTab")),toggleExpandedIntegration:(t,n)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||n&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,Se(Ge,"toggleExpandedIntegration"))}),Xe=e()(t(n((...e)=>({...Ne(...e),...Ue(...e),...Ve(...e),..._e(...e),...Qe(...e)}),{name:"tight-featureflag-storage",partialize:e=>{const t=Object.entries(e).filter(([e])=>e.startsWith("FEATUREFLAG"));return Object.fromEntries(t)}}),{name:"globalStore",store:"globalStore",enabled:!1})),Je={SELECT:"select",EXPAND:"expand"},$e={...Je,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},et=[$e.COMMENTS,$e.DATE,$e.DESCRIPTION,$e.AMOUNT,$e.CATEGORY,$e.CLASS_SEGMENT,$e.REVIEW_STATUS],tt=u.object({pageSize:u.optional(u.int32().positive()),columns:u.optional(u.array(u.enum(et)))}),nt=u.optional(u.string().trim()),rt=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,at=u.optional(u.array(u.string().trim())),ot=u.object({integrations:u.optional(u.array(u.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"]))),useOnPlaidLink:u.optional(u.boolean()),hideManualBanks:u.optional(u.boolean())}),it={transactionsDashboard:e=>{const t=tt.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=nt.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=at.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>rt.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=ot.safeParse(e);return t.success?t.data:void 0}},lt=(e,t)=>{if(void 0!==it[e])return(0,it[e])(t)};function st(e){const t=g(!1),n=Xe(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=lt(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=Xe(e=>e.externalOptions);return{options:m(()=>r(o),[o]),setOptions:n}}function ct(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function dt(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function ut(e){return String.fromCharCode(e+(e>25?39:97))}function ht(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ut(t%52)+n;return ut(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var pt=/\s*!(important)?/i;function gt(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var mt=e=>{const t=/* @__PURE__ */new Map;return(...n)=>{const r=JSON.stringify(n);if(t.has(r))return t.get(r);const a=e(...n);return t.set(r,a),a}},vt=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function bt(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(vt.has(n))return;const r=e[n],a=t[n];ct(r)&&ct(a)?e[n]=bt(r,a):e[n]=a}),e):e,{})}var ft=e=>null!=e;function yt(e,t,n={}){const{stop:r,getKey:a}=n;return function e(n,o=[]){if("object"==typeof(i=n)&&null!==i){const i={};for(const[l,s]of Object.entries(n)){const c=a?.(l,s)??l,d=[...o,c];if(r?.(n,d))return t(n,o);const u=e(s,d);ft(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function xt(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return yt(e,e=>{return Array.isArray(e)?(t=e,n=a.breakpoints.keys,t.reduce((e,t,r)=>{const a=n[r];return null!=t&&(e[a]=t),e},{})):e;var t,n},{stop:e=>Array.isArray(e),getKey:n?e=>o?i(e):e:void 0})}var kt={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},Tt=/([A-Z])/g,wt=/^ms-/,Ct=mt(e=>e.startsWith("--")?e:e.replace(Tt,"-$1").replace(wt,"-ms-").toLowerCase()),At=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),Et=`(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`,It=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${Et}$`),St={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):ct(e)?yt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&At.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&It.test(e)},Nt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,dt(t))};const Pt=new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")),Rt=/^@|&|&$/;function Dt(e){return Pt.has(e)||Rt.test(e)}const Mt=/^_/,Lt=/&|@/,Ot=/* @__PURE__ */new Map;"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,n]=e.split(":");Ot.set(t,n)});const Ft={conditions:{shift:function(e){return e.sort((e,t)=>{const n=Dt(e),r=Dt(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>Pt.has(e)?e.replace(Mt,""):Lt.test(e)?`[${gt(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${Ot.get(e)||Ct(e)}_${gt(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Bt=function(e){const{utility:t,hash:n,conditions:r=kt}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return mt(({base:o,...i}={})=>{const l=xt(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return yt(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&pt.test(u),[l,...c]=r.shift(o),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(pt,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,o)=>{let i;if(n){const n=[...r.finalize(e),o];i=a(t.toHash(n,ht))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Ft),Ut=(...e)=>Bt(Vt(...e));Ut.raw=(...e)=>Vt(...e);const{mergeCss:Vt}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>ct(e)&&Object.keys(dt(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>xt(t,e))}return{mergeCss:mt(function(...e){return bt(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Ft);function Wt(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Ht=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function qt(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Ht(e),o=e=>({...r,...dt(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=Vt(i,n[t][a]));const l=function(e,t){let n={};return e.forEach(e=>{Object.entries(e).every(([e,n])=>"css"===e||(Array.isArray(n)?n:[n]).some(n=>t[e]===n))&&(n=Vt(n,e.css))}),n}(a,r);return Vt(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(mt(function(e){return Ut(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Ht(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(n));return qt({base:Vt(t,o.base),variants:Object.fromEntries(i.map(e=>[e,Vt(n[e],o.variants[e])])),defaultVariants:bt(r,o.defaultVariants),compoundVariants:[...a,...o.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),a=e=>{const t={};for(let r=0;r<e.length;r++){const a=e[r];n[a]&&(Object.defineProperty(t,a,n[a]),delete n[a])}return t};return t.map(e=>a(Array.isArray(e)?e:r.filter(e))).concat(a(r))}(e,l)},getVariantProps:o})}var jt,zt=((jt=zt||{}).component="component",jt["dashboard-placeholder-table"]="dashboard-placeholder-table",jt["dashboard-header"]="dashboard-header",jt["dashboard-table"]="dashboard-table",jt["dashboard-table-body"]="dashboard-table-body",jt["dashboard-table-cell"]="dashboard-table-cell",jt["dashboard-table-column-header"]="dashboard-table-column-header",jt["dashboard-table-header"]="dashboard-table-header",jt.label="label",jt.popup="popup",jt["popup-sort-row"]="popup-sort-row",jt["progress-bar"]="progress-bar",jt["progress-bar-fill"]="progress-bar-fill",jt.summation="summation",jt["table-parent-row"]="table-parent-row",jt["table-row"]="table-row",jt["table-sub-row"]="table-sub-row",jt.tile="tile",jt["tile-bar-label"]="tile-bar-label",jt["tile-bar-label-outer"]="tile-bar-label-outer",jt["tile-body"]="tile-body",jt["tile-filter-button"]="tile-filter-button",jt["tile-filter-list"]="tile-filter-list",jt["tile-filter-row"]="tile-filter-row",jt["tile-header"]="tile-header",jt["tile-title"]="tile-title",jt.title="title",jt["business-owner-dashboard"]="business-owner-dashboard",jt["business-owner-dashboard-header"]="business-owner-dashboard-header",jt["business-owner-table"]="business-owner-table",jt["transaction-type-label"]="transaction-type-label",jt["transaction-date-cell-container"]="transaction-date-cell-container",jt["selector-row"]="selector-row",jt["popup-list"]="popup-list",jt.badge="badge",jt["badge-chip"]="badge-chip",jt["date-cell"]="date-cell",jt["expander-cell"]="expander-cell",jt["vertical-divider"]="vertical-divider",jt["horizontal-divider"]="horizontal-divider",jt["table-cell-divider"]="table-cell-divider",jt["checkbox-input"]="checkbox-input",jt["bulk-select"]="bulk-select",jt["button-base"]="button-base",jt["button-discreet-small"]="button-discreet-small",jt["button-primary"]="button-primary",jt["button-secondary"]="button-secondary",jt["button-tertiary"]="button-tertiary",jt["button-danger"]="button-danger",jt["button-warning"]="button-warning",jt["button-action"]="button-action",jt["button-table-header"]="button-table-header",jt["button-inline"]="button-inline",jt["small-square-button"]="small-square-button",jt.card="card",jt["card-button"]="card-button",jt["card-button-icon"]="card-button-icon",jt["pagination-button"]="pagination-button",jt.text="text",jt["cell-button"]="cell-button",jt["selector-button"]="selector-button",jt["review-status-selector-button"]="review-status-selector-button",jt["review-status-dropdown-arrow"]="review-status-dropdown-arrow",jt["financial-summary-layout"]="financial-summary-layout",jt["financial-summary-chatbox"]="financial-summary-chatbox",jt["financial-summary-chatbox-header"]="financial-summary-chatbox-header",jt["month-picker"]="month-picker",jt["month-picker-left-button"]="month-picker-left-button",jt["month-picker-right-button"]="month-picker-right-button",jt["month-picker-label"]="month-picker-label",jt["filter-bar"]="filter-bar",jt["filter-search-bar"]="filter-search-bar",jt["filter-pill"]="filter-pill",jt["discreet-form-input"]="discreet-form-input",jt["editable-form-input"]="editable-form-input",jt["category-text"]="category-text",jt["amount-input-container"]="amount-input-container",jt["amount-input"]="amount-input",jt["modal-popup"]="modal-popup",jt["drawer-header"]="drawer-header",jt["drawer-header-border"]="drawer-header-border",jt["form-body"]="form-body",jt.body="body",jt.heading="heading",jt["sub-label"]="sub-label",jt["strong-label"]="strong-label",jt["strong-sub-label"]="strong-sub-label",jt["metric-xl"]="metric-xl",jt["metric-md"]="metric-md",jt["large-icon"]="large-icon",jt["medium-icon"]="medium-icon",jt["small-icon"]="small-icon",jt["tiny-icon"]="tiny-icon",jt["x-large-icon"]="x-large-icon",jt["xx-large-icon"]="xx-large-icon",jt["card-header"]="card-header",jt.icon="icon",jt["neutral-badge"]="neutral-badge",jt["highlight-badge"]="highlight-badge",jt["success-badge"]="success-badge",jt["warning-badge"]="warning-badge",jt["critical-badge"]="critical-badge",jt["button-group"]="button-group",jt["alert-dialog"]="alert-dialog",jt["alert-header"]="alert-header",jt["emphasis-label"]="emphasis-label",jt["profit-loss-graph"]="profit-loss-graph",jt.banner="banner",jt["banner-high"]="banner-high",jt["banner-medium"]="banner-medium",jt["banner-low"]="banner-low",jt["banner-urgent"]="banner-urgent",jt["banner-default"]="banner-default",jt["banner-button"]="banner-button",jt["banner-button-text"]="banner-button-text",jt["banner-button-icon"]="banner-button-icon",jt["banner-icon"]="banner-icon",jt["banner-title"]="banner-title",jt["empty-dashboard-layout"]="empty-dashboard-layout",jt["zero-state-layout"]="zero-state-layout",jt["emphasis-sub-label"]="emphasis-sub-label",jt["nav-button"]="nav-button",jt["bar-transactions-positive"]="bar-transactions-positive",jt["bar-transactions-negative"]="bar-transactions-negative",jt["message-sent"]="message-sent",jt["message-received"]="message-received",jt);const Kt="Tight-",Yt=e=>`${Kt}${e}`;function _t(e){return e in zt}function Zt(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Kt&&r in zt}function Gt(e){return!_t(e)&&!Zt(e)}const Qt=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Yt(e)),t.forEach(e=>{void 0!==e&&(Gt(e)?r.push(e):_t(e)&&n.push(Yt(e)))}),{className:Wt(...n,...r)}},Xt=Qt(zt["business-owner-dashboard-header"],Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"80px",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function Jt({children:e}){return S("div",{...Xt,children:e})}function $t(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Zt(t)&&e.push(t),e),[])],[])}function en(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Gt(t)&&e.push(t),e),[])],[])}function tn(e){const t=Array.isArray(e)?e:[e];return{className:Wt(...$t(t),...en(t))}}const nn=qt({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{xl:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{xl:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{xl:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontSize:"lg",fontWeight:"sm",lineHeight:"18px",xl:{fontWeight:"label.strong",fontSize:"label.strong",lineHeight:"16px"},fontFamily:"label",color:"typography.label.strong",letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:{xl:"heading",base:"lg"},fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),rn=Qt(zt.heading,nn({heading:"default"}));function an({children:e,stylists:t=[]}){const n=tn([rn,...t]);return S("div",{...n,children:e})}function on(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ln(e,t,n){return new Date(e,t,n)}function sn(e){const[t,n,r]=e.split("-");return ln(Number(t),Number(n),Number(r))}function cn(){return on(ln(/* @__PURE__ */(new Date).getFullYear()+1,0,0))}function dn(e,t){return on(ln(t,e,1))}function un(){const e=/* @__PURE__ */new Date;return on(ln(e.getFullYear(),e.getMonth()+1,0))}const hn={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},pn=e=>{switch(e){case hn.THIS_YEAR:return on(ln(/* @__PURE__ */(new Date).getFullYear(),0,1));case hn.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return dn(e.getMonth(),e.getFullYear())}();case hn.LAST_YEAR:return on(ln(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case hn.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return on(ln(e.getFullYear(),e.getMonth()-1,1))}();case hn.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return on(ln(e.getFullYear(),e.getMonth()-12,1))}();default:return""}},gn=e=>{switch(e){case hn.THIS_YEAR:return cn();case hn.THIS_MONTH:return un();case hn.LAST_YEAR:return on(ln(/* @__PURE__ */(new Date).getFullYear(),0,0));case hn.PAST_YEAR:return un();case hn.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return on(ln(e.getFullYear(),e.getMonth(),0))}();default:return""}};const mn=e=>{return t=e,Object.values(hn).includes(t)?{beginDate:pn(e),endDate:gn(e)}:function(e){if("object"!=typeof e)return!1;const t=e;return"string"==typeof t.beginDate&&"string"==typeof t.endDate}(e)?e:{beginDate:on((n=e).beginDate),endDate:on(n.endDate)};var t,n},vn=["SUN","MON","TUE","WED","THU","FRI","SAT"],bn=["January","February","March","April","May","June","July","August","September","October","November","December"];function fn({yearsBack:e=10,startYear:t}){const n=t??/* @__PURE__ */(new Date).getFullYear(),r=[n];for(let a=n-1;a>=n-e;a--)r.push(a);return r}function yn(e,t){return e.toDateString()===t.toDateString()}function xn(e){return yn(e,/* @__PURE__ */new Date)}function kn(e,t){const n=ln(e.getFullYear(),e.getMonth(),e.getDate()),r=ln(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function Tn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function wn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=ln(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function Cn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return wn(o,i,l)?ln(l,o-1,i):null}function An(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return wn(i,l,o)?ln(o,i-1,l):null}function En(e){if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getDate()).padStart(2,"0");return`${t}-${String(e.getMonth()+1).padStart(2,"0")}-${n}`}function In(e,t){return kn(e,t)?t:e}function Sn(e,t){return kn(t,e)?t:e}const Nn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"},r=e.toLocaleString("default",n);let a=r;if(t.abbreviateYear){const e=r.length-2;a=r.slice(0,e)+"'"+r.slice(e)}return a},Pn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return xn(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):Nn(t,{abbreviateMonth:!0,abbreviateYear:!1})},Rn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function Dn(e,t){return ln(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Mn(e,t,n){return[...e,{accessToken:t,environment:n}]}function Ln(e,t){return[...e,t]}const On=e=>null==e,Fn=e=>!On(e);function Bn(e){return""===e.trim()}function Un(e){return On(e)||Bn(e)}function Vn(e){return!Un(e)}const Wn=v({activeToken:void 0,accountantToken:void 0});function Hn(){const{activeToken:e}=b(Wn);return e}const qn=()=>{throw new Error("No access token provided")},jn=72e5,zn=new R({defaultOptions:{queries:{gcTime:jn,staleTime:3e4,refetchInterval:6e4}}}),Kn=v("SANDBOX");function Yn(){return b(Kn)}function _n({queryKey:e,queryFn:t,...n}){const r=Hn(),a=Yn(),o=Vn(r),i=Mn(e,r??"",a),l=D(),s=M({...n,queryKey:i,queryFn:o?t:qn,placeholderData:n.keepPreviousDataPlaceholder?L:void 0,...o?{}:{retry:!1,staleTime:1/0}},zn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class Zn{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:n,payloadVersion:r}){const a=/* @__PURE__ */(new Date).toISOString(),o=JSON.stringify({apiKey:e,payloadVersion:r,notifier:n,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":r,"Bugsnag-Sent-At":a},referrerPolicy:"no-referrer",body:o})}}const Gn=Symbol("Circular"),Qn=Symbol("AccessError");function Xn(e,t,n){return Jn({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Jn({key:e,value:t,replacer:n,seen:r,depthLimit:a=1/0,depth:o,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(r.includes(s)&&(s=Gn),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=$n(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(o>a||i+1>l)return"[...]";if(r.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=$n(()=>s[i]);e.push(Jn({key:i,value:t,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=$n(()=>s[c]);e[c]=Jn({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function $n(e){try{return e()}catch{return Qn}}const er=Object.prototype.toString,tr=Object.getPrototypeOf;function nr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const rr=/^\s*at .*(\S+:\d+|\(native\))/m,ar=/^(eval@)?(\[native code])?$/;function or(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const n=t[2]?parseInt(t[2],10):void 0,r=t[3]?parseInt(t[3],10):void 0;return[t[1],n,r]}function ir(e,t){const n=lr(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&nr(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[sr(n)];return a.push(...ur(n).map(e=>sr(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function lr(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===er.call(t))return!0;t=tr(t)}return!1}(e))return e;let n=function(e){if(!nr(e))return null;const t=t=>{const n=e[t];if("string"==typeof n&&e[t.length])return n},n=t("name")||t("errorClass"),r=t("message")||t("errorMessage");if(!n||!r)return null;const a=new Error(r);return a.name=n,a}(e);if(n)return n;switch(typeof n){case"string":case"number":case"boolean":return new Error(String(e));default:return n=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),n.name="InvalidError",n}}function sr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:cr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function cr(e,{backtrace:t}){const n=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return n?function(e){return(e.match(rr)?e.split("\n").filter(e=>!!e.match(rr)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),a=or(n?n[1]:r.pop()||"(no location)"),o=r.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(a[0])>-1?void 0:a[0],lineNumber:a[1],columnNumber:a[2],method:o}}):(t=e,t.split("\n").filter(e=>!e.match(ar)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=or(e.replace(t,""));return{file:a[0],lineNumber:a[1],columnNumber:a[2],method:r}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let n=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";n=n.replace(/\?.*$/,"").replace(/#.*$/,"");let r=t.method||"(unknown function)";return r=/^global code$/i.test(r)?"global code":r,e.concat([{file:n,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:r}])},[]);var t}(n):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<dr;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const dr=20;function ur(e){const t=e;if(t.cause){const e=lr(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(ur(e))}return[]}function hr(...e){console.log}function pr(...e){console.error}const gr={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let mr=Date.now();const vr=()=>{mr=Date.now()},br={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-mr,!0}),{reset:vr})},fr=[["Edge (EdgeHTML)",/Edge\/([0-9._]+)/],["Edge (iOS)",/EdgiOS\/([0-9._]+)/],["Yandex",/YaBrowser\/([0-9._]+)/],["KakaoTalk",/KAKAOTALK\s([0-9.]+)/],["Samsung",/SamsungBrowser\/([0-9.]+)/],["Silk",/\bSilk\/([0-9._-]+)\b/],["MIUI",/MiuiBrowser\/([0-9.]+)$/],["Beaker",/BeakerBrowser\/([0-9.]+)/],["Edge (Chromium)",/EdgA?\/([0-9.]+)/],["Chromium WebView",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome (iOS)",/CriOS\/([0-9.]+)(:?\s|$)/],["Firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["Firefox (iOS)",/FxiOS\/([0-9.]+)/],["Opera Mini",/Opera Mini.*Version\/([0-9.]+)/],["Opera",/Opera\/([0-9.]+)(?:\s|$)/],["Opera",/OPR\/([0-9.]+)(:?\s|$)/],["Internet Explorer",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["Internet Explorer",/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],["Internet Explorer",/MSIE\s(7\.0)/],["Blackberry",/BB10;\sTouch.*Version\/([0-9.]+)/],["Android",/Android\s([0-9.]+)/],["Safari (iOS)",/Version\/([0-9._]+).*Mobile.*Safari.*/],["Safari",/Version\/([0-9._]+).*Safari/],["Facebook",/FB[AS]V\/([0-9.]+)/],["Instagram",/Instagram\s([0-9.]+)/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Mobile/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Gecko\)$/]],yr=[["iOS",void 0,/iP(hone|od|ad)/],["Android",void 0,/Android/],["BlackBerry",void 0,/BlackBerry|BB10/],["Windows Mobile",void 0,/IEMobile/],["Kindle",void 0,/Kindle/],["Windows","3.11",/Win16/],["Windows","95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows","98",/(Windows 98)|(Win98)/],["Windows","2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows","XP",/(Windows NT 5.1)|(Windows XP)/],["Windows","Server 2003",/(Windows NT 5.2)/],["Windows","Vista",/(Windows NT 6.0)/],["Windows","7",/(Windows NT 6.1)/],["Windows","8",/(Windows NT 6.2)/],["Windows","8.1",/(Windows NT 6.3)/],["Windows","10+",/(Windows NT 10.0)/],["Windows","ME",/Windows ME/],["Open BSD",void 0,/OpenBSD/],["Sun OS",void 0,/SunOS/],["Chrome OS",void 0,/CrOS/],["Linux",void 0,/(Linux)|(X11)/],["Mac OS",void 0,/(Mac_PowerPC)|(Macintosh)/],["QNX",void 0,/QNX/],["BeOS",void 0,/BeOS/],["OS/2",void 0,/OS\/2/]],xr=(kr=function(e){const t=""!==(n=e)&&fr.reduce((e,[t,r])=>{if(e)return e;const a=r.exec(n);return!!a&&[t,a]},!1);var n;if(!t)return{};const[r,a]=t,o=function(e){for(const[t,n,r]of yr)if(r.exec(e))return{osName:t,osVersion:n};return null}(e),i="iOS"===o?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:r,browserVersion:a[1],osName:o?.osName,osVersion:o?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...kr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var kr;class Tr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new F}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class wr extends f{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:n,metadata:r}=ir(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let n="";for(let r=0,a=t.length;r<a;r++)t[r].length&&(n+=`${n.length?"\n":""}${t[r]}`);return n}(t.componentStack));const{onError:a,client:o}=this.props;o.notifyEvent({exceptions:n,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...r,react:t},onError:a},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return S(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return S(N,{children:this.props.children})}}const Cr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>S(wr,{client:e,onError:t,FallbackComponent:n,children:r})})},Ar=new class{breadcrumbs=[];config;delivery=new Zn(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return pr(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const n of this.config.plugins||[])this.plugins.push({name:n.name||"unknown",plugin:n.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:n,metadata:r}=ir(e,"notify");let a,o,i=r;return"function"==typeof t?a=t:(o=t.severity,t.metadata&&(i={...r,...t.metadata})),this.notifyEvent({exceptions:n,metadata:i,severity:o,onError:a},e)}leaveBreadcrumb(e,t,n){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:n||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:r=25}=this.config;this.breadcrumbs.length>r&&this.breadcrumbs.splice(0,this.breadcrumbs.length-r)}async notifyEvent({exceptions:e,unhandled:t,severity:n,severityReason:r,metadata:a,onError:o},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:n||"warning",severityReason:r,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:a||{}},c=[...this.errorCallbacks];o&&c.push(o);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=Xn(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={apiKey:this.config.apiKey,payloadVersion:"5",notifier:{name:"Tight Components",version:"1",url:"https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md"},events:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){pr()}}getUser(){return this.config?.user||{}}setUser(e,t,n){this.config&&(this.config.user={id:e,email:t,name:n})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let Er="",Ir="";const Sr="prod",Nr=Ar.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"6.0.3",appType:"browser",releaseStage:Sr,plugins:[br,xr,gr,(()=>{const e=new Tr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Cr]}),Pr=(e,t)=>{try{Ar.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?Rr({error:n,severity:"error"}):Rr({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},Rr=async e=>{try{await Ar.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:Er,environment:Ir}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await Rr({error:t,severity:"error"}):await Rr({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},Dr=Nr.getPlugin("react"),Mr=Dr?.BugsnagErrorBoundary,Lr=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,Or=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Fr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Br={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function Ur(e){const t=(({accessToken:e,extraHeaders:t})=>{const n={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...n}:n})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?Br:{}}});return{url:(n=e.endpointManager.getUrl(e.path),r=e.pathParams,void 0!==r&&Object.entries(r).forEach(([e,t])=>{n=n.replace(`{${e}}`,t)}),n),headers:t};var n,r}async function Vr({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=Or({extraHeaders:t,authorization:e});Pr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return Pr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),Fr(e)}catch(l){return Promise.reject(l)}}async function Wr(e){const{url:t,headers:n}=Ur(e);return Vr({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Hr(e){return Wr(e)}async function qr(e){return Wr(e)}const jr=(e,t)=>({getUrl:t=>((e,t)=>{let n=t;for(;n.length>0&&"/"===n.charAt(0);)n=n.slice(1);return`${e}/${n}`})(e,t),baseUrl:e,apiVersion:t}),zr={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest",DEVELOPMENT_RC:"https://dev.hurdlr.com/rest",SANDBOX_RC:"https://sandbox.hurdlr.com/rest",PRODUCTION_RC:"https://prod.hurdlr.com/rest"},Kr={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080",DEVELOPMENT_RC:"https://qa.dev.tight.com",SANDBOX_RC:"https://qa.sandbox.tight.com",PRODUCTION_RC:"https://qa.prod.tight.com"},Yr={...Kr,LOCAL:"http://localhost:8082"};function _r(e){return jr(`${t=e,zr[t]}/v5`,"v5");var t}const Zr=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],Gr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...mn(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:_r(a)};return await qr(o)};function Qr({filter:e,grouping:t,select:n}){return _n({queryKey:Zr({filter:e,grouping:t}),queryFn:Gr,select:n})}const Xr="noDataHeight";function Jr(e){const t=An(e??"");return null!==t?Nn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}function $r(e){const t=Jr(e.period?.beginDate),n=e.netIncome??0,{profit:r,remainingIncome:a,loss:o,remainingExpenses:i}=function(e,t,n){const r=e>0?e:0,a=e<0?e:0;return{profit:r,remainingIncome:void 0!==t?B(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?B(n).plus(a).toNumber():0}}(n,e.income?.total,e.expenses?.total);return{month:{month:t,income:a,expenses:-i,profit:r,loss:o,netIncome:n,hasNoData:/* @__PURE__ */function(e,t,n){return 0===e&&0===t&&0===n}(n,a,i)},netIncome:n}}function ea(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(On(n))return t;for(const i of n){const{month:e,netIncome:n}=$r(i);t.total=B(n).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:r,domainMax:a}=n.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[r,a],t.hasAnyData=t.months.some(e=>!e.hasNoData);const o=function(e,t){const n=t-e;return n>0?.03*n:3}(r,a);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:o}:e),t}const ta=Qt(zt["tile-header"],Ut({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function na({title:e}){return S("div",{...ta,children:S(an,{children:e})})}const ra=Qt(zt["tile-body"],Ut({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderBottomRadius:"lg",borderTop:"hidden"}));function aa({children:e}){return S("div",{...ra,children:e})}const oa=qt({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative",borderRadius:"lg"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function ia({children:e,type:t,isSample:n=!1}){const r=Qt(zt.tile,oa({type:t,isSample:n}));return S("div",{...r,children:e})}const la=Ut({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),sa=Ut.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),ca=Ut({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),da=Qt(zt.text,Ut({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la);function ua({children:e}){return S("div",{...da,children:e})}const ha=Qt(zt["metric-xl"],nn({metric:"xl"}));function pa(e){return S("div",{...ha,children:e.children})}const ga=Qt(zt.summation,Ut({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function ma({title:e,label:t}){return P("div",{...ga,children:[S(pa,{children:e}),S(ua,{children:t})]})}const va=Qt(null,Ut({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function ba({children:e}){return S("div",{...va,children:e})}const fa=(e,t=0)=>{const n=Math.abs(e);let r;if(t<=0)r=Math.round(n);else{const e=n.toFixed(t);r=parseFloat(e)}return Math.sign(e)*r},ya=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),xa=1e9;function ka(e,{cents:t="default",condense:n=!1,dollarSign:r=!1,signage:a="default"}={}){const o="string"==typeof e?parseFloat(e):e;if(Number.isNaN(o))return"";let i;const l=Math.abs(o);let s;if(n&&l>99999){s=Math.sign(o)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),n=Math.round(l/t),r=n*t;let a,c=n/1e3;l<xa&&c>=1e3&&(c/=1e3),r>=xa?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${ya(c,0,1)}${a}`}else{let e;const n=2,r=0;let a,l;"floor"===t?(a=r,l=r,c=o,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(a=r,l=r,e=fa(o,a)):"always"===t?(a=n,l=n,e=fa(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=fa(o,a)):(a=n,e=fa(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=ya(d,l,a)}var c,d;let u=i;const h=r?"$":"";return void 0===a||"off"===a?u=i:"parens"===a?u=`${h}${s?`(${i})`:i}`:"always"===a?u=`${s?"-":"+"}${h}${i}`:"default"===a&&(u=`${s?"-":""}${h}${i}`),u}function Ta(e){return ka(e,{condense:!0,dollarSign:!0})}function wa(e){return ka(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Ca=qt({variants:{wrap:{ellipsis:sa,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function Aa({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(Un(n))return null;const a=tn([Qt(zt["strong-label"],zt.text,nn({label:"strongLabel"}),Ca({wrap:e,textAlign:t})),...r]);return S("div",{title:"ellipsis"===e?n:void 0,...a,children:n})}const Ea=qt({base:{fontWeight:"label.sub",fontSize:"md",fontFamily:"label",lineHeight:"16px",letterSpacing:"0.66px",fontStyle:"normal",xl:{lineHeight:"14px",fontSize:"label.sub"}},variants:{intent:{weak:{color:"typography.base.weak"},normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:sa,wrap:{whiteSpace:"normal",overflowWrap:"break-word"},wrapThrice:{ellipsisTextRaw:sa,whiteSpace:"normal",textAlign:"left",display:"-webkit-box","-webkit-line-clamp":3,"-webkit-box-orient":"vertical"}}}});function Ia({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":e,o=Qt(zt["sub-label"],zt.text,Ea({intent:a,wrap:t,accent:r}),la);return Un(n)?null:S("div",{...o,children:n})}const Sa=Qt(null,Ut({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"10px",width:"fit-content",height:"fit-content"}));function Na({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===Xr)return null;let n=t[0].value??0;return"expenses"===t[0].dataKey?n+=t[0].payload.loss:"income"===t[0].dataKey&&(n+=t[0].payload.profit),P("div",{...Sa,children:[S(Aa,{children:t[0].name??""}),S(Ia,{children:Ta(Number(n))})]})}const Pa={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue200":{value:"#EDFAFC",variable:"var(--Tight-colors-blue200)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green200":{value:"#DBF9EA",variable:"var(--Tight-colors-green200)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow200":{value:"#FFF3C3",variable:"var(--Tight-colors-yellow200)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red200":{value:"#FFCBCB",variable:"var(--Tight-colors-red200)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"12px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"fontWeights.sm":{value:"400",variable:"var(--Tight-fontWeights-sm)"},"fontWeights.md":{value:"600",variable:"var(--Tight-fontWeights-md)"},"fontWeights.lg":{value:"900",variable:"var(--Tight-fontWeights-lg)"},"radii.zero":{value:"0",variable:"var(--Tight-radii-zero)"},"radii.sm":{value:"1px",variable:"var(--Tight-radii-sm)"},"radii.md":{value:"2px",variable:"var(--Tight-radii-md)"},"radii.lg":{value:"4px",variable:"var(--Tight-radii-lg)"},"borderWidths.sm":{value:"0.5px",variable:"var(--Tight-borderWidths-sm)"},"borderWidths.md":{value:"1px",variable:"var(--Tight-borderWidths-md)"},"borderWidths.lg":{value:"1px",variable:"var(--Tight-borderWidths-lg)"},"borderWidths.xl":{value:"2px",variable:"var(--Tight-borderWidths-xl)"},"animations.appear.instant":{value:"0.25s linear fade-in",variable:"var(--Tight-animations-appear-instant)"},"animations.appear.delay":{value:"0.25s linear both 1.5s fade-in",variable:"var(--Tight-animations-appear-delay)"},"animations.shimmer":{value:"2s ease-in-out infinite shimmer",variable:"var(--Tight-animations-shimmer)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"animations.slideIn.right":{value:"300ms ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"300ms ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"300ms ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"300ms ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(0, 0, 0, 0.05), 0px 4px 12px 0px rgba(0, 0, 0, 0.15) ",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.opaque":{value:"var(--Tight-colors-blue200)",variable:"var(--Tight-colors-brand-action-opaque)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.opaque":{value:"var(--Tight-colors-green200)",variable:"var(--Tight-colors-brand-success-opaque)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.opaque":{value:"var(--Tight-colors-yellow200)",variable:"var(--Tight-colors-brand-warning-opaque)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.opaque":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-brand-danger-opaque)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discreet":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discreet)"},"colors.surface.intent.action.discreet.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discreet-hover)"},"colors.surface.intent.action.discreet.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discreet-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.surface.intent.danger.weak":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger-weak)"},"colors.surface.intent.danger.opaque":{value:"var(--Tight-colors-brand-danger-opaque)",variable:"var(--Tight-colors-surface-intent-danger-opaque)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-active)"},"colors.typography.intent.success":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success)"},"colors.typography.intent.success.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-hover)"},"colors.typography.intent.success.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-active)"},"colors.typography.intent.warning":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning)"},"colors.typography.intent.warning.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-hover)"},"colors.typography.intent.warning.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-active)"},"colors.typography.intent.danger":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger)"},"colors.typography.intent.danger.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-hover)"},"colors.typography.intent.danger.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-active)"},"colors.typography.accent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-typography-accent-success)"},"colors.typography.accent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-typography-accent-warning)"},"colors.typography.accent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-typography-accent-danger)"},"colors.typography.accent.action":{value:"var(--Tight-colors-brand-action-strongest)",variable:"var(--Tight-colors-typography-accent-action)"},"colors.typography.body":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-body)"},"colors.typography.label":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label)"},"colors.typography.label.sub":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-typography-label-sub)"},"colors.typography.label.strong":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strong)"},"colors.typography.label.strongSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strongSub)"},"colors.typography.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"colors.typography.heading":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-heading)"},"colors.typography.metric.sm":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-sm)"},"colors.typography.metric.md":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-md)"},"colors.typography.metric.lg":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-lg)"},"colors.typography.metric.xl":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-xl)"},"colors.icon.base":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-icon-base)"},"colors.icon.base.weak":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-icon-base-weak)"},"colors.icon.contrast":{value:"var(--Tight-colors-typography-contrast)",variable:"var(--Tight-colors-icon-contrast)"},"colors.icon.contrast.weak":{value:"var(--Tight-colors-typography-contrast-weak)",variable:"var(--Tight-colors-icon-contrast-weak)"},"colors.icon.intent.primary":{value:"var(--Tight-colors-typography-intent-primary)",variable:"var(--Tight-colors-icon-intent-primary)"},"colors.icon.intent.primary.hover":{value:"var(--Tight-colors-typography-intent-primary-hover)",variable:"var(--Tight-colors-icon-intent-primary-hover)"},"colors.icon.intent.primary.active":{value:"var(--Tight-colors-typography-intent-primary-active)",variable:"var(--Tight-colors-icon-intent-primary-active)"},"colors.icon.intent.secondary":{value:"var(--Tight-colors-typography-intent-secondary)",variable:"var(--Tight-colors-icon-intent-secondary)"},"colors.icon.intent.secondary.hover":{value:"var(--Tight-colors-typography-intent-secondary-hover)",variable:"var(--Tight-colors-icon-intent-secondary-hover)"},"colors.icon.intent.secondary.active":{value:"var(--Tight-colors-typography-intent-secondary-active)",variable:"var(--Tight-colors-icon-intent-secondary-active)"},"colors.icon.intent.action":{value:"var(--Tight-colors-typography-intent-action)",variable:"var(--Tight-colors-icon-intent-action)"},"colors.icon.intent.action.hover":{value:"var(--Tight-colors-typography-intent-action-hover)",variable:"var(--Tight-colors-icon-intent-action-hover)"},"colors.icon.intent.action.active":{value:"var(--Tight-colors-typography-intent-action-active)",variable:"var(--Tight-colors-icon-intent-action-active)"},"colors.icon.intent.success":{value:"var(--Tight-colors-typography-intent-success)",variable:"var(--Tight-colors-icon-intent-success)"},"colors.icon.intent.success.hover":{value:"var(--Tight-colors-typography-intent-success-hover)",variable:"var(--Tight-colors-icon-intent-success-hover)"},"colors.icon.intent.success.active":{value:"var(--Tight-colors-typography-intent-success-active)",variable:"var(--Tight-colors-icon-intent-success-active)"},"colors.icon.intent.warning":{value:"var(--Tight-colors-typography-intent-warning)",variable:"var(--Tight-colors-icon-intent-warning)"},"colors.icon.intent.warning.hover":{value:"var(--Tight-colors-typography-intent-warning-hover)",variable:"var(--Tight-colors-icon-intent-warning-hover)"},"colors.icon.intent.warning.active":{value:"var(--Tight-colors-typography-intent-warning-active)",variable:"var(--Tight-colors-icon-intent-warning-active)"},"colors.icon.intent.danger":{value:"var(--Tight-colors-typography-intent-danger)",variable:"var(--Tight-colors-icon-intent-danger)"},"colors.icon.intent.danger.hover":{value:"var(--Tight-colors-typography-intent-danger-hover)",variable:"var(--Tight-colors-icon-intent-danger-hover)"},"colors.icon.intent.danger.active":{value:"var(--Tight-colors-typography-intent-danger-active)",variable:"var(--Tight-colors-icon-intent-danger-active)"},"colors.icon.accent.success":{value:"var(--Tight-colors-typography-accent-success)",variable:"var(--Tight-colors-icon-accent-success)"},"colors.icon.accent.warning":{value:"var(--Tight-colors-typography-accent-warning)",variable:"var(--Tight-colors-icon-accent-warning)"},"colors.icon.accent.danger":{value:"var(--Tight-colors-typography-accent-danger)",variable:"var(--Tight-colors-icon-accent-danger)"},"colors.border.layout.weak":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-border-layout-weak)"},"colors.border.layout":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-border-layout)"},"colors.border.layout.strong":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-border-layout-strong)"},"colors.border.intent.primary.hover":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-hover)"},"colors.border.intent.primary":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary)"},"colors.border.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-active)"},"colors.border.intent.primary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-primary-disabled)"},"colors.border.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-hover)"},"colors.border.intent.secondary":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary)"},"colors.border.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-active)"},"colors.border.intent.secondary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-secondary-disabled)"},"colors.border.intent.danger.hover":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-hover)"},"colors.border.intent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger)"},"colors.border.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-active)"},"colors.border.intent.danger.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-danger-disabled)"},"colors.border.intent.warning.hover":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-hover)"},"colors.border.intent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning)"},"colors.border.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-active)"},"colors.border.intent.warning.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-warning-disabled)"},"colors.border.intent.success.hover":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-hover)"},"colors.border.intent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success)"},"colors.border.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-active)"},"colors.border.intent.success.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-success-disabled)"},"colors.border.intent.action.hover":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-hover)"},"colors.border.intent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action)"},"colors.border.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-active)"},"colors.border.intent.action.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-action-disabled)"},"colors.money":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-money)"},"colors.money.positive":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive)"},"colors.money.positive.weak":{value:"var(--Tight-colors-green200)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.positive.strong":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive-strong)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.money.negative.strong":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative-strong)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"fontWeights.heading":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-heading)"},"fontWeights.title":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-title)"},"fontWeights.metric.sm":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-sm)"},"fontWeights.metric.md":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-md)"},"fontWeights.metric.lg":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-lg)"},"fontWeights.metric.xl":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-xl)"},"fontSizes.title":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-title)"},"fontSizes.body":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-body)"},"fontSizes.label":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label)"},"fontSizes.label.strong":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label-strong)"},"fontSizes.label.sub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-sub)"},"fontSizes.label.strongSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-strongSub)"},"fontSizes.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-heading)"},"fontSizes.metric.sm":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-metric-sm)"},"fontSizes.metric.md":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-metric-md)"},"fontSizes.metric.lg":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-metric-xl)"},"colors.colorPalette":{value:"var(--Tight-colors-colorPalette)",variable:"var(--Tight-colors-colorPalette)"},"colors.colorPalette.primary.weak":{value:"var(--Tight-colors-colorPalette-primary-weak)",variable:"var(--Tight-colors-colorPalette-primary-weak)"},"colors.colorPalette.weak":{value:"var(--Tight-colors-colorPalette-weak)",variable:"var(--Tight-colors-colorPalette-weak)"},"colors.colorPalette.primary":{value:"var(--Tight-colors-colorPalette-primary)",variable:"var(--Tight-colors-colorPalette-primary)"},"colors.colorPalette.primary.strong":{value:"var(--Tight-colors-colorPalette-primary-strong)",variable:"var(--Tight-colors-colorPalette-primary-strong)"},"colors.colorPalette.strong":{value:"var(--Tight-colors-colorPalette-strong)",variable:"var(--Tight-colors-colorPalette-strong)"},"colors.colorPalette.secondary.weak":{value:"var(--Tight-colors-colorPalette-secondary-weak)",variable:"var(--Tight-colors-colorPalette-secondary-weak)"},"colors.colorPalette.secondary":{value:"var(--Tight-colors-colorPalette-secondary)",variable:"var(--Tight-colors-colorPalette-secondary)"},"colors.colorPalette.secondary.strong":{value:"var(--Tight-colors-colorPalette-secondary-strong)",variable:"var(--Tight-colors-colorPalette-secondary-strong)"},"colors.colorPalette.action.opaque":{value:"var(--Tight-colors-colorPalette-action-opaque)",variable:"var(--Tight-colors-colorPalette-action-opaque)"},"colors.colorPalette.opaque":{value:"var(--Tight-colors-colorPalette-opaque)",variable:"var(--Tight-colors-colorPalette-opaque)"},"colors.colorPalette.action.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.opaque":{value:"var(--Tight-colors-colorPalette-success-opaque)",variable:"var(--Tight-colors-colorPalette-success-opaque)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.opaque":{value:"var(--Tight-colors-colorPalette-warning-opaque)",variable:"var(--Tight-colors-colorPalette-warning-opaque)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.opaque":{value:"var(--Tight-colors-colorPalette-danger-opaque)",variable:"var(--Tight-colors-colorPalette-danger-opaque)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discreet":{value:"var(--Tight-colors-colorPalette-intent-action-discreet)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet)"},"colors.colorPalette.action.discreet":{value:"var(--Tight-colors-colorPalette-action-discreet)",variable:"var(--Tight-colors-colorPalette-action-discreet)"},"colors.colorPalette.discreet":{value:"var(--Tight-colors-colorPalette-discreet)",variable:"var(--Tight-colors-colorPalette-discreet)"},"colors.colorPalette.intent.action.discreet.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discreet-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet-hover)"},"colors.colorPalette.action.discreet.hover":{value:"var(--Tight-colors-colorPalette-action-discreet-hover)",variable:"var(--Tight-colors-colorPalette-action-discreet-hover)"},"colors.colorPalette.discreet.hover":{value:"var(--Tight-colors-colorPalette-discreet-hover)",variable:"var(--Tight-colors-colorPalette-discreet-hover)"},"colors.colorPalette.intent.action.discreet.active":{value:"var(--Tight-colors-colorPalette-intent-action-discreet-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet-active)"},"colors.colorPalette.action.discreet.active":{value:"var(--Tight-colors-colorPalette-action-discreet-active)",variable:"var(--Tight-colors-colorPalette-action-discreet-active)"},"colors.colorPalette.discreet.active":{value:"var(--Tight-colors-colorPalette-discreet-active)",variable:"var(--Tight-colors-colorPalette-discreet-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.intent.danger.weak":{value:"var(--Tight-colors-colorPalette-intent-danger-weak)",variable:"var(--Tight-colors-colorPalette-intent-danger-weak)"},"colors.colorPalette.intent.danger.opaque":{value:"var(--Tight-colors-colorPalette-intent-danger-opaque)",variable:"var(--Tight-colors-colorPalette-intent-danger-opaque)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"colors.colorPalette.body":{value:"var(--Tight-colors-colorPalette-body)",variable:"var(--Tight-colors-colorPalette-body)"},"colors.colorPalette.label":{value:"var(--Tight-colors-colorPalette-label)",variable:"var(--Tight-colors-colorPalette-label)"},"colors.colorPalette.label.sub":{value:"var(--Tight-colors-colorPalette-label-sub)",variable:"var(--Tight-colors-colorPalette-label-sub)"},"colors.colorPalette.sub":{value:"var(--Tight-colors-colorPalette-sub)",variable:"var(--Tight-colors-colorPalette-sub)"},"colors.colorPalette.label.strong":{value:"var(--Tight-colors-colorPalette-label-strong)",variable:"var(--Tight-colors-colorPalette-label-strong)"},"colors.colorPalette.label.strongSub":{value:"var(--Tight-colors-colorPalette-label-strongSub)",variable:"var(--Tight-colors-colorPalette-label-strongSub)"},"colors.colorPalette.strongSub":{value:"var(--Tight-colors-colorPalette-strongSub)",variable:"var(--Tight-colors-colorPalette-strongSub)"},"colors.colorPalette.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"colors.colorPalette.heading":{value:"var(--Tight-colors-colorPalette-heading)",variable:"var(--Tight-colors-colorPalette-heading)"},"colors.colorPalette.metric.sm":{value:"var(--Tight-colors-colorPalette-metric-sm)",variable:"var(--Tight-colors-colorPalette-metric-sm)"},"colors.colorPalette.sm":{value:"var(--Tight-colors-colorPalette-sm)",variable:"var(--Tight-colors-colorPalette-sm)"},"colors.colorPalette.metric.md":{value:"var(--Tight-colors-colorPalette-metric-md)",variable:"var(--Tight-colors-colorPalette-metric-md)"},"colors.colorPalette.md":{value:"var(--Tight-colors-colorPalette-md)",variable:"var(--Tight-colors-colorPalette-md)"},"colors.colorPalette.metric.lg":{value:"var(--Tight-colors-colorPalette-metric-lg)",variable:"var(--Tight-colors-colorPalette-metric-lg)"},"colors.colorPalette.lg":{value:"var(--Tight-colors-colorPalette-lg)",variable:"var(--Tight-colors-colorPalette-lg)"},"colors.colorPalette.metric.xl":{value:"var(--Tight-colors-colorPalette-metric-xl)",variable:"var(--Tight-colors-colorPalette-metric-xl)"},"colors.colorPalette.xl":{value:"var(--Tight-colors-colorPalette-xl)",variable:"var(--Tight-colors-colorPalette-xl)"},"colors.colorPalette.layout.weak":{value:"var(--Tight-colors-colorPalette-layout-weak)",variable:"var(--Tight-colors-colorPalette-layout-weak)"},"colors.colorPalette.layout":{value:"var(--Tight-colors-colorPalette-layout)",variable:"var(--Tight-colors-colorPalette-layout)"},"colors.colorPalette.layout.strong":{value:"var(--Tight-colors-colorPalette-layout-strong)",variable:"var(--Tight-colors-colorPalette-layout-strong)"},"colors.colorPalette.positive":{value:"var(--Tight-colors-colorPalette-positive)",variable:"var(--Tight-colors-colorPalette-positive)"},"colors.colorPalette.positive.weak":{value:"var(--Tight-colors-colorPalette-positive-weak)",variable:"var(--Tight-colors-colorPalette-positive-weak)"},"colors.colorPalette.positive.strong":{value:"var(--Tight-colors-colorPalette-positive-strong)",variable:"var(--Tight-colors-colorPalette-positive-strong)"},"colors.colorPalette.negative":{value:"var(--Tight-colors-colorPalette-negative)",variable:"var(--Tight-colors-colorPalette-negative)"},"colors.colorPalette.negative.weak":{value:"var(--Tight-colors-colorPalette-negative-weak)",variable:"var(--Tight-colors-colorPalette-negative-weak)"},"colors.colorPalette.negative.strong":{value:"var(--Tight-colors-colorPalette-negative-strong)",variable:"var(--Tight-colors-colorPalette-negative-strong)"}};function Ra(e,t){return Pa[e]?.value||t}Ra.var=function(e,t){return Pa[e]?.variable||t};const Da=Qt(null,Ut({borderRadius:"50%",flexShrink:0})),Ma=Qt(null,Ut({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),La=Ra.var("colors.surface.foreground.disabled");function Oa({color:e=La,diameter:t=17,label:n}){return P("div",{...Ma,"data-testid":"bullet-row",children:[S("div",{...Da,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&S(Ia,{children:n})]})}const Fa=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function Ba({payload:e}){return void 0===e?null:S("div",{...Fa,children:e.map((e,t)=>"none"!==e.type&&S(Oa,{color:e.color,label:e.value,diameter:17},t))})}const Ua={right:20,left:20},Va=["income","profit","expenses","loss"],Wa=e=>Va.findIndex(t=>t===e.dataKey),Ha={paddingBottom:"20px",marginLeft:"-20px"},qa={stackId:"stack",isAnimationActive:!1},ja=Qt(zt["profit-loss-graph"],Ut({"& .recharts-surface":{outline:"none"}})),za=Ra.var("colors.money"),Ka=Ra.var("colors.border.layout"),Ya=Ra.var("colors.border.layout.strong"),_a={fill:Ra.var("colors.typography.base"),fontSize:Ra.var("fontSizes.metric.sm")},Za={profit:Ra.var("colors.money.positive.strong"),income:Ra.var("colors.money.positive.weak"),loss:Ra.var("colors.money.negative.strong"),expenses:Ra.var("colors.money.negative.weak")},Ga=[0,100],Qa=["auto","auto"];function Xa({data:e}){const[t,n]=y(!0);if(void 0===e)return null;const r=e.hasAnyData?Qa:Ga;return S(U,{width:"100%",height:"100%",...ja,children:P(V,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Ua,children:[S(W,{verticalAlign:"top",itemSorter:Wa,wrapperStyle:Ha,content:({payload:e})=>S(Ba,{payload:e})}),S(H,{strokeDasharray:"0",vertical:!1,stroke:Ka}),S(q,{dataKey:"month",interval:0,tickLine:!1,stroke:Ka,tick:_a}),S(j,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Ka,tick:_a,tickFormatter:e=>Ta(e)}),S(z,{content:({active:e,payload:t})=>S(Na,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),S(K,{name:"Profit",dataKey:"profit",fill:Za.profit,...qa}),S(K,{name:"Income",dataKey:"income",fill:Za.income,...qa}),S(K,{name:"Loss",dataKey:"loss",fill:Za.loss,...qa}),S(K,{name:"Expenses",dataKey:"expenses",fill:Za.expenses,...qa}),S(K,{dataKey:Xr,fill:Ka,legendType:"none",...qa}),S(Y,{y:0,stroke:Ya}),S(_,{dataKey:"netIncome",fill:za,stroke:za,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Ja=Ut({backgroundColor:"surface.elevated",borderRadius:"sm",backgroundImage:"linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)",backgroundSize:"400%",backgroundPosition:"100% 0",animation:"shimmer"});function $a({styles:e}){const t=Wt(Ja,e);return S("div",{className:t,"data-testid":"shimmer-block"})}const eo=Ut({width:"40%",minHeight:65});function to({children:e}){return P(N,{children:[S($a,{styles:eo}),S(ba,{children:e})]})}const no=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),ro=Ut({width:"80px",height:"17px",marginBottom:"10px"}),ao=Ut({width:"100%",height:"100%"});function oo(){return P(N,{children:[P("div",{...no,children:[S($a,{styles:ro}),S($a,{styles:ro}),S($a,{styles:ro}),S($a,{styles:ro})]}),S($a,{styles:ao})]})}const io=qt({base:{color:"typography.base.weak",boxSizing:"border-box",position:"absolute",bottom:"0",left:"0",right:"0",top:"0",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",margin:"0 auto",transform:"rotate(-20deg)",opacity:"80%"},variants:{size:{sm:{fontSize:"4em"},lg:{fontSize:"7em"},xl:{fontSize:"10em"}}}});function lo({size:e}){const t=io({size:e});return S("div",{className:t,children:"Sample"})}const so=20200,co=5043,uo=Object.freeze({income:so,expenses:co,netIncome:15157,absoluteSum:Math.abs(so)+Math.abs(co)}),ho=Object.freeze({total:co,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),po=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),go=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function mo({filter:e=hn.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return Qr({filter:e,grouping:t,select:ea})}({filter:e,grouping:"MONTHLY"}),a=t?function(){const e=[],t=/* @__PURE__ */new Date;let n=0,r=0,a=0;for(let o=11;o>=0;o--){const i=new Date(t.getFullYear(),t.getMonth()-o,1),l=Nn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=go[11-o],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),n+=c,r=Math.max(r,s.income),a=Math.max(a,s.expenses)}return{total:n,domain:[-a,r],months:e,hasAnyData:!0}}():n;return P(ia,{type:"chart",children:[S(na,{title:"Profit + Loss"}),S(aa,{children:r?S(to,{children:S(oo,{})}):P(N,{children:[S(ma,{title:Ta(a?.total??0),label:"Profit"}),S(ba,{children:S(Xa,{data:a})})]})}),t&&S(lo,{size:"xl"})]})}const vo=Qt(null,Ut({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function bo({children:e}){return S("div",{...vo,children:e})}const fo="conversations-section",yo="transactions-section",xo={MESSAGE_REVIEW:fo,TRANSACTION_REVIEW:yo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},ko={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},To={resolutionStatus:{in:["OPEN"]}},wo=[],Co=[];function Ao(e){return jr(`${t=e,Kr[t]}`,"v6");var t}const Eo={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},Io={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},So={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:Io.short.credentialsChanged,longMessage:Io.long.relinkCredentials,buttonType:Eo.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:Io.short.credentialsChanged,longMessage:Io.long.relinkCredentials,buttonType:Eo.RELINK},INVALID_MFA:{shortMessage:Io.short.credentialsChanged,longMessage:Io.long.relinkCredentials,buttonType:Eo.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:Io.short.credentialsChanged,longMessage:Io.long.invalidUpdatedUsername,buttonType:Eo.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:Io.short.accountLocked,longMessage:Io.long.accountLocked,buttonType:Eo.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:Io.short.credentialsChanged,longMessage:Io.long.relinkCredentials,buttonType:Eo.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:Io.short.supportChanged,longMessage:Io.long.supportChanged,buttonType:Eo.CHAT},USER_SETUP_REQUIRED:{shortMessage:Io.short.updateNeeded,longMessage:Io.long.updateNeeded,buttonType:Eo.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:Io.short.supportChanged,longMessage:Io.long.mfaUpdateNeeded,buttonType:Eo.OPEN_BANK},NO_ACCOUNTS:{shortMessage:Io.short.noAccountsAvailable,longMessage:Io.long.noAccountsUnlink,buttonType:Eo.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:Io.short.noAccountsAvailable,longMessage:Io.long.noAccountsUnlink,buttonType:Eo.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:Io.short.connectionError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},ITEM_NOT_FOUND:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},PRODUCT_NOT_READY:{shortMessage:Io.short.serverError,longMessage:Io.long.productNotReady,buttonType:Eo.CHAT},USER_PERMISSION_REVOKED:{shortMessage:Io.short.connectionError,longMessage:Io.long.permissionRevoked,buttonType:Eo.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:Io.short.temporarilyDown,longMessage:Io.long.bankMaintenance,buttonType:Eo.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:Io.short.serverDown,longMessage:Io.long.serverDown,buttonType:Eo.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:Io.short.temporarilyDown,longMessage:Io.long.bankMaintenance,buttonType:Eo.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:Io.short.supportChanged,longMessage:Io.long.supportChanged,buttonType:Eo.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:Io.short.connectionError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT},PLANNED_MAINTENANCE:{shortMessage:Io.short.temporarilyDown,longMessage:Io.long.bankConnectionMaintenance,buttonType:Eo.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:Io.short.requestError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:Io.short.inputError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:Io.short.volumeDown,longMessage:Io.long.bankMaintenance,buttonType:Eo.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:Io.short.serverError,longMessage:Io.long.connectionError,buttonType:Eo.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:Io.short.updateNeeded,longMessage:Io.long.partnerCredsChange,buttonType:Eo.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:Io.short.credentialsExpiring,longMessage:Io.long.credentialsExpiring,buttonType:Eo.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:Io.short.relinkNeeded,longMessage:Io.long.relinkForStatements,buttonType:Eo.RELINK}},DEFAULT:{DEFAULT:{shortMessage:Io.short.connectionError,longMessage:Io.long.connectionError,buttonType:Eo.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:Io.short.generic,longMessage:Io.long.generic,buttonType:Eo.CHAT}}};function No({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return Rr({error:new Error("No bank error provided. Should not get here"),severity:"error"}),So.DEFAULT.DEFAULT;const n=So[e];if(!n)return Rr({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),So.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(Rr({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),So.DEFAULT.DEFAULT)}const Po={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",shortDescription:"Link your bank to track every dollar",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function Ro(e,t=!0){const n=No({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName??"unknown"}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:n?.shortMessage(e.apiInstitutionName??"your bank")||"",description:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!1,apiPartnerName:""})||"",shortDescription:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!0,apiPartnerName:""})||"",type:n?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}function Do(e,t){const n=Hn(),r=Yn();return x(a=>{const o=Vn(n),i=o?{}:{retry:!1,staleTime:1/0};return zn.prefetchQuery({queryKey:Mn(e(a),n??"",r),queryFn:o?t:qn,...i})},[e,t,n,r])}const Mo=Object.freeze({}),Lo=Object.freeze({cursor:"FINAL_PAGE"});function Oo({queryKey:e,queryFn:t,...n}){const[r,a]=y(Mo),o=g(e);i(o.current,e)||(o.current=e,a(Mo));const l=n.select,s=Fn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=Ln(e,r),d=_n({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=m(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(Mo),getLastPage:()=>t(Lo),hasNextPage:Fn(e?.after),hasPreviousPage:Fn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=Do(x(t=>Ln(e,t),[e]),t),p=Do(x(t=>Ln(e,t),[e]),t);return k(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{Rr({error:e,severity:"error"})}),e.before&&p({cursor:e.before}).catch(e=>{Rr({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,p]),{...d,paginationControls:u}}function Fo({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=Mn(e,n,r);return zn.fetchQuery({queryKey:a,queryFn:t})}const Bo=e=>["integrations",e??{}],Uo=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ao(t[3].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Vo(e,t){return Oo({...t,queryKey:Bo(e),queryFn:Uo})}function Wo(e){return Vo({filter:{apiName:{equal:"PLAID"}}},e)}function Ho(){return Wo({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})})}function qo(){return Vo({filter:{status:{equal:"ACTIVE"}}},{select:e=>({multiAccountIntegrations:e.data?.filter(e=>["PLAID","UNIT"].includes(e.apiName))||[],integrations:e.data?.filter(e=>!["PLAID","UNIT"].includes(e.apiName))||[],cursor:e.cursor})})}function jo({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=Mn(e,n,r);return zn.prefetchQuery({queryKey:a,queryFn:t})}const zo=e=>["banks/accounts",e??{}],Ko=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ao(t[3].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Yo(e){const t=e?.params;return Oo({queryKey:t?zo(t):["banks/accounts",{}],queryFn:Ko,enabled:e?.enabled,select:e?.select})}function _o(e,t){return Fo({queryKey:Ln(["banks/accounts",{}],{}),queryFn:Ko,accessToken:e,environment:t})}function Zo(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function Go(e,t){return t?e?`${e} ${Zo(t)}`:Zo(t):e??""}const Qo={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Xo(e,t){return!Un(e)&&e.startsWith(t)}function Jo({id:e,prefix:t}){return void 0!==e?`${Qo[t]}_${e}`:""}function $o(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const ei=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,ti=e=>"PLAID"===e,ni=e=>e>0?"Deposited to":"Withdrawn from",ri=e=>({id:$o(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),ai=(e,t)=>e?.find(e=>e.glAccountId===t),oi=e=>{const{query:t}=Yo({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},ii=e=>{if(On(e))return!1;const t=e.filter(e=>ti(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||Fn(e.lastSyncedDate))},li=()=>{const e=Yo({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function si(){return Yo({select:e=>{return{...e,plaidItemAccountsReadyToSync:ii(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>ti(e.apiName)))};var t}})}function ci(e){return e?.filter(e=>ei(e.apiName)&&"ACTIVE"===e.status)}function di(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function ui(e){return Yo({select:t=>({...t,data:di(t?.data,e)})})}const hi={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},pi=e=>["tasks",e??{}],gi={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},mi={filter:{status:{in:["ACTIVE"]}}},vi=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:Ao(t[2].environment)},a=await Hr(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}};function bi(e,t){return _n({...e,queryKey:t?pi(t):["tasks",{}],queryFn:vi})}const fi=(e,t)=>{const n=On(r=e)||On(r.data)?[]:[...r.data].sort((e,t)=>gi[e.priority]-gi[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n};const yi=e=>{const t=xo[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},xi=v({}),ki=qt({base:{stroke:"currentColor"},variants:{primary:{DEFAULT:{stroke:"icon.intent.primary"},hover:{stroke:"icon.intent.primary.hover"},active:{stroke:"icon.intent.primary.active"}},secondary:{DEFAULT:{stroke:"icon.intent.secondary"},hover:{stroke:"icon.intent.secondary.hover"},active:{stroke:"icon.intent.secondary.active"}},success:{DEFAULT:{stroke:"icon.intent.success"},hover:{stroke:"icon.intent.success.hover"},active:{stroke:"icon.intent.success.active"}},warning:{DEFAULT:{stroke:"icon.intent.warning"},hover:{stroke:"icon.intent.warning.hover"},active:{stroke:"icon.intent.warning.active"}},danger:{DEFAULT:{stroke:"icon.intent.danger"},hover:{stroke:"icon.intent.danger.hover"},active:{stroke:"icon.intent.danger.active"}},action:{DEFAULT:{stroke:"icon.intent.action"},hover:{stroke:"icon.intent.action.hover"},active:{stroke:"icon.intent.action.active"}}}});function Ti(e,t,n){const r=({size:r=24,fill:a="transparent",stylists:o})=>{const{icons:i}=b(xi),l=n?.styleIconKey?i?.[n.styleIconKey]:void 0,s=tn([Qt(null,ki()),...o]);return l?S("img",{src:l,alt:t,width:r,height:r,style:{minHeight:r,minWidth:r},className:Ut({objectFit:"contain"})}):S(e,{...s,style:{minHeight:r,minWidth:r},width:r,height:r,fill:a})};return r.displayName=t,r}const wi=Ti(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10,transform:"scale(-1, 1) translate(-13, 0)"})),"ArrowLeft"),Ci=Ti(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),Ai=Ut({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),Ei=Ut({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),Ii=Ut({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});Ut({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}}),Ut({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}});const Si=v({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Ni({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["small-icon"],zt.icon),...t??[]],size:12})}const Pi=Qt(zt["pagination-button"],Ut({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{xl:"35px",base:"44px"},gap:0})),Ri=Qt(null,Ut({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discreet",padding:{xl:"4px",base:"12px"},margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",boxShadow:"0 0 0 0 transparent","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{opacity:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}}),Ei),Di=Qt(null,Ut({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center",width:{xl:"100%",base:"44px"}})),Mi=Qt(null,Ut({height:{xl:"12px",base:"20px"},width:{xl:"12px",base:"20px"}}));function Li(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=b(Si);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return P("div",{...Pi,children:[S("div",{...Di,children:S("button",{...Ri,onClick:r,disabled:!t,children:S(Ni,{Component:wi,stylists:[Mi]})})}),S("div",{...Di,children:S("button",{...Ri,onClick:n,disabled:!e,children:S(Ni,{Component:Ci,stylists:[Mi]})})})]})}const Oi=Ut({width:"100%",height:"50px"});function Fi(){return S($a,{styles:Oi})}const Bi=Qt(zt["dashboard-placeholder-table"],Ut({display:"flex",flexDirection:"column",gap:"4px"})),Ui=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Vi=Ut({width:"100px",height:"20px"});function Wi({numColumns:e=6}){return P("div",{...Bi,children:[S("div",{...Ui,children:Array.from({length:e},(e,t)=>S($a,{styles:Vi},t))}),S(Fi,{}),S(Fi,{}),S(Fi,{}),S(Fi,{}),S(Fi,{}),S(Fi,{})]})}async function Hi({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=Or({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let n=e;const r=null==(a=t)?"":Object.entries(a).map(([e,t])=>{let n;return n=Array.isArray(t)?t.map(t=>Lr(e,t)).join("&"):Lr(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});Pr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return Pr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),Fr(e)}catch(s){return Promise.reject(s)}}async function qi(e){const{url:t,headers:n}=Ur(e);return Hi({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function ji(e){return qi({...e,endpointManager:Ao(e.environment)})}async function zi(e){return qi({...e,endpointManager:_r(e.environment)})}function Ki({delay:e,callback:t}){const n=m(()=>function({delay:e,callback:t}){let n;const r=()=>{n&&(clearTimeout(n),n=void 0)};return{startCallback:a=>{r(),n=setTimeout(()=>{t(a)},e)},cancelCallback:()=>r()}}({delay:e,callback:t}),[e,t]);return k(()=>()=>{n.cancelCallback()},[n]),{startCallback:x(e=>{n.startCallback(e)},[n]),cancelCallback:x(()=>{n.cancelCallback()},[n])}}function Yi({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=Ki({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const _i={CREATED_DATE_TIME:"CREATED_DATE_TIME",SUBJECT:"SUBJECT",EMAIL:"EMAIL",LAST_MESSAGE_CREATED_DATE_TIME:"LAST_MESSAGE_CREATED_DATE_TIME",LAST_MESSAGE_TEXT:"LAST_MESSAGE_TEXT"},Zi={ASC:"ASC",DESC:"DESC"},Gi=e=>["conversations",e??{}],Qi=e=>["conversations","conversation",e],Xi=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ao(t[3].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Ji(e){return Oo({queryKey:e?Gi(e):["conversations",{}],queryFn:Xi})}const $i=async e=>{const t=e.queryKey,{id:n}=t[2],r={path:"/v6/conversations/{id}",pathParams:{id:n},accessToken:t[3].accessToken,environment:t[3].environment},a=await ji(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function el(e){const t=Fn(e);return _n({queryKey:Qi({id:e??""}),queryFn:$i,enabled:t})}const tl=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:Ao(n)};return await Hr(r)};function nl(){return Yi({prefetchFn:Do(Qi,$i)})}function rl(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function al({header:e}){const t=rl(e.column);return S("div",{...Qt(zt["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:Z(e.column.columnDef.header,e.getContext())})}const ol=Qt(zt["dashboard-table-header"],Ut({display:"flex",flexDirection:"row",alignItems:"center"}));function il({headerGroups:e}){return S("div",{children:e.map(e=>T("div",{...ol,key:e.id},e.headers.map(e=>S(al,{header:e},e.id))))})}const ll=Qt(zt["dashboard-table-body"],Ut({display:"flex",flexDirection:"column"}));function sl({children:e}){return S("div",{...ll,children:e})}function cl({cell:e,onCellClick:t}){const n=rl(e.column),r=Qt(zt["dashboard-table-cell"],Ut({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),a=Qt(null,Ut({display:"flex",flexDirection:"row",height:"100%"}));return S("div",{...a,style:n,onClick:()=>{t&&t(e)},children:S("div",{style:n,...r,children:Z(e.column.columnDef.cell,e.getContext())})})}const dl=Qt(zt["table-sub-row"],Ut({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function ul({rowData:e,onCellClick:t}){const n=e.getVisibleCells();return S("div",{...dl,children:n.map(e=>S(cl,{cell:e,onCellClick:t,isChild:!0},e.id))})}const hl=Ut({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content",_hover:{backgroundColor:"brand.action.opaque"}}),pl=Ut({background:"surface.background"}),gl=Qt(zt["table-row"],Ut({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{base:"85px",xl:"60px"},minWidth:"fit-content"}));function ml({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=Qt(zt["table-parent-row"],hl,e.index%2==0?pl:void 0),l=e.getVisibleCells();return P("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[S("div",{...gl,children:l.map(e=>S(cl,{cell:e,onCellClick:r},e.id))}),o&&S("div",{children:e.subRows.map(e=>S(ul,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const vl=(e,t={})=>{Xe.getState().openDrawer(e,t)},bl=()=>{Xe.getState().requestCloseDrawer()},fl=[{name:"One-Time Expense",value:"ONE_TIME"},{name:"Weekly Recurring Expense",value:"WEEKLY"},{name:"Monthly Recurring Expense",value:"MONTHLY"},{name:"Yearly Recurring Expense",value:"YEARLY"}],yl={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},xl={ASC:"ASC",DESC:"DESC"},kl=e=>["banks/transactions",e??{}],Tl=e=>["banks/transactions",e.id],wl=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ao(t[3].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Cl(e,t){return Oo({queryKey:kl(e),queryFn:wl,...t})}const Al=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await ji(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function El({id:e}){return _n({queryKey:Tl({id:e}),queryFn:Al})}function Il(){return Yi({prefetchFn:Do(Tl,Al)})}const Sl=e=>["conversations/messages",e];function Nl(e){if(On(e)||0===e.length)return null;const t=[[e[0]]];for(let n=1;n<e.length;n++){const r=e[n],a=t[t.length-1],o=a[0].author.userId;r.author.userId===o?a.push(r):t.push([r])}return t}const Pl=async e=>{const t=e.queryKey,{id:n}=t[1],r={path:"/v6/conversations/{id}/messages",pathParams:{id:n},accessToken:t[2].accessToken,environment:t[2].environment},a=await ji(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Rl=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:Ao(n),accessToken:t};return await Hr(r)};function Dl(){return Yi({prefetchFn:Do(Sl,Pl)})}const Ml=e=>["summaries",e??{}],Ll=e=>["summaries",e.id],Ol=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:Ao(t[2].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const Fl=async e=>{const t=e.queryKey,n={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await ji(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Bl({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=nl(),{startPrefetch:a,cancelPrefetch:o}=Dl(),{startPrefetch:i,cancelPrefetch:l}=Il(),{startPrefetch:s,cancelPrefetch:c}=Yi({prefetchFn:Do(Ll,Fl)}),d=x(()=>{Fn(e.original.attachedEntityId)&&Xo(e.original.attachedEntityId,Qo.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Fn(e.original.attachedEntityId)&&Xo(e.original.attachedEntityId,Qo.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),a({id:e.original.id}),n({id:e.original.id})},[e.original.attachedEntityId,e.original.id,a,n,i,s]),u=x(()=>{Fn(e.original.attachedEntityId)&&Xo(e.original.attachedEntityId,Qo.BANK_TRANSACTION)?l():Fn(e.original.attachedEntityId)&&Xo(e.original.attachedEntityId,Qo.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return S(ml,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?vl("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Fn(t)?Xo(t,Qo.BANK_TRANSACTION)?vl("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Xo(t,Qo.FINANCIAL_SUMMARY)&&(r=e,a=t,vl("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){vl("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const Ul=Ti(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Vl=Ut({display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",borderRadius:"md","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout",outlineOffset:"-1px"},"&:disabled":{cursor:"not-allowed",opacity:.6}}),Wl=Ut({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discreet",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discreet.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discreet.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),Hl=Ut({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),ql=Ut({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),jl=Ut.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discreet",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discreet.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discreet.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),zl=qt({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%",height:"100%"}}}}),Kl={default:Hl,small:ql},Yl=e=>{const t=Kl[e];return Qt(zt["button-base"],t,Vl,Ai)},_l=["default","small"],Zl={default:{className:""},small:{className:""}};for(const yN of _l)Zl[yN]=Yl(yN);const Gl=w(function({children:e,stylists:t=[],type:n="button",onClick:r,disabled:a,size:o="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=tn([Zl[o],Qt(null,zl({width:i})),...t]);return S("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),Ql=Qt(zt["button-primary"],Wl),Xl=w(function({children:e,active:t,stylists:n=[],width:r,...a},o){return S(Gl,{ref:o,stylists:[Ql,...n],active:t,width:r,...a,children:e})}),Jl=()=>{vl("Conversation",{routeProps:{conversationId:null}})},$l=Qt(zt["small-square-button"],void 0),es=Ut({width:{xl:"auto",base:"44px"},height:{xl:"auto",base:"44px"}});function ts(){return S("div",{className:es,children:S(Xl,{stylists:[$l],onClick:Jl,width:"fill-parent",children:S(Ni,{Component:Ul})})})}const ns=qt({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"16px",border:{base:"none",xl:"{borderWidths.lg} solid {colors.border.layout}"},borderRadius:{base:"zero",xl:"lg"}}}}});function rs({children:e,dashboard:t}){const n=Qt(zt["dashboard-table"],ns({dashboard:t}));return S("div",{...n,children:e})}const as=v(null),os="mobile",is=qt({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"},flexEnd:{alignItems:"flex-end"}}},defaultVariants:{alignVariant:"flexStart"}});function ls({children:e,alignVariant:t="flexStart"}){const n=Qt(null,is({alignVariant:t}));return S("div",{...n,children:e})}const ss=qt({base:{fontWeight:"label",fontSize:"lg",fontFamily:"label",lineHeight:"18px",letterSpacing:"0.84px",maxWidth:"100%",xl:{lineHeight:"16px",fontSize:"label"}},variants:{intent:{weak:{color:"typography.base.weak"},default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:sa,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function cs({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left",extraClassNames:a=[]}){const o=Qt(zt.label,zt.text,Ut(ss.raw({intent:t,wrap:n,alignment:r}),a));return Un(e)?null:S("div",{title:"ellipsis"===n?e:void 0,...o,children:e})}const ds={"sm-sm":Qt(zt.text,Ut({fontSize:{xl:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la),"sm-med":Qt(zt.text,Ut({fontSize:{xl:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la),"sm-lg":Qt(zt.text,Ut({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la),"med-sm":Qt(zt.text,Ut({fontSize:{xl:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la),"med-med":Qt(zt.text,Ut({fontSize:{xl:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la),"med-lg":Qt(zt.text,Ut({fontSize:{xl:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),la)};function us({children:e,size:t,weight:n,stylists:r=[]}){const a=tn([ds[`${t}-${n}`],...r]);return S("div",{title:e,...a,children:e})}const hs=Qt(zt["emphasis-label"],Ut({lineHeight:"16px"}));function ps({children:e}){return S(us,{size:"med",weight:"lg",stylists:[hs],children:e})}function gs({text:e,isRead:t}){return S(t?cs:ps,{children:e})}function ms({date:e,isRead:t=!1}){const n=Pn(e);return S(gs,{text:n,isRead:t})}const vs=Qt(zt["strong-sub-label"],nn({label:"strongSubLabel"}));function bs({children:e,stylists:t=[]}){return Un(e)?null:S(us,{size:"sm",weight:"med",stylists:[vs,...t],children:e})}const fs=v(null),ys=Ut({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),xs=Ut({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:"none",backgroundColor:"surface.foreground",minWidth:{base:"100%"},boxShadow:{sm:"none"},minHeight:{sm:"35px"},height:{sm:"fit-content"},flexShrink:{sm:0},textAlign:{sm:"start"},"&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discreet.hover"}}),ks=Qt(zt["selector-row"],xs);function Ts(e,t,n){const[r,a]=y(e);return[t??r,n??a]}function ws({children:e}){return null===de()?S(ue,{children:e}):e}function Cs({children:e,modal:t=!1,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:n=0,modal:r,open:a,onOpenChange:o,enableClickMiddleware:i=!0}={}){const[l,s]=y(),[c,d]=y(),[u,h]=Ts(e,a,o),p=$(),g=ee({placement:t,open:u,nodeId:p,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||h(e)},whileElementsMounted:oe,middleware:[te(n),ne({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),re({padding:8}),ae({apply({availableHeight:e,elements:t}){let n=e;if(e<314){const t=37*Math.floor(e/37)-18.5;n=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${n}px`,overflowY:"auto"})},padding:8})]}),v=g.context,b=ie(v,{enabled:i}),f=le(v,{bubbles:{escapeKey:!0}}),k=se(v),T=ce([b,f,k]),w=x(()=>h(!1),[h]);return m(()=>({open:u,setOpen:h,close:w,...T,...g,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,w,T,g,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=de(),u=l&&null===d,h=c.nodeId;return S(ws,{children:S(he,{id:h,children:S(fs.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function As(){const e=b(fs);if(On(e))throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Es({children:e}){const t=As(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return S(N,{children:e(a)})}const Is=Ti(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),p.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Ss({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["tiny-icon"],zt.icon),...t??[]],size:9})}const Ns=Ti(e=>p.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),Ps=Qt(null,Ut({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discreet.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discreet.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Ai),Rs=Qt(null,Ut({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Ds=Qt(null,Ut({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",padding:0,margin:"6px 6px 6px 5px",border:"none",outline:"none",position:"relative",cursor:"pointer","&::before":{content:"''",position:"absolute",top:"-9px",right:"-7px",bottom:"-9px",left:"-5px"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),Ms=Qt(null,Ut({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function Ls({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return P("div",{...Ps,"data-active":a,children:[P("button",{...Rs,...r,children:[S(bs,{children:t}),!a&&S("div",{...Ms,children:S(Ss,{Component:Ns})})]}),a&&S("button",{...Ds,onClick:e,children:S(Ss,{Component:Is})})]})}const Os=qt({base:{borderColor:"border.layout",background:"surface.foreground",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function Fs({initialFocus:e=!0,style:t,ref:n,type:r,forceMount:a,...o}){const{context:i,blockInteraction:l,...s}=As(),c=pe([s.refs.setFloating,n]),d=Qt(zt.popup,Os({type:r}));return a||i.open?P(N,{children:[l&&S(ge,{lockScroll:!0}),S(me,{children:S(ve,{context:i,modal:s.modal,initialFocus:e?void 0:-1,children:S("div",{ref:c,...d,style:{...s.floatingStyles,...t},...s.getFloatingProps(o),"aria-labelledby":s.labelId,"aria-describedby":s.descriptionId,children:o.children})})})]}):null}const Bs=Qt(zt["popup-sort-row"],Ut({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function Us({onClick:e,children:t,active:n}){return S("button",{onClick:e,...Bs,children:S(Ia,{accent:n?"active":"action",children:t})})}const Vs=Qt(null,Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Ws=Qt(null,Ut({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function Hs({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=As(),i=e=>{r(e),o.close()},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return P("div",{...Vs,children:[S(bs,{stylists:[Ws],children:"Sort by:"}),S(Us,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),S(Us,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const qs=Ut.raw(jl,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function js({extraClassNames:e,children:t,active:n,disabled:r,onClick:a,popupTriggerProps:o,ariaLabel:i,ariaExpanded:l}){const[s,c]=y(!1),d=Qt(zt["button-discreet-small"],Ut(qs,e),Ai),u=n??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return S("button",{type:"button",...d,onClick:e=>{void 0===u&&c(!s),a&&a(e)},"data-active":u??s,disabled:r,...o,"aria-label":i,"aria-expanded":l,children:t})}const zs={minWidth:"140px"};function Ks({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=b(as);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(Ls,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),S(Fs,{style:zs,children:S(Hs,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):S(js,{disabled:!0,children:S(bs,{children:e})})}const Ys=qt({base:{display:"flex",width:"100%"},variants:{align:{left:{justifyContent:"flex-start"},center:{justifyContent:"center"},right:{justifyContent:"flex-end"}},padding:{none:{},default:{},large:{}}},compoundVariants:[{align:"left",padding:"none",css:{paddingLeft:"0"}},{align:"left",padding:"default",css:{paddingLeft:"19px"}},{align:"left",padding:"large",css:{paddingLeft:"33px"}},{align:"right",padding:"none",css:{paddingRight:"0"}},{align:"right",padding:"default",css:{paddingRight:"19px"}},{align:"right",padding:"large",css:{paddingRight:"33px"}}],defaultVariants:{align:"left",padding:"default"}});function _s({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r,align:a="left",padding:o="default"}){return S("div",{className:Ys({align:a,padding:o}),children:S(Ks,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const Zs="Oldest to Newest",Gs="Newest to Oldest";const Qs=v({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0,clientId:void 0,useStripeInvoicePaymentProcessing:void 0,hasPayroll:void 0,hasShopify:void 0,hasSquare:void 0,unitIntegrationBankName:null});function Xs({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=b(Qs);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),S(gs,{text:a,isRead:t})}const Js=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.94389 13.9144L13.4056 8.12309C14.1306 7.18143 14.4519 5.9904 14.299 4.81186C14.1461 3.63332 13.5313 2.56376 12.59 1.83834C12.1329 1.45727 11.602 1.17479 11.0306 1.00865C10.4592 0.842499 9.85956 0.796265 9.26942 0.872849C8.67928 0.949432 8.11133 1.14718 7.60124 1.45368C7.09115 1.76017 6.64993 2.16881 6.30526 2.65392L1.26787 9.15798C-0.0274639 10.7069 0.993722 12.5848 2.14513 13.4895C2.76204 13.9899 3.55149 14.2266 4.34198 14.1484C5.13247 14.0701 5.86015 13.6831 6.36694 13.0714L11.3769 6.56732C11.531 6.3676 11.6442 6.13944 11.7101 5.89592C11.7759 5.6524 11.7931 5.39829 11.7606 5.14812C11.7282 4.89795 11.6467 4.65664 11.5209 4.43799C11.395 4.21934 11.2274 4.02764 11.0274 3.87386C10.6233 3.56441 10.1132 3.42748 9.60854 3.49297C9.10385 3.55846 8.6456 3.82107 8.33392 4.22339L4.10525 9.70627",strokeMiterlimit:10})),"Attachment"),$s=Qt(zt.text,Ut({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),la);function ec({children:e,stylists:t=[]}){const n=tn([$s,...t]);return S("div",{...n,children:e})}const tc=qt({base:{display:"flex",gap:8,border:"none",borderBottom:"1px solid",borderBottomColor:"border.layout.weak",borderRadius:0,padding:0,width:"100%",height:"100%",cursor:"pointer",alignItems:"stretch"},variants:{isRead:{true:{backgroundColor:"transparent"},false:{backgroundColor:"surface.background"}}}}),nc=Wt(Ut({display:"flex",flex:1,flexDirection:"column",alignItems:"start",justifyContent:"center",gap:"4px",maxWidth:"100%",paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"}),la),rc=Ut({display:"flex",flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between",width:"100%"}),ac=Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end"}),oc=Ut({display:"flex",alignItems:"center",gap:8}),ic=Ut({display:"flex",alignItems:"center",gap:"4px",maxWidth:"100%"}),lc=Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:4,maxWidth:"100%"}),sc=Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4}),cc=Ut({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function dc({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return S("button",{className:tc({isRead:a}),onTouchEnd:o,children:P("div",{className:nc,children:[P("div",{className:lc,children:[!a&&S("div",{className:cc}),S(gs,{text:t,isRead:a})]}),P("div",{className:rc,children:[S("div",{className:sc,children:S(Xs,{authorUserId:e,isRead:a})}),P("div",{className:oc,children:[S("div",{className:ac,children:S(ms,{date:n,isRead:a})}),a?S(Ni,{Component:Ci}):S(ec,{children:S(Ni,{Component:Ci})})]})]}),S("div",{className:ic,children:Un(r)?P(N,{children:[S(Ni,{Component:Js}),S(cs,{children:"Shared a file"})]}):S(cs,{children:r})})]})})}const uc=Ut({display:"flex",alignItems:"center",flexDirection:"row",gap:"4px"}),hc=Ut({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function pc({text:e,isRead:t}){return t?S(cs,{children:e}):P("div",{className:uc,children:[S("div",{className:hc}),S(ps,{children:e})]})}const gc=G(),mc=Qt(null,Ut({paddingLeft:"25px"})),vc=[gc.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>S(ls,{children:S(Xs,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>S(bs,{stylists:[mc],children:"From"}),size:160,maxSize:160}),gc.accessor("subject",{id:"subject",cell:({row:e})=>P(ls,{children:[S(pc,{text:e.original.subject,isRead:"READ"===e.original.readStatus}),S(cs,{children:e.original.latestMessage.text})]}),header:()=>S(bs,{stylists:[mc],children:"Subject"}),size:200}),gc.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>S(ls,{children:S(ms,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>S(_s,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:Gs,sortAscDisplay:Zs}),size:150,maxSize:150}),gc.display({id:os,cell:({row:e})=>S(dc,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function bc(e){return e?vc.filter(e=>e.id===os):vc.filter(e=>e.id!==os)}const fc=[],yc=Ut({display:"flex",flexDirection:"column",height:"250px",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),xc=Qt(zt["empty-dashboard-layout"],yc);function kc({children:e}){return S("div",{...xc,"data-testid":"empty-dashboard-layout",children:e})}function Tc({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["large-icon"],zt.icon),...t??[]],size:25})}const wc=e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),Cc=Ti(wc,"MessageIcon",{styleIconKey:"message"}),Ac=()=>{vl("Conversation",{routeProps:{conversationId:null}})};function Ec(){return P(N,{children:[S(Tc,{Component:Cc}),S(Aa,{wrap:"wrap",children:"Need help with your financials?"}),S(Xl,{onClick:Ac,children:S(Aa,{children:"Talk to a bookkeeper"})})]})}const Ic=Ti(wc,"Paperplane",{styleIconKey:"send"});function Sc(){return P(N,{children:[S(Tc,{Component:Ic}),S(Aa,{wrap:"wrap",children:"All caught up"}),S(Ia,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Nc=Qt(null,Ut({display:"flex",flexDirection:"row",gap:"5px"}));function Pc({children:e}){return S("div",{...Nc,children:e})}const Rc=qt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Dc(e){return S(e?Sc:Ec,{})}function Mc({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return Q({data:e??fc,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??fc.length,columns:bc(t),getCoreRowModel:X(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=Ji({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!On(l?.data?.[0])&&!s;return P("div",{className:Rc({isMobile:o}),children:[S("div",{id:fo}),P(Si.Provider,{value:r,children:[P(Jt,{children:[S(an,{children:"Conversations"}),P(Pc,{children:[S(Li,{}),S(ts,{})]})]}),S(rs,{dashboard:"businessOwnerDashboard",children:a?S(Wi,{numColumns:4}):P(N,{children:[!o&&S(as.Provider,{value:{sortInstance:e,setSortInstance:t},children:S(il,{headerGroups:i.getHeaderGroups()})}),n.length>0?S(sl,{children:i.getRowModel().rows.map(e=>S(Bl,{rowData:e,isMobile:o},e.id))}):S(kc,{children:Dc(c)})]})})]})]})}const Lc=Qt(zt.body,nn({body:"default"}));function Oc({children:e,stylists:t=[]}){if(Un(e))return null;const n=tn([Lc,...t]);return S("div",{...n,children:e})}const Fc=Qt(null,Ut({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),Bc=qt({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),Uc=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Vc(){return S("div",{...Fc,children:Uc.map((e,t)=>S($a,{styles:Bc({width:e?.width})},t))})}const Wc=Ti(e=>p.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment",{styleIconKey:"comment"}),Hc=Ut({position:"absolute",top:"-1",right:"-1",width:"10",height:"10",borderRadius:"999px",backgroundColor:"surface.intent.warning",boxShadow:"0 0 0 1px {colors.border.intent.warning}"}),qc=Ut({position:"relative",width:"25px",height:"25px"});function jc({hasUnread:e}){return P("div",{className:qc,children:[S(Tc,{Component:Wc}),e&&S("div",{"data-testid":"unread-comment-badge",className:Hc,"aria-hidden":"true"})]})}const zc=Qt(zt["financial-summary-chatbox-header"],Ut({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout}",boxSizing:"border-box"}));function Kc({hasUnreadMessages:e=!1,showMessageIndicator:t}){return P("div",{...zc,children:[S(Aa,{children:"Message Bookkeeper"}),t&&S(jc,{hasUnread:e})]})}const Yc=Ut({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function _c(){return P("div",{className:Yc,children:[S(Tc,{Component:Ic}),S(Aa,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),S(Ia,{wrap:"wrap",children:"In the meantime, ask about your financial trends."}),S(Xl,{onClick:()=>vl("Conversation"),children:S(Aa,{children:"Send a message"})})]})}const Zc=Ut({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Gc({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=nl(),{startPrefetch:a,cancelPrefetch:o}=Dl(),i=x(()=>{a({id:t}),n({id:t})},[t,a,n]),l=x(()=>{o(),r()},[o,r]);return P("div",{className:Zc,children:[S(Tc,{Component:Ic}),S(Aa,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),S(Ia,{wrap:"wrap",children:"Pick up where you left off."}),S(Xl,{onClick:()=>vl("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:S(Aa,{children:"Continue conversation"})})]})}const Qc=Ut({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Xc({summaryId:e}){return P("div",{className:Qc,children:[S(Tc,{Component:Ic}),S(Aa,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),S(Ia,{wrap:"wrap",children:"Your bookkeeper will respond here."}),S(Xl,{onClick:()=>vl("FinancialSummary",{routeProps:{summaryId:e}}),children:S(Aa,{children:"Talk to a bookkeeper"})})]})}function Jc({summaryId:e,conversationId:t}){const n=Fn(t);return On(e)?S(_c,{}):n?S(Gc,{conversationId:t,summaryId:e}):S(Xc,{summaryId:e})}const $c=Ut({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),ed=Qt(zt["financial-summary-chatbox"],Ut({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"}));function td({summaryData:e}){const t=Fn(e?.summary),n=Fn(e?.conversation);return P("div",{className:$c,children:[S(Kc,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),S("div",{...ed,children:S(Jc,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const nd=Ut({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),rd=qt({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),ad=Qt(null,Ut({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),od=Ut({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function id({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},_n({queryKey:(t={limit:1,filter:{date:{equal:dn(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Ml(t):["summaries",{}],queryFn:Ol,...n});var t,n}(t),a=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${so.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${co.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility.`}():n?.summary??"A summary of this month's financials will appear here once more data is available.",o=Qt(zt["financial-summary-layout"],rd({isSample:e}));return P("div",{className:od,children:[S("div",{"data-testid":"financial-summary-layout",...o,children:!e&&r?S(Vc,{}):P("div",{className:nd,children:[S(Oc,{stylists:[ad],children:a}),e&&S(lo,{size:"lg"})]})}),S(td,{summaryData:n})]})}const ld=Qt(zt["month-picker"],Ut({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),sd=Qt(zt["month-picker-left-button"],Ut({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),cd=Qt(zt["month-picker-right-button"],Ut({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),dd=Qt(zt["month-picker-label"],Ut({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function ud({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=ln(e.year,e.month,1),o=Nn(a,{abbreviateMonth:!0});return P("div",{...ld,children:[S(Xl,{stylists:[sd],onClick:()=>{return t(0===(n=e).month?{month:11,year:n.year-1}:{month:n.month-1,year:n.year});var n},disabled:r,children:S(Ni,{Component:wi})}),S("div",{...dd,children:S(Aa,{children:o})}),S(Xl,{stylists:[cd],onClick:()=>{return t(11===(n=e).month?{month:0,year:n.year+1}:{month:n.month+1,year:n.year});var n},disabled:n,children:S(Ni,{Component:Ci})})]})}const hd=Ut({display:"flex",flexWrap:"wrap",justifyContent:"center",rowGap:"10px",columnGap:"max(10px, calc(50% - 600px))",maxWidth:"1440px",width:"100%"});function pd({children:e}){return S("div",{className:hd,children:e})}const gd=qt({variants:{color:{positive:{backgroundColor:"money.positive.weak"},negative:{backgroundColor:"money.negative.weak"}}}}),md=Qt(zt["progress-bar"],Ut({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),vd=Qt(zt["progress-bar-fill"],Ut({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),bd=Qt(zt["tile-bar-label"],Ut({paddingLeft:"10px"})),fd=Qt(zt["tile-bar-label-outer"],Ut({paddingLeft:"10px"}));function yd({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i="positive"===n?zt["bar-transactions-positive"]:zt["bar-transactions-negative"],l=Qt(i,gd({color:n})),s=tn([vd,l]);return P("div",{...md,style:{width:a},children:[S("div",{...s,style:{width:`${t}%`},children:o&&S("div",{...bd,children:S(cs,{children:e})})}),!o&&S("div",{...fd,children:S(cs,{children:e})})]})}const xd=Qt(zt["metric-md"],nn({metric:"md"}));function kd(e){return S("div",{...xd,children:e.children})}const Td=Qt(null,Ut({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),wd=Qt(null,Ut({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),Cd=({label:e,amount:t,total:n,color:r})=>{const a=n>0?function(e,t,n,r=0,a=100){return r+(e-t)*(a-r)/(n-t)}(t,0,n):0;return P("div",{...Td,children:[S(yd,{label:e,percentage:a,color:r}),S("div",{...wd,children:S(kd,{children:Ta(t)})})]})},Ad={netIncome:0,income:0,expenses:0,absoluteSum:0},Ed=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return Ad;const t=e.json?.data?.[0];if(On(t))return Ad;const n=t.income?.total??0,r=t.expenses?.total??0,a=B(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Id=Ti(e=>p.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),p.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),p.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),p.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Sd({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["medium-icon"],zt.icon),...t??[]],size:15})}const Nd={},Pd=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Nd[e]={loading:!1,error:null,scriptEl:t}},Rd="undefined"!=typeof window&&void 0!==window.document;function Dd({src:e,checkForExisting:t=!1,...n}){let r=Nd[e];!r&&t&&e&&Rd&&(r=Pd(e));const[a,o]=y(r?r.loading:Boolean(e)),[i,l]=y(r?r.error:null),[s,c]=y(!1);return k(()=>{if(!Rd||!e||s||i)return;let a;r=Nd[e],!r&&t&&(r=Pd(e)),r?a=r.scriptEl:(a=document.createElement("script"),a.src=e,Object.keys(n).forEach(e=>{void 0===a[e]?a.setAttribute(e,n[e]):a[e]=n[e]}),r=Nd[e]={loading:!0,error:null,scriptEl:a});const d=()=>{r&&(r.loading=!1),o(!1),c(!0)},u=e=>{r&&(r.error=e),l(e)};return a.addEventListener("load",d),a.addEventListener("error",u),document.body.appendChild(a),()=>{a.removeEventListener("load",d),a.removeEventListener("error",u),r&&r.loading&&(a.remove(),delete Nd[e])}},[e]),[a,i]}function Md(e){return jr(`${t=e,zr[t]}/v1`,"v1");var t}async function Ld({institutionId:e,accessToken:t,environment:n}){if(!t)throw new Error("Access token is required to get Plaid item institution");const r={path:"/banks2/bankUrl",accessToken:t,endpointManager:Md(n)},{url:a,headers:o}=Ur(r);return await Hi({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const Od=Qt(zt["button-danger"],Ut({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-text":{color:"typography.intent.danger.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.danger.active",borderColor:"border.intent.danger.active","& .Tight-text":{color:"typography.intent.danger.active"}},"& .Tight-text":{color:"typography.intent.danger"}}));function Fd({children:e,stylists:t=[],...n}){return S(Gl,{stylists:[Od,...t],...n,children:e})}const Bd=Qt(zt["button-tertiary"],Ut({color:"typography.intent.success",border:"{borderWidths.md} solid",borderColor:"border.intent.success",backgroundColor:"surface.intent.success","& .Tight-text":{color:"typography.intent.success"},"& path":{stroke:"icon.intent.success"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-text":{color:"typography.intent.success.hover"},"& path":{stroke:"icon.intent.success.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.success.active",borderColor:"border.intent.success.active","& .Tight-text":{color:"typography.intent.success.active"},"& path":{stroke:"icon.intent.success.active"}}}));function Ud({children:e,stylists:t=[],...n}){return S(Gl,{stylists:[Bd,...t],...n,children:e})}const Vd="cancel",Wd="danger",Hd="success",qd=qt({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),jd=qt({base:{background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",gap:"16px"},variants:{size:{sm:{maxWidth:"360px",minWidth:"0",margin:"32px"},md:{maxWidth:"600px",minWidth:"400px",margin:"32px"},lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},margin:{sm:"32px",base:"0"},height:{sm:"auto",base:"100dvh"}}},padding:{none:{padding:"0"},sm:{padding:"8px"},md:{padding:"16px"},lg:{padding:"24px"}}},defaultVariants:{size:"sm",padding:"md"}}),zd={transform:"none",willChange:"auto"};function Kd({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=ee({open:e,strategy:"fixed"}),c=le(s,{outsidePress:o,escapeKey:i}),d=se(s,{role:t}),{getFloatingProps:u}=ce([c,d]),h=[jd({size:r,padding:a}),l].filter(Boolean).join(" ");return e?S(me,{children:S(ge,{lockScroll:!0,className:qd(),children:S(ve,{context:s,modal:!0,returnFocus:!0,children:S("div",{...u(),className:h,style:zd,children:n})})})}):null}const Yd=Ut({display:"flex",justifyContent:"flex-end",gap:"8px"}),_d="success",Zd="danger",Gd=fe.createConfirmation(ye(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return P(Kd,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:zt["alert-dialog"],children:[S(Aa,{wrap:"wrap",stylists:[Qt(zt["alert-header"])],children:n}),r&&"string"==typeof r?S(cs,{wrap:"wrap",children:r}):S(N,{children:r}),S("div",{className:Yd,children:a.map(e=>{const n=(e=>{switch(e){case Zd:return Fd;case _d:return Ud;default:return Xl}})(e.type);return S(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:S(Aa,{children:e.label})},e.key)})})]})}));function Qd(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}const Xd=e=>vl("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),Jd=Ut({display:"flex",flexDirection:"column",gap:"12px"});async function $d(e){await Gd({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:Vd,label:"Cancel"},{key:Hd,label:"Chat",type:_d}]})===Hd&&Xd({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const eu=e=>{const t=e?.status?"DELETED"===e.status?"REMOVED":e.status:"ACTIVE",n="MORTGAGE"!==e?.apiType&&"BROKERAGE"!==e?.apiType&&e?.apiType?e.apiType:"OTHER";return{iconUrl:"",...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Jo({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Jo({id:e.plaidItemId||e.oauthAccountId,prefix:"INTEGRATION"}),apiInstitutionId:e.apiInstitutionId??null},mask:e.apiMask??"",beginningBalanceData:{},isSupported:e.isSupported||!1,tranStartDate:e.tranStartDate||null,tranMinStartDate:e.tranMinStartDate||null,latestTransactionDate:e.latestTransactionDate||null,accountBalance:e.apiCurrentBalance||null}},tu=Qt(zt["button-secondary"],Ut({color:"typography.intent.primary",border:"{borderWidths.md} solid",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary","& .Tight-text":{color:"typography.intent.primary"},"& path":{stroke:"icon.intent.primary"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"},"& path":{stroke:"icon.intent.primary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.primary.active",borderColor:"border.intent.primary.active","& .Tight-text":{color:"typography.intent.primary.active"},"& path":{stroke:"icon.intent.primary.active"}}}));function nu({children:e,stylists:t=[],...n}){return S(Gl,{stylists:[tu,...t],...n,children:e})}function ru({mutationFn:e,onMutateFn:t,...n}){const r=Hn(),a=Yn(),o=!Un(r);return O({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):qn,onMutate:o&&Fn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},zn)}const au=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:_r(n)};return await qr(r)},ou=async({data:e,accessToken:t,environment:n})=>au({data:e,accessToken:t,environment:n}),iu=async({data:e,accessToken:t,environment:n})=>au({data:e,accessToken:t,environment:n}),lu=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/accounts",bodyParams:{accounts:e.accounts},accessToken:t,endpointManager:_r(n)};return await qr(r)})({data:{accounts:e},accessToken:t,environment:n});function su(e){return ru({onSuccess:async()=>{Pr("mutation successful, invalidating bank account queries");try{return zn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&Rr({error:e,severity:"error"})}},...e})}function cu(){return su({mutationFn:iu})}function du(){return ru({onSuccess:async()=>{Pr("mutation successful, invalidating bank account queries");try{return zn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&Rr({error:e,severity:"error"})}},mutationFn:lu})}const uu=Ut({display:"flex",flexDirection:"column",gap:"16px"}),hu=async()=>Gd({title:"Merge Accounts",body:P("div",{className:uu,children:[S(cs,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),S(cs,{wrap:"wrap",children:"This action can't be undone."}),S(cs,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Vd,label:"Cancel"},{key:Wd,label:"Continue",type:Zd}]}),pu=()=>Gd({title:"Merge Failed",body:S(cs,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Vd,label:"OK"}]}),{formContext:gu,fieldContext:mu,useFieldContext:vu,useFormContext:bu}=xe(),fu=Ti(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{id:"icon/check"},p.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function yu({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return P(Ud,{type:"submit",disabled:n,children:[e&&S(Ni,{Component:fu}),S(Aa,{children:t})]})}const xu=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),ku=[Qt(null,Ut({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Tu=Qt(null,Ut({display:"flex",alignItems:"center",gap:"4px"}));function wu({errorMessage:e}){return P("div",{...Tu,children:[S(Sd,{Component:xu,stylists:ku}),S(Ia,{intent:"danger",wrap:"wrap",children:e})]})}const Cu=Ut({display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",backgroundColor:"surface.intent.action.discreet","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discreet.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Au=Ut({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Eu=Ut({display:"flex",justifyContent:"space-between",alignItems:"center"});function Iu({children:e,inputRef:t,popupTriggerProps:n,label:r,isDefaultValue:a,isTouched:o,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Qt(i||null,Cu,l,Au,Ei),[m,v]=y(!0);return P(N,{children:[P("div",{...g,onClick:s,...n,onMouseDown:e=>{v(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{v(!1),c?.()},"data-clicked":m,"data-isdefaultvalue":a,"data-haserror":o&&void 0!==d,"data-disablehover":u,children:[P("div",{className:Eu,children:[void 0!==r&&S(Ia,{children:r}),Fn(p)&&S(Ia,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&S(wu,{errorMessage:d})]})}const Su=Ut({border:"{borderWidths.lg} solid transparent","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},"&:focus-within":{cursor:"text"}});function Nu({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=vu(),i=ke(o.store,e=>e.meta.errors[0]?.message),l=ke(o.store,e=>e.meta.isDefaultValue),s=ke(o.store,e=>e.meta.isTouched);return S(Iu,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:zt["discreet-form-input"],additionalStyles:Su,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function Pu(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function Ru(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function Du(e){"Enter"===e.key&&e.currentTarget.blur()}const Mu=Qt(zt["amount-input"],nn({body:"default"}),Ut({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),Lu=Qt(null,Ut({display:"flex",alignItems:"center",gap:"2px"}));function Ou({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return P("div",{...Lu,children:[S(Oc,{children:"$"}),S(we,{...Mu,getInputRef:n,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:r,onBlur:a,onKeyDown:Du,autoFocus:o})]})}const Fu=Ut({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),Bu=qt({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function Uu({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=vu(),u=ke(d.store,e=>e.meta.errors[0]?.message),h=ke(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=Fn(c)?c-p:void 0,m=a?Fu:Bu({kind:e});return S(Iu,{label:t,inputRef:r,popupTriggerProps:o,className:zt["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const Vu=Qt(null,Ut({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function Wu({options:e,onSelect:t,selectedLabel:n}){const r=As();return S("div",{...Vu,children:e.map(e=>S(Us,{onClick:()=>{return n=Number(e.value),r.close(),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const Hu=Ti(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2922)"},p.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_9779_2922"},p.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),qu=Qt(null,Ut({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),Ai);function ju({selectedLabel:e,options:t,onSelect:n}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>P("div",{...qu,...t,children:[S(Aa,{children:e}),S(Ss,{Component:Hu})]})}),S(Fs,{children:S(Wu,{options:t,onSelect:n,selectedLabel:e})})]})}const zu=Qt(null,Ut({display:"flex",alignItems:"center",gap:"15px"})),Ku=bn.map((e,t)=>({value:t,label:e})),Yu=fn({}).map(e=>({value:e,label:String(e)}));function _u({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return P("div",{...zu,children:[S(ju,{selectedLabel:bn[r],options:Ku,onSelect:e=>a(n,e)}),S(ju,{selectedLabel:String(n),options:Yu,onSelect:e=>a(e,r)})]})}const Zu=Qt(null,Ut({background:"surface.foreground",padding:"25px",gap:"15px"})),Gu=Qt(null,Ut({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),Qu=Qt(null,Ut({backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),Ai),Xu=Qt(null,Ut({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),Ju=Qt(null,Ut({padding:"8px",textAlign:"center"})),$u=Qt(null,Ut({backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discreet.active",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.active"},"&[data-today='true']::after":{content:"''",position:"absolute",bottom:"3px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"brand.primary"},"&:disabled":{cursor:"default"}}),Ai),eh=Qt(null,Ut({color:"typography.base"}));function th({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&yn(e,t),l=xn(e),s=e.getMonth()!==n,c=!!a&&kn(e,a),d=!!o&&kn(o,e);return S("button",{...$u,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:S(Aa,{stylists:s||c||d?[eh]:[],children:e.getDate().toString()})})}function nh({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=As(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=ln(e,t,1),r=new Date(n);return r.setDate(r.getDate()-n.getDay()),Array.from({length:42},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n})}(s,c),u=(h=d)[h.length-1];var h;const p=void 0===a||u&&kn(a,u),g=On(o)||d.length>0&&kn(d[0],o),m=e=>{t(e),i.close()},v=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return P("div",{...Zu,children:[P("div",{...Gu,children:[S("button",{...Qu,onClick:()=>v(-1),disabled:!g,children:S(Ni,{Component:wi})}),S(_u,{currentMonthYear:l,onMonthYearChange:r}),S("button",{...Qu,onClick:()=>v(1),disabled:!p,children:S(Ni,{Component:Ci})})]}),P("div",{...Xu,children:[vn.map(e=>S("div",{...Ju,children:S(Ia,{children:e})},e)),d.map(t=>S(th,{date:t,selectedDate:e,currentMonth:c,onClick:m,maxDate:a,minDate:o},t.toISOString()))]})]})}const rh=Qt(null,nn({body:"default"}),Ut({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),ah=Qt(null,nn({body:"default"}),Ut({outline:"none",border:"none",padding:0,backgroundColor:"transparent",cursor:"text",overflowWrap:"break-word",minWidth:"100%",maxWidth:"100%","&::placeholder":{color:"typography.base.weak"},"&:focus":{outline:"none"}}));function oh(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const ih=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:a,caption:o,entityId:i}=e,l=_r(n).getUrl(`/files/upload/${a}`),s=Un(o)?"att_"+i:o,c=new FormData;return c.append("file",r),c.append("caption",s),c.append("entityId",String(i)),(await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`},credentials:"include",body:c})).json()},lh=async({data:e,accessToken:t,environment:n})=>{const r=_r(n).getUrl("/files/attachment");return(await fetch(r,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e.id})})).json()};const sh=Ut({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),ch=({onFileSelect:e,onUploadComplete:t})=>{const n=g(null),{mutateAsync:r,isPending:a}=ru({mutationFn:ih,onSuccess:async()=>zn.invalidateQueries({queryKey:["files/attachments"]})});return P("div",{children:[S("input",{type:"file",multiple:!0,ref:n,onChange:async a=>{const o=Array.from(a.target.files??[]);if(0===o.length)return;const i=o.map(e=>({localId:crypto.randomUUID(),file:e,name:e.name,size:e.size})),l=i.map(({localId:e,name:t,size:n})=>({localId:e,name:t,size:n,id:null,isPending:!0}));e?.(l);try{const e=i.map(async({localId:e,file:t})=>({localId:e,result:await r({file:t,entity:"message",caption:t.name,entityId:null})})),n=(s=l,c=await Promise.allSettled(e),s.map(({localId:e,name:t,size:n})=>{const r=c.find(t=>"fulfilled"===t.status&&t.value.localId===e);if(r&&"fulfilled"===r.status){const a=r.value.result?.attachment?.id??null;return{localId:e,name:t,size:n,id:a,isPending:!1}}return{localId:e,name:t,size:n,id:null,isPending:!1}}));t?.(n)}finally{n.current&&(n.current.value="")}var s,c},style:{display:"none"}}),S(Xl,{type:"button",onClick:()=>{n.current?.click()},disabled:a,children:S("span",{className:sh,children:S(Sd,{Component:Js})})})]})},dh=h.object({localId:h.string(),id:h.number().nullable(),name:h.string(),size:h.number(),isPending:h.boolean()}),uh=h.object({message:h.object({text:h.string(),attachments:h.array(dh)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})}),hh=Ut.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),ph=Ut.raw({visibility:"hidden",fontSizeAdjust:"none",fontSize:"100%",fontStyle:"normal",letterSpacing:"normal",fontStretch:"normal",fontVariant:"normal",fontWeight:"normal",textAlign:"left",textAlignLast:"initial",textDecoration:"none",textEmphasis:"none",textIndent:"0px",textJustify:"auto",textShadow:"none",textTransform:"none"}),gh=Ut(ph,hh),mh=Ut.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),vh=Ut(mh,hh,nn.raw({body:"default"})),bh=Ut({display:"block",width:"100%"}),fh=Ut({position:"relative"}),yh=Ut({display:"flex",justifyContent:"flex-end",gap:"15px"}),xh=Ut({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),kh=w(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:a,hideFileUpload:o},i){const l=vu(),s=g(null),{startCallback:c}=Ki({delay:50,callback:e=>n(e)});C(i,()=>s.current);const d=!e&&uh.safeParse(l.form.state.values).success;return S(Uu,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(oh(t),void c(!0)),children:P("div",{className:bh,children:[P("div",{className:fh,children:[P("pre",{className:gh,children:[l.state.value.text,S("br",{})]}),S("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:vh,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),P("div",{className:yh,children:[!o&&S(ch,{onFileSelect:r,onUploadComplete:a}),S(Xl,{disabled:!d,type:"submit",children:S("span",{className:xh,children:S(Sd,{Component:Ic})})})]})]})})});function Th(e){return new B(e).div(100).toNumber()}function wh(e){return new B(e).times(100).toNumber()}const Ch=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Ah=e=>{const t=e?.description;return`${t} | ${wa(Th(Number(e?.amount)))} | ${Tn(An(e?.date||""))}`},Eh=v(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function Ih(e,t){switch(t.type){case"increment":return((e,t)=>{let n;if(null===e.focusedIndex)n=0;else{const r=e.focusedIndex+1;n=!t.repeat&&r>e.maxIndex?0:Math.min(r,e.maxIndex)}return{...e,focusedIndex:n}})(e,t);case"decrement":return((e,t)=>{let n;if(null===e.focusedIndex)n=e.maxIndex;else{const r=e.focusedIndex-1;n=!t.repeat&&r<0?e.maxIndex:Math.max(r,0)}return{...e,focusedIndex:n}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function Sh(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function Nh(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom&&r.left>=n.left&&r.right<=n.right}function Ph(e,t,n){if(null===e)return{node:void 0,metadata:void 0};const r=t[e];return{node:r,metadata:n.get(r)}}function Rh(e){const[t,n]=y(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=g(null),[r,a]=y(!0),[o,i]=y(!1),l=b(Eh),[s,c]=A(Ih,{focusedIndex:null,maxIndex:e});k(()=>{const e=n.current,t=()=>{On(s.focusedIndex)&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[n,s.focusedIndex,c,l?.popupNodeId]);const d=g(null);return k(()=>{c({type:"max",max:e})},[e]),k(()=>{const e=n.current;if(null!==e){const n=e=>{i(!1);const n=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!n)return;const r=Number(e.target.getAttribute("data-index"));s.focusedIndex===r&&d.current===e.target||(0!==e.movementX||0!==e.movementY)&&n&&(a(!0),d.current=e.target,c({type:"set",focusedIndex:r}),t.setCascadeState(!0,r))},r=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;a(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):n&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},o=()=>i(!0);return e.addEventListener("mousemove",n),e.addEventListener("keydown",r),e.addEventListener("scroll",o),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("keydown",r),e.removeEventListener("scroll",o)}}},[t,s.focusedIndex]),{listRef:n,focusedState:s,isMousing:r,isScrolling:o}}(t.size-1,e),l=As(),s=x((e,t)=>{n(n=>new Map(n).set(e,t??null))},[]),c=x(e=>{n(t=>{const n=new Map(t);return n.delete(e),n})},[]),{sortedNodes:d,sortedMap:u}=function(e,t){const n=m(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(Sh)),n},[e,t]),r=m(()=>{const t=/* @__PURE__ */new Map;return n.forEach((n,r)=>{const a=e.get(n)??{};t.set(n,{...a,index:r})}),t},[n,e]);return{sortedNodes:n,sortedMap:r}}(t,r);!function(e,t,n,r,a,o){k(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=Ph(r,t,n),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,n){const r=e.placement.includes("left"),a=e?.popupParentNodeId,o=a&&n?.hasCascading&&r?"ArrowLeft":"ArrowRight",i=r?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:n?.hasCascading&&t.key===o,shouldCloseCascade:a&&t.key===i}}(a,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=r,g=l,m=i,v=o,!(!(h=s)||!h.hasCascading||null===p||g&&m&&Nh(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),a.close())};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,r,n,a,o])}(r,d,u,a.focusedIndex,l,e);const{startCallback:h,cancelCallback:p}=Ki({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&Nh(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return v=a.focusedIndex,k(()=>{const e=C.current;if(null===v||f)return;const{node:t,metadata:n}=Ph(v,T,w);return E.lastOpenedIndex!==v&&n?.hasCascading&&(E.closeCurrentCascade(),I({focusedIndex:v,node:t,listElement:e})),()=>S()},[v,f=o,C=r,E=e,S=p,T=d,w=u,I=h]),function(e,t,n,r){k(()=>{const{metadata:a}=Ph(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),m(()=>({register:s,unregister:c,map:u,focusedIndex:a.focusedIndex,listRef:r,isMousing:o,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,u,a.focusedIndex,r,o,i,l?.nodeId]);var v,f,T,w,C,E,I,S}const Dh=v(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function Mh({style:e,children:t}){const n=Qt(zt["popup-list"],ys,e),r=function(){const[e,t]=y(null),[n,r]=y(!1),[a,o]=y(null),i=x((n,a)=>{n&&e!==a?(o(a),t(a)):n||e!==a||(r(!1),t(null))},[e,r]),l=x(()=>{t(null),o(null),r(!1)},[t,o,r]),s=x(()=>{t(null),o(null),r(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:n,setFocus:r,lastOpenedIndex:a,closeCurrentCascade:s}}(),a=Rh(r);return S("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:S(Eh.Provider,{value:a,children:S(Dh.Provider,{value:r,children:t})})})}function Lh({searchTerm:e,setSearchTerm:t,onClick:n,placeholder:r,SearchInput:a,SearchList:o,DefaultList:i,extraProps:l,listLength:s,forceSearchVisible:c}){const d=c||s>=5,u=Vn(e),h=e=>{n?.(e)};return P(N,{children:[d&&S(a,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?S(o,{...l??{},onClick:h,searchTerm:e}):S(i,{...l??{},onClick:h})]})}const Oh=Wt(nn({body:"default"}),Ut({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function Fh({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=g(null);return k(()=>{r.current?.focus({preventScroll:!0});const e=e=>{const t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement;!r.current||document.activeElement===r.current||n||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||r.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),S("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:Oh})}function Bh({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=As(),[c,d]=y(""),u=Vn(c),h=l?.(u);return S(Fs,{children:S(Mh,{style:h,children:S(Lh,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s.close()},placeholder:t,SearchInput:Fh,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i})})})}function Uh({hasCascading:e=!1}={}){const t=g(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=b(Eh);E(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=m(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;E(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=x(()=>{l?.current?.focus()},[l]),u=m(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const Vh=w(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return S("button",{...ks,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),Wh=w(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=Uh(),l=pe([i,r]);return S(Vh,{...ks,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})});function Hh({promptText:e}){return P(N,{children:[S(Ni,{Component:Ul}),S(cs,{children:e})]})}function qh({text:e}){return S("div",{...ks,children:e?S(Aa,{children:e}):S($a,{styles:Ut({width:"100%",height:"16px"})})})}const jh=Qt(zt["popup-list"],ys),zh=()=>P("div",{...jh,children:[S(qh,{}),S(qh,{}),S(qh,{}),S(qh,{}),S(qh,{})]});function Kh({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?S(zh,{}):P(N,{children:[r&&S(Wh,{onClick:()=>vl("BankAccountForm"),children:S(Hh,{promptText:"Add bank account"})}),e?.map(e=>S(Wh,{onClick:()=>t(e),children:S(Aa,{wrap:"wrap",children:Go(e?.name,e?.mask)})},e?.id))]})}const Yh={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function _h({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=m(()=>new Ce(e??[],Yh),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?S(zh,{}):P(N,{children:[a&&S(Wh,{onClick:()=>vl("BanksAndIntegrations"),children:S(Hh,{promptText:"Add bank account"})}),0===i.length?S(qh,{text:"No results found"}):i.map(e=>S(Wh,{onClick:()=>n(e),children:S(Aa,{wrap:"wrap",children:Go(e?.name,e?.mask)})},e?.id))]})}function Zh({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return S(Bh,{onClick:e,placeholder:"Search bank accounts...",SearchList:_h,DefaultList:Kh,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Gh=Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Qh({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:r=>S(Uu,{label:e,popupTriggerProps:r,disabled:t,children:S("button",{className:Gh,type:"button",disabled:t,children:S(Aa,{children:Go(n?.name??"",n?.mask??"")})})})}),S(Zh,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const Xh=()=>["expenses/categories"],Jh=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await zi(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Jo({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Jo({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function $h(e){return _n({...e,queryKey:["expenses/categories"],queryFn:Jh})}function ep(){return $h({select:e=>({...e,data:e.data?rp(e.data):void 0})})}function tp(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentCategoryId){const e=t.get(n.parentCategoryId)??[];e.push(n),t.set(n.parentCategoryId,e)}return t}function np(e){if(0===e.length)return[];const t=tp(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function rp(e){if(0===e.length)return[];const t=tp(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ap(){return Yi({prefetchFn:Do(Xh,Jh)})}const op=e=>({id:e.id,name:e.name}),ip=Qt(zt.text,nn({label:"strongLabel"}),Ut({maxWidth:"100%"}),la);function lp({children:e,stylists:t=[]}){const n=tn([ip,...t]);return S("div",{...n,children:e})}const sp={keys:[{name:"name"}],threshold:.1};function cp(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function dp(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(l=r,t.find(e=>e.children?.some(e=>e.id===l.id))),o=!(a||0!==r?.children?.length&&r.children),i=!a&&r.children&&r.children.length>0;var l;a?cp(a,r,n):o?cp(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{cp(e,n,t)})}(r,n)}),n}const up=Qt(null,Ut({whiteSpace:"normal"})),hp=[Qt(null,Ut({marginLeft:"6px",marginRight:"6px"}))];function pp({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=$h({select:e=>({...e,data:e.data?np(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=m(()=>new Ce(o??[],sp),[o]),s=m(()=>o?dp(l.search(e),o):[],[o,e,l]);return a?S(zh,{}):i?S(qh,{text:"No data"}):0===s.length?S(qh,{text:"No results found"}):S(N,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return P(Wh,{onClick:()=>t(op(n)),children:[S("img",{src:n.iconUrl,alt:"",width:"15px",height:"15px"}),S(lp,{stylists:[up],children:r?n.name:P(N,{children:[e.name,S(Ni,{Component:Ci,stylists:hp}),n.name]})})]},`${e.id}_${n.id}`)})})}const gp=w(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=pe([a,t?.ref]);return S(Vh,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function mp({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=b(Dh),{itemRef:o,index:i,itemProps:l}=Uh({hasCascading:!0}),{isScrolling:s}=b(Eh);return P(Cs,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[S(Es,{children:t=>S(gp,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),S(Fs,{initialFocus:a,children:t})]})}const vp=Ut({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}),bp=Ut({display:"flex",gap:"8px"});function fp({icon:e,iconUrl:t,displayLabel:n}){return P("div",{className:vp,children:[P("div",{className:bp,children:[e,On(e)&&t&&S("img",{src:t,alt:"",width:"15px",height:"15px"}),S(Aa,{wrap:"wrap",children:n})]}),S(Ni,{Component:Ci})]})}function yp({category:e,handleCategoryChange:t}){return S(Mh,{children:e.children?.map(e=>P(Wh,{onClick:()=>t(op(e)),children:[S("img",{src:e.iconUrl,alt:"",width:"15px",height:"15px"}),S(Aa,{wrap:"wrap",children:e.name})]},e.id))})}function xp({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=ep(),a=t?.data,o=!r&&n&&void 0===a;return r?S(zh,{}):o?S(qh,{text:"No data"}):S(N,{children:a?.map(t=>t.hasChilds?S(mp,{triggerChildren:S(fp,{displayLabel:t.name,iconUrl:t.iconUrl}),popupChildren:S(yp,{category:t,handleCategoryChange:e})},t.id):P(Wh,{onClick:()=>e(op(t)),children:[S("img",{src:t.iconUrl,alt:"",width:"15px",height:"15px"}),S(Aa,{wrap:"wrap",children:t.name})]},t?.id))})}const kp=({onClick:e})=>{const{query:{data:t}}=ep();return S(Bh,{onClick:e,placeholder:"Search expense categories...",SearchList:pp,DefaultList:xp,listLength:(t?.data??[]).length})},Tp=Qt(zt["category-text"],Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",padding:0,outline:"none",border:"none",background:"none",borderRadius:"md",color:"typography.intent.action",flex:"1 1 0",minWidth:0,cursor:"pointer",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),Ii),wp=Qt(null,Ut({color:"inherit"})),Cp=Qt(zt["amount-input-container"],Ut({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{color:"typography.intent.action.hover"}},"& .Tight-amount-input, & .Tight-text":{color:"inherit"},"&[data-clicked='true']:focus-within":{outline:"1px solid",outlineOffset:"2px",outlineColor:"border.layout.strong"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"}}),Ii),Ap=()=>["accounting/glAccounts"],Ep=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await zi(n);return Pp(r)};function Ip(e){return _n({...e,queryKey:["accounting/glAccounts"],queryFn:Ep})}function Sp(){return Ip({select:Mp})}function Np(){return Ip({select:Lp})}const Pp=e=>e.map(e=>({...e,id:Jo({id:e.id,prefix:"GL_ACCOUNT"})}));function Rp(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>Rp(e,t))}const Dp=e=>!e.parentAccountNo;function Mp(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentAccountNo){const e=t.get(n.parentAccountNo)??[];e.push(n),t.set(n.parentAccountNo,e)}return t}(e);return e.filter(Dp).map(e=>({...e,children:Rp(e,t)}))}function Lp(e){return Mp(e).flatMap(e=>[e,...e.children])}const Op=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function Fp(e,t){return m(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Bp=Ut({display:"grid",textWrap:"nowrap",width:"100%"});function Up({children:e,rows:t,cols:n}){return S("div",{className:Bp,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Vp=qt({base:{minWidth:0,borderRadius:"zero",border:"1px solid",borderColor:"border.layout",_hover:{zIndex:1},_focus:{zIndex:2}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}},corners:{rounded:{_first:{borderTopLeftRadius:"sm",borderBottomLeftRadius:"sm"},_last:{borderTopRightRadius:"sm",borderBottomRightRadius:"sm"}}}}});function Wp({option:e,handleClick:t,selected:n,width:r,backgroundColor:a,corners:o}){const i=Qt(zt["button-group"],Wt(Vp({width:r,backgroundColor:a,corners:o}),Hl,Vl,Wl,Ai));return void 0===e?null:S("button",{type:"button",...i,onClick:()=>t(e),"data-active":n?.value===e.value,children:n?.value===e.value?S(Aa,{wrap:"wrap",textAlign:"center",children:e.label}):S(cs,{wrap:"wrap",alignment:"center",children:e.label})})}function Hp({options:e,handleClick:t,selected:n,rows:r,cols:a}){return S(Up,{rows:r,cols:a,children:e?.map(e=>S(Wp,{option:e,handleClick:t,selected:n},e.value))})}function qp({options:e}){const t=As(),n=vu();return S(Fs,{children:S(Mh,{children:e.map(e=>S(Wh,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.close()},children:S(cs,{children:e.label})},e.value))})})}const jp=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),zp=Qt(null,Ut({color:"typography.base.weak"})),Kp=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Yp=Ut({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),_p=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank",{styleIconKey:"bank"}),Zp=qt({base:{display:"flex",flexDirection:{base:"row",sm:"column"},alignItems:{base:"center",sm:"start"},justifyContent:"flex-start",textAlign:"start",gap:"4px",maxWidth:"100%",flexWrap:"wrap",minWidth:0},variants:{active:{true:{flexDirection:"column-reverse",alignItems:"start"},false:{flexDirection:{base:"column"},alignItems:{base:"start"}}}}});function Gp({accountName:e,accountNo:t,syncText:n,active:r=!0}){const a=t?Go(e,t):e;return P("div",{className:Zp({active:r}),children:[n&&S(Ia,{intent:r?"normal":"weak",children:n}),S(cs,{wrap:"ellipsis",intent:r?"default":"weak",children:a})]})}const Qp=e=>["plaidInstitutionLogo",e??{}];function Xp(e){const t=Hn(),n=Yn();return M({queryKey:Qp({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await Ld({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const Jp=Ut({display:"flex",gap:"10px",maxWidth:"100%"});function $p({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=Xp(n);return P("div",{className:Jp,children:[i&&o?S("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):S(Tc,{Component:_p}),S(Gp,{accountName:e,accountNo:t,active:a,syncText:r})]})}const eg=qt({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function tg({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Qt("vertical"===e?zt["vertical-divider"]:zt["horizontal-divider"],n,eg({alignment:e,color:t}));return S("div",{...r})}const ng=Ut({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function rg({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return S(Xl,{...r,disabled:n,width:"fill-parent",children:S(lp,{children:e?Go(e.name,e.mask):P("div",{className:ng,children:[S(cs,{children:t}),S(Ni,{Component:Ul})]})})})}const ag="TRIGGER_ACCOUNT",og="FORM_SELECTABLE_ACCOUNT",ig=Ut({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function lg({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return P("div",{className:ig,children:[P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(rg,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===ag?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),S(Zh,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&S(wu,{errorMessage:o})]})}const sg=(e,t,n)=>{if(!n)return;const r=e===og?t:n,a=e===og?n:t,o=(i=r?.mask,l=a?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=a?.apiName,ti(c)&&ei(d));var c,d;const u=(h=r?.status,p=a?.status,"ACTIVE"===h&&"INACTIVE"===p);var h,p;return o?"Selected account number does not match destination account number":s?"Merging a linked account into a manually tracked account may result in duplicate transactions":u?"You selected an active account to be merged into an archived account":void 0},cg=Ut({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),dg=Ut({display:{base:"block",sm:"none"}}),ug=Ut({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),hg=Ut({display:"flex",justifyContent:"center",alignItems:"center"}),pg=Ut({display:{base:"none",sm:"block"}}),gg=Ut({display:{base:"block",sm:"none"}});function mg({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return P("div",{className:cg,children:[P("div",{className:ug,children:[o?S(lg,{selectedAccount:t,setSelectedAccount:a,mergeDestination:ag,bankAccounts:n,isFilling:r,warningMessage:sg(ag,e,t??null)}):S(rg,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),P("div",{className:hg,children:[S("div",{className:pg,children:S(Sd,{Component:Ci})}),S("div",{className:gg,children:S(Sd,{Component:Hu})})]}),S($p,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""})]}),S("div",{className:dg,children:S(tg,{alignment:"horizontal"})})]})}const vg=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await zi(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Jo({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function bg(){return _n({queryKey:["expenses/vendors"],queryFn:vg})}const fg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:_r(n)};return await qr(r)},yg=Wt(nn({body:"default"}),Ut({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),xg=Ut({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),kg=Qt(zt["button-inline"],Ut({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"}));function Tg({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return P("div",{className:xg,children:[S("input",{ref:o,type:"text",placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r()):"Escape"===e.key&&(e.preventDefault(),a())},onFocus:e=>{e.stopPropagation()},className:yg}),S("button",{type:"button",onClick:r,...kg,children:S(Ia,{children:"Add"})})]})}function wg({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=y(!1),[o,i]=y(""),l=g(null);return k(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),S(Wh,{onClick:r?void 0:()=>{a(!0)},children:r?S(Tg,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):S(Hh,{promptText:e})})}const Cg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Ag({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=m(()=>new Ce(e??[],Cg),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?S(zh,{}):P(N,{children:[S(wg,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?S(qh,{text:"No results found"}):i.map(e=>S(Wh,{onClick:()=>n(e),children:S(cs,{children:e.name})},e.id))]})}function Eg({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?S(zh,{}):P(N,{children:[S(wg,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>S(Wh,{onClick:()=>t(e),children:S(cs,{children:e.name})},e.id))]})}function Ig({onClick:e}){const{query:{data:t,isLoading:n}}=bg(),{mutate:r}=ru({mutationFn:fg,onSuccess:async()=>zn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return S(Bh,{onClick:e,placeholder:"Search vendors...",SearchList:Ag,DefaultList:Eg,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const Sg=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await zi(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Jo({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function Ng(){return _n({queryKey:["clientMgmt/clients"],queryFn:Sg})}const Pg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:_r(n)};return await qr(r)},Rg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Dg({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=m(()=>new Ce(e??[],Rg),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?S(zh,{}):P(N,{children:[S(wg,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?S(qh,{text:"No results found"}):i.map(e=>S(Wh,{onClick:()=>n(e),children:S(cs,{children:e.name})},e.id))]})}function Mg({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?S(zh,{}):P(N,{children:[S(wg,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>S(Wh,{onClick:()=>t(e),children:S(cs,{children:e.name})},e.id))]})}function Lg({onClick:e}){const{query:{data:t,isLoading:n}}=Ng(),{mutate:r}=ru({mutationFn:Pg,onSuccess:async()=>zn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return S(Bh,{onClick:e,placeholder:"Search customers...",SearchList:Dg,DefaultList:Mg,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function Og({frequencies:e,onClick:t}){const n=As();return S(Fs,{children:S(Mh,{children:e.map(e=>S(Wh,{onClick:()=>(t(e),void n.close()),children:S(Aa,{children:e.name})},e.value))})})}const{useAppForm:Fg,withForm:Bg}=Te({formContext:gu,fieldContext:mu,formComponents:{SaveButton:yu},fieldComponents:{DiscreetAmountField:function({label:e}){const t=g(null),n=vu();return S(Nu,{inputRef:t,label:e,children:S(Ou,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=g(null),r=vu();return S(Uu,{inputRef:n,label:e,children:S(Ou,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=vu(),i=ke(o.store,e=>e.meta.isDefaultValue),l=g(null),[s,c]=y(()=>o.state.value?An(o.state.value):/* @__PURE__ */new Date),d=o.state.value?An(o.state.value):null,[u,h]=y(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const a=Cn(r);if(a){let e=a;t&&n?e=Sn(In(a,t),n):t?e=In(a,t):n&&(e=Sn(a,n)),o.handleChange(En(e)),c(e)}else o.handleChange("")},m=u||(d?Tn(d):""),[v,b]=y(!1),f=e=>{v&&(()=>{if(d&&!i){const e=Cn(u);(t&&e&&kn(e,t)||n&&e&&kn(n,e))&&h(Tn(d))}})(),b(e)},x=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},k=a?Uu:Nu;return P(Cs,{placement:"bottom-start",onOpenChange:f,open:v,children:[S(Es,{children:t=>S(k,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:S("input",{...rh,ref:l,type:"text",id:o.name,value:m,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:x,autoComplete:"off"})})}),S(Fs,{initialFocus:!1,children:S(nh,{selectedDate:d,onDateSelect:e=>{o.handleChange(En(e)),h(Tn(e)),c(e)},viewDate:s,onViewDateChange:c,maxDate:t,minDate:n})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:n=!1,resizeable:r=!0}){const a=vu(),o=g(null);return S(Uu,{label:e,inputRef:o,children:S("textarea",{...ah,ref:o,value:a.state.value||"",onChange:e=>a.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:r?"both":"none"},autoFocus:n})})},MessageAreaInput:kh,SplitExpenseCategoryField:function({value:e,onChange:t}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>P("button",{...Tp,...t,type:"button",children:[e&&S("img",{src:e.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Aa,{stylists:[wp],children:e?.name||"Uncategorized"})]})}),S(kp,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=y(!1);return S("div",{...Cp,"data-clicked":r,children:S(Ou,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=vu(),r=oi(t.id),{query:{data:a},isFilling:o}=Yo({select:e=>({...e,data:ci(e?.data)})}),i=a?.data,l=On(e)||!Ch(e);return S(Qh,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=vu(),{query:{data:r}}=Np(),a=function(e){const{query:t}=Yo({select:t=>({...t,data:ai(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=Yo({select:e=>{return{...e,data:(t=e?.data,t?.filter(e=>"ACTIVE"===e.status&&e.isSupported&&e.glAccountId))};var t}}),l=o?.data,s=e?ni(e.amount):"";return S(Qh,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId));var a,o,i;t&&n({id:(i=t).id||"",name:i.name,accountNo:i.accountNo})},bankAccount:a,bankAccountOptions:l,isFilling:i})},ButtonGroupField:function({label:e,options:t}){const n=vu(),r=t.find(e=>e.value===n.state.value);return S(Uu,{label:e,disableHover:!0,children:S(Hp,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Hp,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=vu();return P(Cs,{placement:"bottom-start",children:[S(Es,{children:a=>S(Uu,{label:t,popupTriggerProps:a,disabled:n,children:S("button",{...jp,type:"button",children:r.state.value?S(Aa,{children:Kp(e,r.state.value)}):S(Aa,{stylists:[zp],children:`Select ${t}...`})})})}),S(qp,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=vu(),i=g(null);return S(Uu,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:S("input",{className:Yp,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:mg,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=g(null),o=r?Uu:Nu;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(o,{inputRef:a,label:e,popupTriggerProps:t,children:S(Aa,{children:n?.name??"Select vendor"})})}),S(Ig,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=g(null),o=r?Uu:Nu;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(o,{inputRef:a,label:e,popupTriggerProps:t,children:S(Aa,{children:n?.name??"Select customer"})})}),S(Lg,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=g(null),a=`${n?.name??fl[0].name}`;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(Uu,{inputRef:r,label:e,popupTriggerProps:t,children:S(Aa,{children:a})})}),S(Og,{frequencies:fl,onClick:t})]})}}});const Ug=[Qt(null,Ut({"& path":{stroke:"icon.base"}}))];function Vg({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return P(Xl,{type:"button",onClick:n,children:[e&&S(Ni,{Component:Is,stylists:Ug}),S(Aa,{children:t})]})}const Wg=Ut({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),Hg=Ut({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),qg=Ut({maxWidth:"600px"}),jg=Ut({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),zg=Ut({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Kg=Ut({display:"flex",justifyContent:"flex-start",alignItems:"center"}),Yg=Ut({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),_g=Ut({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),Zg=Ut({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),Gg=e=>{Pu(e),Ru(e)};function Qg({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=Yo(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=du(),a=Hn(),o=Yn(),i=Fn(n),l=i?{selectedAccounts:n}:e;return i&&a&&n.forEach(({duplicateAccount:e})=>{var t,n,r;e&&(t=e.id,n=a,r=o,jo({queryKey:Ln(kl({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:wl,accessToken:n,environment:r}))}),Fg({defaultValues:l,onSubmit:async e=>{if(await hu()===Wd){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await pu());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=Ln(kl({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await Fo({queryKey:r,queryFn:wl,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o),r=(i=An(e.tranStartDate||""),l=An(n||""),s=An(e.tranMinStartDate||""),On(l)?i:Fn(s)?Sn(l,s):(Fn(i)&&Sn(l,i),i));var i,l,s;return On(r)?null:En(r)})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...ri(t),duplicateBankAccountIds:[$o(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await pu()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return P("form",{className:Wg,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:Gg,children:[P("div",{className:Hg,children:[S(Aa,{children:"Merge Accounts"}),S("div",{className:qg,children:S(cs,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),P("div",{className:jg,children:[P("div",{className:zg,children:[S("div",{className:Kg,children:S(Aa,{children:"Duplicate Account"})}),S("div",{className:Yg,children:S(Aa,{children:"Into"})}),S("div",{className:_g,children:S(Aa,{children:"Destination Account"})})]}),S(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>S(i.AppField,{name:`selectedAccounts[${n}]`,children:t=>{const n=t.state.value.duplicateAccount?.id,o=function(e,t,n,r){const a=function(e,t,n){const r=new Set(e.map(e=>e.id));return t.forEach(({duplicateAccount:e})=>{e&&e.id!==n&&r.add(e.id)}),Array.from(r)}(e,t,n);return r?.filter(e=>!a.includes(e.id)&&ei(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return S(mg,{destinationAccount:t.state.value.destinationAccount,selectedDuplicate:t.state.value.duplicateAccount,availableAccounts:o,isFilling:a,onSelectionChange:e=>{const n={duplicateAccount:e,destinationAccount:t.state.value.destinationAccount};t.handleChange(n)}},t.state.value.destinationAccount.id)}},n))})]}),S("div",{className:Zg,children:S(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return P(N,{children:[S(Vg,{showIcon:!1,onClick:()=>n()}),S(nu,{onClick:()=>i.reset(o),disabled:!t,children:S(Aa,{children:"Clear Selections"})}),S(yu,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const Xg=Ut({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",width:"100%",maxWidth:"100%",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative",overflow:"hidden",boxSizing:"border-box"}),Jg=fe.createConfirmation(ye(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return S(Kd,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:S("div",{className:Xg,children:S(Qg,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function $g({plaidItemAccounts:e,matchingAccountPairs:t}){await Jg({matchingAccountPairs:t,plaidItemAccounts:e})}const em=Ut({display:"flex",flexDirection:"column",gap:"12px"}),tm=async(e,t,n)=>{try{const r=await async function({accessToken:e,plaidItemId:t,environment:n}){if(!e)throw new Error("Access token is required to create Plaid link token");const r={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:Md(n)},{url:a,headers:o}=Ur(r);return Hi({url:a,includeCredentials:!0,extraHeaders:o,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(Pr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(Rr({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),$d("NO_LINK_TOKEN"))}catch(r){return Rr({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),$d("LINK_TOKEN_FAILED")}};async function nm(e,t,n){const r=await async function(e,t){const n=Ln(Bo({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Fo({queryKey:n,queryFn:Uo,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function rm(e,t,n,r){Pr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||Pr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,jo({queryKey:Ln(["banks/accounts",{}],{}),queryFn:Ko,accessToken:r,environment:a});const o=await nm(e,t,n);if(o){const e=await _o(t,n);return e?.data?.filter(e=>e.integration?.id===o.id)||[]}}var r,a;return[]}(t?.institution?.institution_id,n,r),{plaidItem:o}=await async function({publicToken:e,metadata:t,accessToken:n,environment:r}){if(!n)throw new Error("Access token is required to create Plaid link token");const a={path:"/banks2/webPlaidPublicToken",accessToken:n,endpointManager:Md(r)},{url:o,headers:i}=Ur(a);return await Vr({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(Pr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([zn.invalidateQueries({queryKey:["integrations"]}),zn.invalidateQueries({queryKey:["banks/accounts",{}]}),zn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Fn(e.apiErrorType)&&Fn(e.apiErrorCode),n="RELINK"===No({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return Rr({error:new Error("Plaid Item requires relink, plaid reopened automatically"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:o}}),{relinkPlaidItemId:o.id};const i=await _o(n,r),s=i?.data?.filter(e=>ei(e.apiName)&&"ACTIVE"===e.status)||[];return await async function(e,t,n,r,a){const o=n.institution?.name,i=l(e.plaidItemAccounts,t,"id");if(0===i.length)return 0===(e.plaidItemAccounts??[]).length?(Rr({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await Gd({title:"Uh Oh!",body:"It appears something went wrong fetching the accounts from your bank. Please chat with the support or try again later.",buttons:[{key:Vd,label:"Cancel"},{key:Hd,label:"Chat",type:_d}]})===Hd&&Xd({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(o||"my bank")):void Rr({error:new Error("No new accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}});if(!i.some(e=>"ACTIVE"===e.status))return Rr({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),Gd({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:Vd,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return Rr({error:new Error("Accounts saved successfully with unsupported accounts"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),function(e,t,n){const r=e.length;return Gd({title:"All set! Ready to track your transactions?",body:P("div",{className:Jd,children:[S(cs,{wrap:"wrap",children:`Your ${n} ${t} ${Qd("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),S(cs,{wrap:"wrap",children:`The following linked ${r>1?"accounts are":"account is"} not supported at this time, so ${r>1?"they":"it"} will remain unsynced.`}),S("ul",{children:e.map(e=>S("li",{children:S(cs,{wrap:"wrap",children:Go(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:Hd,label:"Get Started",type:_d}]})}(s,o,e.plaidItemAccounts.length);const c=function(e,t){const n=[];for(const r of e){if(!r.apiMask)continue;const e=t.find(e=>e.mask===r.apiMask&&r.isSupported);e&&n.push({destinationAccount:eu(r),duplicateAccount:e})}return n}(i,a);return c.length>0?async function({institutionName:e,matchingAccountPairs:t,plaidItemAccounts:n}){const r=t.slice(0,3),a=t.length>3;await Gd({title:"Your transactions are being categorized",body:P("div",{className:em,children:[S(cs,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),S(cs,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),P("ul",{children:[r.map(({duplicateAccount:e})=>S("li",{children:S(cs,{wrap:"wrap",children:Go(e?.name??"",e?.mask??"")})},e?.id)),a&&S("li",{children:S(cs,{wrap:"wrap",children:"and more..."})})]}),S(cs,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:Vd,label:"No thanks"},{key:Hd,label:"Review",type:_d}]})===Hd&&await $g({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(Rr({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,Gd({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${Qd("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:Hd,label:"Get started",type:_d}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return Rr({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await Gd({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:Vd,label:"Cancel"},{key:Hd,label:"Chat",type:_d}]})===Hd&&Xd({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function am(e,t,n){return On(e)?(Pr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(Pr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(Rr({error:new Error("Plaid Item sync failed, refreshing Plaid Items"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),!0):("INVALID_UPDATED_USERNAME"===e.error_code&&(Rr({error:new Error("Plaid Item sync failed due to invalid updated username"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),await async function(e){const t=await Gd({title:e||"Invalid Updated Username",body:'Your bank account has an updated username. To fix it, tap "Banks & Integrations", and unlink your old account, so you can relink it with your new username. If you need any assistance, tap "Chat" to chat with a member of our team.',buttons:[{key:Vd,label:"Cancel"},{key:"chat",label:"Chat"},{key:Hd,label:"Banks & Integrations",type:_d}]});"chat"===t?Xd({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==Hd||(e=>{const t=Xe.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||vl("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const om=e=>{const t=e.find(e=>e.isSupported&&e.lastSyncedDate);if(t&&t.lastSyncedDate)return`Last synced ${Pn(t.lastSyncedDate)}`},im=e=>{let t;return t=e.isSupported?"ACTIVE"!==e.status?"Archived":e.syncTransactions?"Processing":"Not Synced":"Not Supported",t},lm="PLAID_LINK_NEW",sm="PLAID_LINK_UPDATE",cm="PLAID_LINK_UNLINK";function dm({plaidEvent:e,plaidItemId:t,apiAccessToken:n,apiErrorCode:r,message:a}){return{eventType:"onPlaidLink",message:a,defaultPrevented:!0,data:{plaidEvent:e,integrationId:t,apiAccessToken:n,apiErrorCode:r}}}const um=v({});function hm({onPlaidLink:e,children:t}){return S(um.Provider,{value:{onPlaidLink:e},children:t})}function pm(){return b(um)}async function gm(e){const{url:t,headers:n}=Ur(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=Or({extraHeaders:n,authorization:t});Pr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return Pr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),Fr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const mm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:_r(n)};return await qr(r)};function vm(){return ru({mutationFn:mm,onSuccess:()=>{const e=["integrations"];return zn.invalidateQueries({queryKey:e})}})}const bm=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:_r(t)};return await qr(n)};function fm(){return ru({mutationFn:bm,onSuccess:()=>{const e=["integrations"];return zn.invalidateQueries({queryKey:e})}})}const ym=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String($o(e.id)),removeFromApi:e.removeFromApi},accessToken:t,endpointManager:_r(n)};return await async function(e){return gm(e)}(r)};function xm(){const{mutate:e}=fm();return ru({mutationFn:ym,onSuccess:()=>{const e=["integrations"];return zn.invalidateQueries({queryKey:e})},onError:async t=>{Rr({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await Gd({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:Vd,label:"Cancel"},{key:Hd,label:"Try Again",type:_d}]})===Hd&&e()}})}function km(e){return new Promise(t=>{window.Plaid.create({token:e,onSuccess:(e,n)=>t({status:"success",public_token:e,metadata:n}),onExit:(e,n)=>t({status:"exit",metadata:n,error:e}),onEvent:(e,t)=>{Pr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function Tm(e,t,n,r){const a=await tm(e,t,n);if(!a)return;const o=await km(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;Pr("Plaid link successful",{public_token:e,metadata:a});const i=await rm(e,a,t,n);if(i.relinkPlaidItemId)return Tm(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;Pr("Plaid link exited",{metadata:e,error:t}),await am(t,e,a)&&r()}else Rr({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function wm(){const[e,t]=Dd({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Hn(),r=Yn(),{mutate:a}=fm(),{onPlaidLink:o}=pm();return{linkPlaid:e=>{if(Fn(o)){const t=dm(e);o(t)}else Tm(e.plaidItemId?$o(e.plaidItemId):void 0,n,r,a)},loading:e||Fn(t),hasOnPlaidLinkOverride:Fn(o)}}function Cm(){const[e,t]=Dd({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Hn(),r=Yn(),{mutate:a}=fm(),{apiPartnerName:o}=b(Qs),{onPlaidLink:i}=pm();return{linkPlaid:e=>{if(Fn(i)){const t=dm(e);i(t)}else!async function(e,t,n,r,a){const o=await tm(e,t,n);if(!o)return;const i=await km(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;Pr("Plaid link from search successful",{public_token:e,metadata:o});const l=await async function(e,t,n,r,a){if(t?.institution?.institution_id){const i=await nm(t.institution.institution_id,n,r);if(i)return Rr({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,Gd({title:"Already Linked",body:`It seems that this bank is already linked${o?` with ${o}`:""}. Please tap "Relink" to update the existing linked institution.`,buttons:[{key:Vd,label:"Cancel"},{key:Hd,label:"Relink",type:_d}]}))===Hd?{relinkPlaidItemId:$o(i.id)}:{}}var o;return Pr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),rm(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&Tm(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;Pr("Plaid link from search exited",{metadata:e,error:t}),await am(t,e,o)&&a()}}(e.plaidItemId?$o(e.plaidItemId):void 0,n,r,o,a)},loading:e||Fn(t),hasOnPlaidLinkOverride:Fn(i)}}const Am=Qt(null,Vl,Ut({position:"absolute",left:1,right:1,bottom:1,width:"calc(100% - 2)",height:"44px",background:"surface.intent.primary",border:"none",borderRadius:0,gap:9,color:"icon.intent.primary",pointerEvents:"all",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),Ai);function Em(){const{linkPlaid:e,loading:t}=wm();return P("button",{onClick:()=>e({plaidEvent:lm,message:"Tile Plaid Link button pressed"}),...Am,disabled:t,children:[S(Sd,{Component:Id}),S(cs,{intent:"primary",children:"Link Account"})]})}const Im=Ut({width:266,minHeight:32});function Sm(){return S($a,{styles:Im})}const Nm=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),Pm=({defaultRange:e=hn.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return Qr({filter:e,select:Ed})}({filter:e});let o;return o=t?uo:r??Nm,P(ia,{isSample:t,children:[S(na,{title:"Profit + Loss"}),S(aa,{children:a?P(to,{children:[S(Sm,{}),S(Sm,{})]}):P(N,{children:[S(ma,{title:Ta(o.netIncome),label:"Profit"}),P(ba,{children:[S(Cd,{amount:o.income,total:o.absoluteSum,color:"positive",label:"Income"}),S(Cd,{amount:o.expenses,total:o.absoluteSum,color:"negative",label:"Expenses"})]})]})}),t&&S(lo,{size:"sm"}),n&&S(Em,{})]})},Rm=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],Dm={moneyIn:0,moneyOut:0,netMoneyIn:0};const Mm=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...mn(n.filter)},accessToken:r,endpointManager:_r(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||On(n)||On(n.operatingActivities)||!n.operatingActivities.children?Dm:function(e){let t=new B(0),n=new B(0);for(const r of e.children)r.total<0?n=n.plus(B(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await qr(o))},Lm=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),Om=({defaultRange:e=hn.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return _n({queryKey:Rm({filter:e}),queryFn:Mm})}({filter:e});let i;i=t?po:r??Lm;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),P(ia,{isSample:t,children:[S(na,{title:"Cash Flow"}),S(aa,{children:o?P(to,{children:[S(Sm,{}),S(Sm,{})]}):P(N,{children:[S(ma,{title:Ta(i.netMoneyIn),label:"Change in Cash"}),P(ba,{children:[S(Cd,{amount:i.moneyIn,total:l,color:"positive",label:"Money In"}),S(Cd,{amount:i.moneyOut,total:l,color:"negative",label:"Money Out"})]})]})}),t&&S(lo,{size:"sm"}),n&&S(Em,{})]})},Fm=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),Bm=Qt(null,Ut({display:"flex",justifyContent:"end"}));function Um({color:e,bulletLabel:t,moneySummary:n}){return P("div",{...Fm,children:[S(Oa,{color:e,label:t}),S("div",{...Bm,children:S(cs,{children:n})})]})}const Vm={total:0,children:[]},Wm=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||On(n)||On(n.expenses)||!n.expenses.children?Vm:{total:n.expenses.total??0,children:(r=n.expenses.children,r.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var r},Hm=Qt(null,Ut({display:"flex",gap:"10px",alignItems:"center"})),qm=Ut({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),jm=Qt(null,qm);function zm({bulletAmount:e=3,shimmer:t=!1}){return S(N,{children:Array.from({length:e},(e,n)=>P("div",{...Hm,children:[S(Oa,{color:Ra.var("colors.brand.secondary")}),t?S($a,{styles:qm}):S("div",{...jm})]},n))})}const Km=Qt(null,Ut({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),Ym=[Ra.var("colors.brand.primary"),Ra.var("colors.brand.success"),Ra.var("colors.brand.action")],_m=Object.freeze({total:0,children:[]});function Zm({defaultRange:e=hn.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=Xe(e=>e.externalOptions).dataVisualizationColors??Ym,{query:{data:o},isFilling:i}=function({filter:e}){return Qr({filter:e,select:Wm})}({filter:e});let l;l=n?ho:o??_m;const s=void 0===t?"Total Expenses":`${bn[t]} Total`,c=l.children.length>0;return P(ia,{isSample:n,children:[S(na,{title:"Expenses"}),S(aa,{children:i?S(to,{children:S(zm,{shimmer:!0})}):P(N,{children:[S("div",{...Km,children:S(ma,{title:Ta(l.total),label:s})}),S(ba,{children:c?l.children.map((e,t)=>S(Um,{color:a[t],bulletLabel:e.name,moneySummary:Ta(e.total)},t)):S(zm,{})})]})}),n&&S(lo,{size:"sm"}),r&&S(Em,{})]})}const Gm=Qt(null,Ut({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Qm({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:ln(l=e.year,i,1),endDate:ln(l,i+1,0)});var i,l,s,c,d,u,h,p;return P("div",{...Gm,children:[P(Jt,{children:[S(an,{children:"Monthly Review"}),S(ud,{period:e,setPeriod:t,disableNext:r||(s=e,c=n,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:r})]}),P(pd,{children:[S(Pm,{defaultRange:o,isSample:r,showLinkAccountButton:a}),S(Om,{defaultRange:o,isSample:r,showLinkAccountButton:a}),S(Zm,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const Xm="Oldest to Newest",Jm="Newest to Oldest",$m="A-Z",ev="Z-A",tv="Lowest to Highest",nv="Highest to Lowest",rv="A-Z",av="Z-A";function ov(){const[e,t]=y(void 0),n=m(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in yl)??!1,n=(e.direction&&e.direction in xl)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const iv=Ut({width:"15px",height:"15px",borderRadius:"sm",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,position:"relative","&::before":{content:"''",position:"absolute",top:"-10px",left:"-10px",right:"-10px",bottom:"-10px"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),lv=Ut({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),sv=Ut({background:"brand.primary.strong",border:"none"});function cv({checked:e,onClick:t}){const[n,r]=y(e??!1),a=void 0===e?n:e;return S("button",{...Qt(zt["checkbox-input"],iv,a?sv:lv,Ei),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&S(Ss,{Component:fu})})}const dv=Qt(null,Ut({paddingLeft:"20px",paddingRight:"5px"}));function uv({checked:e,onClick:t}){return S("div",{...dv,children:S(cv,{checked:e,onClick:t})})}const hv=Qt(zt.text,Ut({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),la);function pv({children:e}){return S("div",{...hv,children:e})}const gv=Qt(zt["date-cell"],Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function mv({date:e,annotation:t}){const n=Tn(An(e));return P("div",{...gv,children:[t&&S(pv,{children:t}),S(cs,{children:n})]})}const vv=Ut({color:"money.negative"}),bv=Ut({color:"money.positive"}),fv=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Bn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" "),yv=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 10.625H7.5C5.8424 10.625 4.25269 9.96652 3.08058 8.79442C1.90848 7.62231 1.25 6.0326 1.25 4.375V0.625",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M10 14.375L13.75 10.625L10 6.875",stroke:"currentColor",strokeMiterlimit:10})),"ChildRow"),xv=Qt(zt["transaction-date-cell-container"],Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}));function kv({transaction:e,showTypeLabel:t=!1,isChild:n=!1}){const r=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let n;return n=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:n,css:t?bv:vv}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?vv:bv}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?vv:bv};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?vv:bv};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:vv};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=bv;return e.amount<0&&(t="Invoice Payment Refund",n=vv),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:fv(e.type),css:e.amount<0?vv:bv}))(e)}return t})(e),a=Qt(zt["transaction-type-label"],r.css),o=t?S("span",{...a,children:r.displayName}):void 0;return n?P("div",{...xv,children:[S(Sd,{Component:yv}),S(mv,{date:e.date,annotation:o})]}):S(mv,{date:e.date,annotation:o})}const Tv=Ut({display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",width:"100%"}),wv=Ut({display:"flex",flexDirection:"column",width:"100%"}),Cv=Ut({width:20,minWidth:20,height:20,minHeight:20,borderRadius:"9999px"});function Av({label:e,subLabel:t,iconUrl:n}){return P("div",{className:Tv,children:[n?S("img",{src:n,className:Cv,alt:void 0,width:24,height:24}):S("span",{className:Cv}),P("div",{className:wv,children:[S(cs,{children:e}),S(Ia,{children:t})]})]})}function Ev({bankTransaction:e,isChild:t=!1}){return t?S("div",{className:Ut({paddingLeft:"25px"}),children:S(Av,{label:e.displayName,subLabel:e.description,iconUrl:e.iconUrl})}):S(Av,{label:e.displayName,subLabel:e.bankAccount?.displayName,iconUrl:e.iconUrl})}function Iv(e){return wa(Th(e.amount))}const Sv=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.10632H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.69366H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.28131H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8687H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.71875 10.4749L3.33125 12.8686L0.9375 10.4749",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 1.50635V12.8688",stroke:"currentColor",strokeMiterlimit:10})),"NestedRows"),Nv=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.13135H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.71851H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.30682H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8934H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M0.9375 4.5251L3.33125 2.13135L5.71875 4.5251",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 13.4938V2.13135",stroke:"currentColor",strokeMiterlimit:10})),"NestedRowsExpanded"),Pv=Ut({display:"flex",alignItems:"center",gap:"8px"}),Rv=Ut({padding:"6px"});function Dv({row:e}){const t=e.original,n=S(cs,{children:Iv(t)});if(e?.getCanExpand()){const t=e.getIsExpanded();return S(js,{ariaLabel:t?"Collapse children":"Expand children",ariaExpanded:t,children:P("div",{className:Pv,children:[S(Sd,{Component:t?Nv:Sv}),n]})})}return S("div",{className:Rv,children:n})}const Mv=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 1.25L1.25 13.75",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M13.75 9.84375V1.25H5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Withdraw"),Lv=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 13.75L1.25 1.25",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.15625 13.75H13.75V5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Deposit"),Ov=Ut({padding:"10px",height:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"8px"}),Fv=Ut({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"});function Bv({annotation:e,accountName:t}){const n=(e=>{switch(e){case"Withdrawn from":return Mv;case"Deposited to":return Lv;default:return null}})(e);return P("div",{className:Ov,children:[n&&S(Sd,{Component:n}),P("div",{className:Fv,children:[e&&S(Ia,{children:e}),t&&S(cs,{children:t})]})]})}const Uv=Ut({maxWidth:"100%",width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background","& .Tight-sub-label":{color:"typography.base"},"& .Tight-icon > path":{stroke:"icon.base"}}),Vv=Wt(Uv,Ut({padding:"2.5px"})),Wv=Wt(Uv,Ut({padding:"4px 5px",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{}})),Hv=Ut({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-label":{color:"typography.intent.secondary"},"& .Tight-icon > path":{stroke:"icon.intent.secondary"}}),qv=Wt(Hv,Ut({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),jv=Ut({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-label":{color:"typography.intent.action"},"& .Tight-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}}}),zv=Wt(jv,Ut({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),Kv=Ut({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-label":{color:"typography.intent.success"},"& .Tight-icon > path":{stroke:"icon.intent.success"}}),Yv=Wt(Kv,Ut({_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}}})),_v=Ut({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-label":{color:"typography.intent.warning"},"& .Tight-icon > path":{stroke:"icon.intent.warning"}}),Zv=Wt(_v,Ut({_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}}})),Gv=Ut({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-label":{color:"typography.intent.danger"},"& .Tight-icon > path":{stroke:"icon.intent.danger"}}),Qv=Wt(Gv,Ut({_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}}})),Xv=Ut({display:"flex",alignItems:"center",gap:"8px",height:"37px",margin:"0 8px",padding:"10px",borderRadius:"sm",cursor:"pointer",minWidth:0,outline:"none","&:focus-visible":{outline:"2px solid",outlineColor:"border.layout",outlineOffset:"2px"}}),Jv={default:qv,neutral:qv,warning:Zv,success:Yv,critical:Qv,highlight:zv},$v=w(function({variant:e="default",children:t,stylists:n=[],...r},a){const o=tn([Qt(zt["selector-button"],Wt(Xv,Jv[e]),Ei),...n]);return S("button",{ref:a,...o,...r,children:t})}),eb={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function tb(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function nb(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(o=r,t.find(e=>e.children.some(e=>e.accountNo===o.accountNo)));var o;!a&&r.children.length>0?function(e,t){e.children.forEach(n=>{tb(e,n,t)})}(r,n):a&&tb(a,r,n)}),n}const rb=[Qt(null,Ut({marginLeft:"6px",marginRight:"6px"}))],ab=Qt(null,Ut({whiteSpace:"normal"}));function ob({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=Np(),o=Fp(r,e),i=m(()=>new Ce(o,eb),[o]),l=m(()=>nb(i.search(n),o),[o,n,i]);return a?S(zh,{}):l.map(({parent:e,child:n})=>S(Wh,{onClick:()=>t(n),children:P(lp,{stylists:[ab],children:[e.name,S(Ni,{Component:Ci,stylists:rb}),n.name]})},`${n.accountNo}`))}function ib({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=Sp(),o=Fp(n,e);return a?S(zh,{}):a||r||void 0!==n?o.map(e=>S(mp,{triggerChildren:S(fp,{displayLabel:e.name}),popupChildren:S(lb,{glAccount:e,onClick:t})},e.accountNo)):S(qh,{text:"No data"})}function lb({glAccount:e,onClick:t}){return S(Mh,{children:e.children.map(e=>S(Wh,{onClick:()=>t(e),children:S(Aa,{children:e.name})},e.accountNo))})}const sb=Ut({maxWidth:"420px",width:"fit-content"});function cb({onClick:e,types:t}){const{query:{data:n}}=Sp(),r=Fp(n,t);return S(Bh,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?sb:void 0,SearchList:ob,DefaultList:ib,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}const db=async({data:e,accessToken:t,environment:n})=>hb({data:{data:e},accessToken:t,environment:n}),ub=async({data:e,accessToken:t,environment:n})=>db({data:[e],accessToken:t,environment:n}),hb=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:Ao(n)};return await Hr(r)};function pb(){return ru({onSuccess:async()=>{const e=["banks/transactions"];return Pr("mutation successful, invalidating BT queries"),zn.invalidateQueries({queryKey:e}).catch(e=>Rr({error:e,severity:"error"}))},mutationFn:db})}function gb(){return ru({onSuccess:async()=>(Pr("mutation successful, invalidating BT queries"),zn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>Rr({error:e,severity:"error"}))),mutationFn:ub})}function mb({transaction:e,parentTransaction:t,accountName:n}){const{startPrefetch:r,cancelPrefetch:a}=Yi({prefetchFn:Do(Ap,Ep)}),{mutate:o}=gb(),i=void 0!==t;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>P($v,{...t,onMouseEnter:r,onMouseLeave:a,children:[e.glAccount&&S("img",{src:e.glAccount.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(cs,{children:n})]})}),S(cb,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,glAccountId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{o({id:e.id,glAccountId:t.id})},types:Op})]})}const vb=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),bb=Qt(null,Ut({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),fb=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function yb({transaction:e}){const t=e.children.map(e=>e?.category?.name??e?.glAccount?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=Qd("Category","Categories",n.size,!0);return S(ls,{children:P("div",{...fb,children:[S(Sd,{Component:vb}),P("div",{...bb,children:[S(Aa,{children:a}),S(Ia,{children:r})]})]})})}function xb({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=ap(),a=e.category?.name??"",{mutate:o}=gb(),i=void 0!==t;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>P($v,{...t,onMouseEnter:n,onMouseLeave:r,children:[e.category&&S("img",{src:e.category.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(cs,{children:a})]})}),S(kp,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,categoryId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{t?.id&&o({id:e.id,categoryId:t.id.toString()})}})]})}function kb({transaction:e,parentTransaction:t}){if(e.children.length>0)return S(yb,{transaction:e});switch(e.type){case"EXPENSE":case"BILL_PAYMENT":case"PAYROLL_PAYMENT":case"LOAN_PAYMENT":return S(xb,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return S(Bv,{annotation:ni(e.amount),accountName:e.bankAccount?.name});case"PAYOUT":return Rr({error:new Error("Should not get here. Payout without line items."),severity:"error"}),null;default:return S(mb,{transaction:e,parentTransaction:t,accountName:e.glAccount?.name})}}function Tb({name:e}){return S(N,{children:e&&S(cs,{children:e})})}const wb=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],Cb=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function Ab({onClick:e}){const t=As(),{userRole:n}=b(Qs),r=(e=>{switch(e){case"OWNER":default:return wb;case"ACCOUNTANT":return Cb}})(n)||[];return S(Fs,{children:S(Mh,{children:r.map(({status:n,displayName:r})=>S(Wh,{onClick:()=>(e(n),void t.close()),children:S(Aa,{children:r})},n))})})}const Eb=Ti(e=>p.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag",{styleIconKey:"flag"}),Ib=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),Sb=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck",{styleIconKey:"checkmark"}),Nb={PARTNER_REVIEW_REQUIRED:"PARTNER_REVIEW_REQUIRED",USER_REVIEW_REQUIRED:"USER_REVIEW_REQUIRED",ACCOUNTANT_REVIEW_REQUIRED:"ACCOUNTANT_REVIEW_REQUIRED",RECONCILIATION_STAGED:"RECONCILIATION_STAGED",RECONCILED:"RECONCILED",RECONCILIATION_DISCREPANCY:"RECONCILIATION_DISCREPANCY",RECONCILIATION_AWAITING:"RECONCILIATION_AWAITING"},Pb=[{name:"Needs Review",value:[Nb.USER_REVIEW_REQUIRED],icon:Eb},{name:"Flagged to Accountant",value:[Nb.ACCOUNTANT_REVIEW_REQUIRED],icon:Eb},{name:"Discrepancy",value:[Nb.RECONCILIATION_DISCREPANCY],icon:xu},{name:"Processing",value:[Nb.PARTNER_REVIEW_REQUIRED,Nb.RECONCILIATION_STAGED],icon:Ib},{name:"Reconciled",value:[Nb.RECONCILED],icon:Sb}],Rb=[{name:"Needs Review",value:[Nb.ACCOUNTANT_REVIEW_REQUIRED],icon:Eb},{name:"Flagged to Business Owner",value:[Nb.USER_REVIEW_REQUIRED],icon:Eb},{name:"Discrepancy",value:[Nb.RECONCILIATION_DISCREPANCY],icon:xu},{name:"Processing",value:[Nb.PARTNER_REVIEW_REQUIRED],icon:Ib},{name:"Reconciled",value:[Nb.RECONCILED],icon:Sb}];function Db(e){return e in Nb}const Mb=(e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Nb.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===Nb.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===Nb.ACCOUNTANT_REVIEW_REQUIRED||l===Nb.RECONCILIATION_AWAITING),a=((e,t)=>"ACCOUNTANT"===t&&e===Nb.USER_REVIEW_REQUIRED)(e,t),o=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);var l;let s,c,d;return r?(s="Pending Review",c=Ib,d="neutral"):a?(s="Pending User Review",c=Ib,d="neutral"):n?(s="Needs Review",c=Eb,d="warning"):o?(s="Discrepancy",c=xu,d="critical"):i?(s="Reconciled",c=Sb,d="success"):(s="Processing",c=Ib,d="neutral"),{text:s,variant:d,Icon:c}},Lb=Qt(zt["review-status-selector-button"]),Ob=Qt(zt["review-status-dropdown-arrow"],Ut({display:"none"}));function Fb({status:e,transactionId:t}){const[n,r]=y(!1),{mutate:a}=gb(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=b(Qs),{text:s,variant:c,Icon:d}=Mb(e,l);return t&&((u=t).startsWith(Qo.TRANSACTION_LINE_ITEM)||u.startsWith(Qo.PROCESSOR_TRANSACTION))?null:P(Cs,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,placement:"bottom-start",children:[S(Es,{children:e=>P($v,{variant:c,...e,stylists:[Lb],onClick:i,children:[S(Sd,{Component:d}),S(cs,{children:s}),S("div",{...Ob,children:S(Ni,{Component:Hu})})]})}),S(Ab,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function Bb({status:e,transactionId:t}){return S(Fb,{status:e,transactionId:t},t)}function Ub(){return S(Sd,{Component:Ci})}function Vb(){return S(Ub,{})}const Wb=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),Hb=Qt(null,Ut({stroke:"icon.base.weak"}));function qb({hasConversation:e,hasUnread:t=!1}){return S(N,{children:e?S(jc,{hasUnread:t}):S("div",{"data-testid":"no-conversations-dash",children:S(Ss,{Component:Wb,stylists:[Hb]})})})}function jb({conversationId:e}){const{query:{data:t}}=el(e??null),{startPrefetch:n,cancelPrefetch:r}=nl(),{startPrefetch:a,cancelPrefetch:o}=Dl(),i=Fn(t),l=i&&"READ"===t?.readStatus,s=x(()=>{Fn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=x(()=>{Fn(e)&&(r(),o())},[e,r,o]);return S("div",{onMouseEnter:s,onMouseLeave:c,children:S(qb,{hasConversation:i,hasUnread:!l})})}const zb=Qt(zt["badge-chip"],Vv),Kb=Qt(null,ca),Yb=Qt(null,Ei),_b=Qt(zt["neutral-badge"],Hv),Zb=Qt(zt["highlight-badge"],jv),Gb=Qt(zt["success-badge"],Kv),Qb=Qt(zt["warning-badge"],_v),Xb=Qt(zt["critical-badge"],Gv);function Jb({type:e,children:t}){let n;switch(e){case"critical":n=Xb;break;case"warning":n=Qb;break;case"neutral":n=_b;break;case"success":n=Gb;break;case"highlight":n=Zb}const r=tn([zb,Kb,n,Yb]);return S("div",{...r,children:t})}function $b({reviewStatus:e}){const{userRole:t}=b(Qs),{variant:n,Icon:r}=Mb(e,t);return S(Jb,{type:n,children:S(Sd,{Component:r})})}const ef=Ut({padding:"12px 16px",display:"flex",gap:"6px",flexDirection:"row",maxWidth:"100%"}),tf=Ut({display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:"8px"}),nf=Ut({display:"flex",gap:"8px",justifyContent:"flex-start",alignItems:"center",minWidth:0}),rf=Ut({display:"flex",alignItems:"center",gap:"12px",minWidth:0}),af=Ut({display:"flex",gap:"8px",flexDirection:"column",minWidth:0}),of=Ut({width:24,minWidth:24,height:24,minHeight:24,borderRadius:"9999px"});function lf({row:e}){const t=e.original;return P("div",{className:ef,children:[P("div",{className:af,children:[P("div",{className:nf,children:[t.iconUrl?S("img",{src:t.iconUrl,className:of,alt:void 0,width:24,height:24}):S("span",{className:of}),S(Aa,{children:t.description})]}),P("div",{className:rf,children:[S($b,{reviewStatus:t.reviewStatus}),S(Ia,{children:t.bankAccount?.name})]})]}),P("div",{className:tf,children:[S(Dv,{row:e}),S(Ni,{Component:Ci})]})]})}const sf=G(),cf=[sf.display({id:$e.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?S(uv,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),sf.accessor("date",{id:$e.DATE,cell:e=>{const t=void 0!==e.row.getParentRow();return S(ls,{children:S(kv,{transaction:e.row.original,isChild:t})})},header:()=>S(_s,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Xm,sortDescDisplay:Jm}),size:130,maxSize:144}),sf.accessor("description",{id:$e.DESCRIPTION,cell:e=>{const t=void 0!==e.row.getParentRow();return S(ls,{children:S(Ev,{bankTransaction:e.row.original,isChild:t})})},header:()=>S(_s,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:$m,sortDescDisplay:ev}),size:180}),sf.accessor("amount",{id:$e.AMOUNT,cell:e=>S(ls,{alignVariant:"flexEnd",children:S(Dv,{row:e.row})}),header:()=>S(_s,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:tv,sortDescDisplay:nv,align:"right"}),size:130,maxSize:130}),sf.accessor("category.id",{id:$e.CATEGORY,cell:({row:e})=>S(kb,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>S(_s,{columnName:"Category",padding:"none"}),size:130,meta:{clickable:!0}}),sf.accessor(e=>e.classSegments[0]?.id,{id:$e.CLASS_SEGMENT,cell:e=>S(ls,{children:S(Tb,{name:e.row.original.classSegments[0]?.name})}),header:()=>S(_s,{columnName:"Business"}),size:130}),sf.accessor("reviewStatus",{id:$e.REVIEW_STATUS,cell:e=>S(ls,{children:S(Bb,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>S(_s,{columnName:"Status",sortDef:"REVIEW_STATUS",sortAscDisplay:rv,sortDescDisplay:av,padding:"large"}),size:200,maxSize:230,meta:{clickable:!0}}),sf.display({id:$e.COMMENTS,cell:e=>{const t=e.row.original;return S(ls,{alignVariant:"center",children:S(jb,{conversationId:t.conversation?.id})})},header:()=>S(_s,{columnName:"Comments"}),size:80,maxSize:110,meta:{clickable:!0}}),sf.display({id:$e.EXPAND,cell:()=>S("div",{className:Ut({paddingRight:"20px"}),children:S(Vb,{})}),size:40,maxSize:60})],df=sf.display({id:"MOBILE",cell:e=>S(lf,{row:e.row})}),uf=v({dimensions:{width:null,height:null}});function hf(){const{dimensions:e}=b(uf);return Fn(e.width)&&e.width<parseInt(Ra("sizes.breakpoint-xl"))}const pf=[];function gf({transactions:e,columns:t}){const n=hf(),r=n?["MOBILE"]:t,a=n?{MOBILE:!0}:function(e){if(e)return Object.values($e).reduce((t,n)=>(t[n]=e.includes(n),t),{})}(t),o=n?[df]:(i=t)?cf.filter(e=>i.includes(e.id)):cf;var i;return Q({data:e??pf,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??pf.length,columns:o,getCoreRowModel:X(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,iconUrl:t.iconUrl??"",reconciliationMatch:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],suggestedCategories:[],conversation:null};var t}),getExpandedRowModel:J(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:r,columnVisibility:a}})}const mf=[$e.COMMENTS,$e.DATE,$e.DESCRIPTION,$e.AMOUNT,$e.CATEGORY,$e.REVIEW_STATUS];function vf(e,t){return vl("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function bf(e){const t=e.row,n=e.column.columnDef.meta?.clickable,r=t.getCanExpand(),a="BANK_TRANSFER"===t.original.type,o="category"===e.column.id&&(r||a),i="comments"===e.column.id,l="amount"===e.column.id;if(i){const e=t.getParentRow();vf(e?.original.id??t.original.id,"conversation")}else if(l&&r)t.toggleExpanded();else if(!n||o){const e=t.getParentRow();vf(e?.original.id??t.original.id)}}function ff({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Il(),a=x(()=>n({id:e.original.id}),[n,e.original]);return S(ml,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:bf,shouldDisplayDivider:n=>{return r=n,a=t,o=e.getVisibleCells().length,!(0===r||a&&1===r||r===o-1||a||1===r);var r,a,o}})}function yf(){return P(N,{children:[S(Tc,{Component:Sb}),S(Aa,{wrap:"wrap",children:"All caught up"}),S(Ia,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const xf=Qt(zt["button-warning"],Ut({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-text":{color:"typography.intent.warning.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.warning.active",borderColor:"border.intent.warning.active","& .Tight-text":{color:"typography.intent.warning.active"}},"& .Tight-text":{color:"typography.intent.warning"}}));function kf({children:e,stylists:t=[],...n}){return S(Gl,{stylists:[xf,...t],...n,children:e})}function Tf(){const{linkPlaid:e,loading:t}=wm();return S(kf,{onClick:()=>e({plaidEvent:lm,message:"Plaid Link button pressed"}),disabled:t,children:S(Aa,{children:"Link your bank"})})}const wf=Qt(null,Ut({whiteSpace:"wrap"}));function Cf(){return P(N,{children:[S(Tc,{Component:_p}),S(Aa,{textAlign:"center",stylists:[wf],children:"Your bank transactions will be categorized for you"}),S(Ia,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),S(Tf,{})]})}const Af=Ut({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Ef(){return P(N,{children:[S("div",{className:Af,children:S(Sd,{Component:Ib})}),S(Aa,{children:"Transactions are being processed"}),S(Ia,{children:"Any transactions that require review will show up here."})]})}function If(){const{dimensions:e}=b(uf);return Fn(e.width)&&e.width<parseInt(Ra("sizes.breakpoint-xl"))}const Sf=Ut({xl:{minWidth:"900px"}});function Nf({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return gf({transactions:e,columns:t?[...t,$e.EXPAND]:void 0})}({transactions:e,columns:mf})}({transactions:o}),{query:{data:l},isFilling:s}=Cl({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=If(),d=!On(l?.data?.[0])&&!s,u=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=S(yf,{})):r=S(Ef,{}):r=S(Cf,{}),r}(e??!1,o.length>0,d);return P("div",{className:Sf,children:[S("div",{id:yo}),P(Si.Provider,{value:a,children:[P(Jt,{children:[S(an,{children:c?"Transactions":"Transactions For Your Review"}),S(Pc,{children:S(Li,{})})]}),S(rs,{dashboard:"businessOwnerDashboard",children:r?S(Wi,{}):P(N,{children:[S(as.Provider,{value:{sortInstance:t,setSortInstance:n},children:S(il,{headerGroups:i.getHeaderGroups()})}),On(u)?S(sl,{children:i.getRowModel().rows.map(e=>S(ff,{rowData:e,hasSelect:!1},e.id))}):S(kc,{children:u})]})})]})]})}function Pf(){const{sortInstance:e,setSortInstance:t,apiSort:n}=ov(),{query:{data:r},isFilling:a,paginationControls:o}=Cl({filter:ko,sort:n,limit:10}),i=r?.data??wo,{hasPlaidLinkedBankAccount:l,isFilling:s}=li();return S(Nf,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const Rf=Qt(zt["button-action"],Ut({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-text":{color:"typography.intent.action.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.active",borderColor:"border.intent.action.active","& .Tight-text":{color:"typography.intent.action.active"}},"& .Tight-text":{color:"typography.intent.action"}}));function Df({children:e,stylists:t=[],...n}){return S(Gl,{stylists:[Rf,...t],...n,children:e})}const Mf=Ti(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),p.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Lf=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Wc,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:Eb,buttonText:"Review"};case"LINK_BANK":return{Icon:_p,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:_p,buttonText:"Fix"};case"RELINK":return{Icon:_p,buttonText:"Relink"};case"CHAT":return{Icon:xu,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Mf,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Sb,buttonText:""};default:return{Icon:xu,buttonText:""}}},Of=Qt(zt["banner-title"],Ut({display:"flex",alignItems:"center",gap:"8px"})),Ff=Qt(zt["banner-icon"],Ut({width:"20px",height:"20px"}));function Bf({title:e,type:t}){const{Icon:n}=Lf(t);return P("div",{...Of,children:[S(Sd,{Component:n,stylists:[Ff]}),S(Aa,{wrap:"wrap",children:e})]})}const Uf=Qt(null,Ut({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:{base:"4px",xl:"5px"},flex:{xl:"1 1 0"},minWidth:{xl:"200px"},width:"100%"}));function Vf({title:e,description:t,type:n}){return P("div",{...Uf,children:[S(Bf,{title:e,type:n}),S(Ia,{wrap:"wrap",children:t})]})}const Wf=Qt(zt["banner-button"],Ut({display:"flex",justifyContent:"center",alignItems:"center",width:{base:"100%",xl:"128px"},gap:{xl:"15px"},flexShrink:{xl:"0"}})),Hf=Qt(zt["banner-button-text"]),qf=Qt(zt["banner-button-icon"]);function jf({priority:e,type:t,handleClick:n}){const{buttonText:r}=Lf(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:Fd};case"HIGH":return{Button:kf};case"MEDIUM":return{Button:Df};default:return{Button:Gl}}})(e);return P(a,{onClick:n,stylists:[Wf],children:[S(Aa,{stylists:[Hf],children:r}),S(Ni,{stylists:[qf],Component:Ci})]})}const zf=qt({base:{display:"flex",flexDirection:{base:"column",xl:"row"},padding:{base:"16px",xl:"15px"},gap:{base:"16px",xl:"0"},justifyContent:{xl:"space-between"},alignItems:{base:"flex-start",xl:"center"},alignSelf:"stretch",width:{base:"100%",xl:"auto"},minWidth:{xl:"350px"},borderRadius:{base:"sm",xl:"lg"},border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Kf={HIGH:zt["banner-high"],MEDIUM:zt["banner-medium"],LOW:zt["banner-low"],URGENT:zt["banner-urgent"]};function Yf({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=If()?a:r,s=Qt(zt.banner,Kf[i],zf({priority:i}));return P("div",{...s,children:[S(Vf,{title:n,description:l,type:o}),S(jf,{priority:i,type:o,handleClick:t})]})}function _f(e,t){Xd({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function Zf(e,t,n,r,a){return()=>Gd({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function Gf(e,t,n,r,a,o){return{alert:Zf(e,t,a,o,[{key:Vd,label:"Cancel"},{key:Eo.CHAT,label:"Chat",type:_d}]),actions:{[Eo.CHAT]:()=>_f(t,r)}}}function Qf(e){const{mutateAsync:t}=xm(),n=Hn(),r=Yn(),{apiPartnerName:a}=b(Qs),o=If(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=wm(),{linkPlaid:c,loading:d}=wm();if(On(e))return Gf(No({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=No({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case Eo.DELETE_OR_RELINK:case Eo.RELINK:return l?null:(g=i,m=a,v=o,{alert:Zf(u,(p=e).apiInstitutionName,m,v,[{key:Vd,label:"Cancel"},{key:Hd,label:"Relink",type:_d}]),actions:{success:()=>{g({plaidEvent:sm,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case Eo.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:Zf(e,t.apiInstitutionName,a,o,[{key:Vd,label:"Cancel"},{key:Eo.CHAT,label:"Chat"},{key:Hd,label:"Unlink and Relink",type:_d}]),actions:{success:async()=>{i||await n({id:String(t.id),removeFromApi:!0}),r({plaidEvent:"PLAID_LINK_UNLINK_RELINK",plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink and Relink Bank Error button pressed"})},[Eo.CHAT]:()=>_f(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case Eo.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:Zf(e,t.apiInstitutionName,i,l,[{key:Vd,label:"Cancel"},{key:Eo.CHAT,label:"Chat"},{key:Eo.RELINK,label:"Relink"},{key:Hd,label:"Go To Bank",type:_d}]),actions:{success:async()=>{const e=await Ld({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[Eo.RELINK]:()=>{o({plaidEvent:sm,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[Eo.CHAT]:()=>_f(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case Eo.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:Zf(e,t.apiInstitutionName,a,o,[{key:Vd,label:"Cancel"},{key:Hd,label:"Unlink",type:_d}]),actions:{success:()=>{i?r({plaidEvent:cm,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink Bank Error button pressed"}):n({id:String(t.id),removeFromApi:!0})}}}}(u,e,t,c,a,o,s);default:return Gf(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,v}const Xf=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){Rr({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function Jf({task:e}){const{linkPlaid:t,loading:n}=wm(),{linkPlaid:r,loading:a}=Cm(),o=Qf(e?.meta?.plaidItem),i=n&&"RELINK"===e.type,l=a&&"LINK_BANK"===e.type&&!1,s="RELINK"!==e.type&&"LINK_BANK"!==e.type&&On(o);return i||l||s?null:S(Yf,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:sm,plaidItemId:e?.meta?.plaidItem?.id,apiAccessToken:e?.meta?.plaidItem?.apiAccessToken,apiErrorCode:e?.meta?.plaidItem?.apiErrorCode,message:"Fix Relink Bank Error button pressed"}):"LINK_BANK"===e.type?(Pr("Plaid Banner Link Bank clicked",{plaidItem:e?.meta?.plaidItem}),r({plaidEvent:lm,message:"Plaid Banner Link Bank pressed"})):Fn(o)&&(Pr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),Xf(o))}})}const $f=Qt(zt.banner,zt["banner-default"],zf({priority:"DEFAULT"}));function ey(){const e=If()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return S("div",{...$f,children:S(Vf,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const ty=Qt(zt.banner,zt["banner-default"],zf({priority:"DEFAULT"}));function ny(){const e=If()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return S("div",{...ty,children:S(Vf,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ry=Ut({width:"100%",height:72,minWidth:"300px"});function ay(){return P(N,{children:[S($a,{styles:ry}),S($a,{styles:ry}),S($a,{styles:ry})]})}function oy({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?S(ay,{}):a?e.map(e=>{if(void 0===hi[e.type]||"ONBOARDING_FORM"===e.type&&On(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(Eo).includes(e.type))return S(Jf,{task:e},e.id);const n=e.actionLink,r=Fn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return S(Yf,{task:e,handleClick:r},e.id)}):S(n?ny:ey,{})}const iy=Qt(zt["button-table-header"]),ly=Ut({height:{xl:"auto",base:"44px"}});function sy(){const e=Yo({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return S("div",{className:ly,children:P(Xl,{onClick:()=>{vl(e?"BanksAndIntegrations":"NewConnection")},width:"fill-parent",stylists:[iy],children:[S(Ni,{Component:Id}),S(bs,{children:"Banks & Integrations"})]})})}const cy=Qt(zt["business-owner-dashboard"],Ut({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),dy=Ut({display:"flex",width:"100%",justifyContent:"center"}),uy=e=>{const t=xo[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},hy={status:{in:["ACTIVE","INACTIVE"]}},py={filter:{status:{in:["ACTIVE"]}}};function gy({period:e,onChangePeriod:t}){const{sortInstance:n,setSortInstance:r,apiSort:a}=function(){const[e,t]=y(void 0);return{sortInstance:e,setSortInstance:x(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in _i)??!1,n=(e.direction&&e.direction in Zi)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=Ji({limit:10,sort:a,filter:To}),s=o?.data??Co,c=If(),{query:{data:d},isFilling:u}=bi({select:e=>fi(e,c)},py),{query:{data:h}}=si(),{query:{data:p}}=Ho(),g=If(),v=m(()=>{let e=[];const t=p?.data;t&&(e=t.map(e=>Ro(e)));let n=[];!1===h?.hasPlaidLinkedBankAccount&&(n=[Po]);const r=d??[];return[...e,...n,...r]},[d,h,p]),b=function(){const{query:{data:e}}=Cl({filter:hy,limit:1});return(e?.data?.length??0)>0}(),f=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(b,h),k=/* @__PURE__ */new Date,T={month:k.getMonth(),year:k.getFullYear()};const[w,C]=Ts(T,e,t),A=(E=w.month,{beginDate:ln((I=w.year)-1,E+1,1),endDate:ln(I,E+1,0)});var E,I;return S("div",{className:dy,children:P("div",{...cy,children:[P(Jt,{children:[S(an,{children:"Action Items"}),S(sy,{})]}),S(bo,{children:S(oy,{taskBanners:v,handleScrollAction:uy,isWaitingForPlaidItemAccountsSync:!b&&!0===h?.plaidItemAccountsReadyToSync,isFilling:u})}),!g&&P(N,{children:[S(Qm,{period:w,handleDateChange:e=>{var t,n;(t=T).year===(n=e).year&&n.month>t.month||n.year>t.year||C(e)},todayPeriod:T,showSamples:f,showLinkAccountButton:f&&!h?.plaidItemAccountsReadyToSync}),S(Jt,{children:S(an,{children:"Financial Summary"})}),S(id,{isSample:f,period:w}),S(mo,{filter:A,isSample:f})]}),S(Mc,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:g}),!g&&S(Pf,{})]})})}function my(e){return S(Mr||N,{children:e.children})}function vy({children:e}){return S(my,{children:S("div",{className:Yt(zt.component),children:e})})}function by(e){return S(vy,{children:S(gy,{...e})})}function fy(e,t){return e?{...e,...t}:t}function yy(e){return qe({key:"category",name:"Category",possibleValues:e})}const xy=v(void 0);function ky(){return b(xy)}const Ty=e=>["sdk/introspect",e];function wy(e){return async t=>{const n=t.queryKey;return async function(e,t,n){const r={path:"/sdk/introspect",accessToken:e,environment:t,params:n?{theme:n}:void 0};return await zi(r)}(n[2].accessToken,n[2].environment,e)}}function Cy(){const e=ky();return _n({queryKey:Ty(e),queryFn:wy(e)})}const Ay=[{value:"in",label:"In"}];function Ey(e){return qe({key:"reviewStatus",name:"Review Status",possibleValues:e,operators:Ay})}const Iy=({displayInput:e,parsedInput:t,operator:n,model:r,handleFilterClick:a})=>{if(void 0===r.operators)return;const{label:o,value:i}=n;a(r.createFilter({name:`${o} ${e}`,value:{[r.key]:{name:"",value:{[i]:t}}}}))},Sy=h.object({amount:h.number({message:"Required"}),amountOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),Ny=Qt(null,Ut({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),Py=Qt(null,Ut({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function Ry({children:e,title:t,onCancelClick:n,onSubmit:r}){return P("form",{onSubmit:e=>{e.preventDefault(),r()},...Ny,children:[S(Aa,{children:t}),e,P("div",{...Py,children:[S(Vg,{showIcon:!1,onClick:n}),S(yu,{showIcon:!1,textContent:"Apply"})]})]})}function Dy({model:e,handleFilterClick:t}){const n=As(),r=function({model:e,handleFilterClick:t}){return Fg({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Sy},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:ka(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:wh(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return P(Ry,{title:"Amount...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[S(r.AppField,{name:"amountOperator",children:t=>S(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),S(r.AppField,{name:"amount",children:e=>S(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const My=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"greaterThan",label:"Greater than"},{value:"greaterThanEqual",label:"Greater than or equal to"},{value:"lessThan",label:"Less than"},{value:"lessThanEqual",label:"Less than or equal to"}],Ly=h.object({date:h.string().refine(e=>""!==e,{message:"Required"}),dateOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["On","Not on","After","Before","On or after","On or before"])})});function Oy({model:e,handleFilterClick:t}){const n=As(),r=function({model:e,handleFilterClick:t}){return Fg({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:Ly},onSubmit:n=>{const r={displayInput:Tn(An(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return P(Ry,{title:"Date...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[S(r.AppField,{name:"dateOperator",children:t=>S(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),S(r.AppField,{name:"date",children:e=>S(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Fy=[{value:"equal",label:"On"},{value:"notEqual",label:"Not on"},{value:"greaterThan",label:"After"},{value:"greaterThanEqual",label:"On or after"},{value:"lessThan",label:"Before"},{value:"lessThanEqual",label:"On or before"}],By=h.object({description:h.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Uy({model:e,handleFilterClick:t}){const n=As(),r=function({model:e,handleFilterClick:t}){return Fg({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:By},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return P(Ry,{title:"Description...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[S(r.AppField,{name:"descriptionOperator",children:t=>S(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),S(r.AppField,{name:"description",children:e=>S(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Vy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function Wy(e){return qe({key:"bankAccount",name:"Bank Account",possibleValues:e})}const Hy=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await zi(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Jo({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function qy(e){return qe({key:"customer",name:"Customer",possibleValues:e})}function jy(e){return qe({key:"vendor",name:"Vendor",possibleValues:e})}const zy={EXPENSE:"EXPENSE",REVENUE:"REVENUE",BANK_TRANSFER:"BANK_TRANSFER",TAX_PAYMENT:"TAX_PAYMENT",INVOICE_PAYMENT:"INVOICE_PAYMENT",PAYOUT:"PAYOUT",PAYROLL_PAYMENT:"PAYROLL_PAYMENT",BILL_PAYMENT:"BILL_PAYMENT",LOAN_PAYMENT:"LOAN_PAYMENT"},Ky=[{name:"Expense",value:zy.EXPENSE},{name:"Income",value:zy.REVENUE},{name:"Bank Transfer",value:zy.BANK_TRANSFER},{name:"Tax Payment",value:zy.TAX_PAYMENT},{name:"Invoice Payment",value:zy.INVOICE_PAYMENT},{name:"Payout",value:zy.PAYOUT},{name:"Payroll Payment",value:zy.PAYROLL_PAYMENT},{name:"Bill Payment",value:zy.BILL_PAYMENT},{name:"Loan Payment",value:zy.LOAN_PAYMENT}];function Yy(){return{values:[...Ky].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}const _y={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},Zy=[{name:"Active",value:_y.ACTIVE},{name:"Inactive",value:_y.INACTIVE},{name:"Removed",value:_y.REMOVED}],Gy=e=>e.map(e=>({id:e.id,status:_y.INACTIVE}));function Qy(){const e="in";return{values:[...Zy].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const Xy=h.object({notes:h.string().refine(e=>""!==e,{message:"Required"}),notesOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Jy({model:e,handleFilterClick:t}){const n=As(),r=function({model:e,handleFilterClick:t}){return Fg({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Xy},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};Iy(r)}});var n}({model:e,handleFilterClick:t});return P(Ry,{title:"Notes...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[S(r.AppField,{name:"notesOperator",children:t=>S(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),S(r.AppField,{name:"notes",children:e=>S(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const $y=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],ex=(tx={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,reconciliationMatch:!0,invoice:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(tx));var tx;function nx(e){return qe({key:"glAccount",name:"GL Account",possibleValues:e})}function rx(){const{filters:e,addFilters:t,removeFilter:n,hasUserConfiguredTransactionFilters:r}={filters:Xe(e=>e.transactionsDashFilters),addFilters:Xe(e=>e.addTransactionsDashFilters),removeFilter:Xe(e=>e.removeTransactionsDashFilter),hasUserConfiguredTransactionFilters:Xe(e=>e.hasInitializedTransactionFilters)},{getCategories:a,getBankAccounts:o,getVendors:i,getCustomers:l,getGlAccounts:c,getReviewStatuses:d}=function(){const e=function(){const{query:{data:e},isFilling:t}=$h(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"";var n;return{name:t,value:{category:{name:t,value:{id:{in:[(n=e).id?n.id.toString():""]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),t=function(){const{query:{data:e},isFilling:t}=Yo(),n=e?.data,r=m(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=Go(t,n);return{name:r,value:{bankAccount:{name:r,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),n=function(){const{query:{data:e},isFilling:t}=Ng(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Customer";return{name:t,value:{customer:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),r=function(){const{query:{data:e},isFilling:t}=bg(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Vendor";return{name:t,value:{vendor:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[t,r])}(),a=function(){const{query:{data:e},isFilling:t}=_n({queryKey:["clientMgmt/businesses","classSegments"],queryFn:Hy}),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Class Segment";return{name:t,value:{classSegments:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),o=function(){const{query:{data:e},isFilling:t}=Np(),n=m(()=>e?.map(e=>{const t=e.name;return{name:t,value:{glAccount:{name:t,value:{id:{in:[e.id]}}}}}}),[e]);return x(()=>({values:n??[],isFilling:t}),[n,t])}(),i=function(){const e=function(){const{query:{data:e}}=Cy();return"ACCOUNTANT"===e?.userRole}(),t=m(()=>function(e){const t="in";return[...e].map(e=>({name:e.name,value:{reviewStatus:{name:e.name,value:{[t]:e.value}}}}))}(e?Rb:Pb),[e]);return x(()=>({values:t,isFilling:!1}),[t])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:o,getReviewStatuses:i}}(),u=m(()=>({reviewStatus:Ey(d),amount:qe({key:"amount",name:"Amount",operators:My,ModalComponent:Dy}),bankAccount:Wy(o),category:yy(a),customer:qy(l),date:qe({key:"date",name:"Date",operators:Fy,ModalComponent:Oy}),description:qe({key:"description",name:"Description",operators:Vy,ModalComponent:Uy}),glAccount:nx(c),notes:qe({key:"notes",name:"Notes",operators:$y,ModalComponent:Jy}),status:qe({key:"status",name:"Status",possibleValues:Qy}),vendor:jy(i),type:qe({key:"type",name:"Type",possibleValues:Yy}),search:ze}),[o,a,i,l,c,d]),h=m(()=>[u.reviewStatus,u.amount,u.bankAccount,u.category,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor],[u.reviewStatus,u.amount,u.bankAccount,u.category,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor]),p=m(()=>function(e){const t={...e};return ex.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(ax,{})),[e]),g=x(e=>u[e],[u]);return{filters:e,filterPopupModels:h,addFilters:t,removeFilter:n,apiFilters:p,getModel:g,hasUserConfiguredTransactionFilters:r}}function ax(e,t){const n={},r=t.value;var a,o,i,l;return r.date&&(n.date=(a=e.date,o=r.date.value,a?{...a,...o}:o)),r.amount&&(n.amount=(i=e.amount,l=r.amount.value,i?{...i,...l}:l)),r.description&&(n.description=r.description.value),r.category&&(n.category=function(e,t){return fy(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e&&e.in?t.in?{...e,in:[.../* @__PURE__ */new Set([...e.in,...t.in])]}:e:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return fy(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return fy(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return fy(e,t)}(e.glAccount,r.glAccount.value)),r.type&&(n.type=function(e,t){return e?{...e,...t}:t}(e.type,r.type.value)),r.search&&(n.search=r.search.value),r.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return fy(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return fy(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}function ox(e,t=500,n){const r=g();!function(e){const t=g(e);t.current=e,k(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=m(()=>{const a=c(e,t,n),o=(...e)=>a(...e);return o.cancel=()=>{a.cancel()},o.isPending=()=>!!r.current,o.flush=()=>a.flush(),o},[e,t,n]);return k(()=>{r.current=c(e,t,n)},[e,t,n]),a}const ix=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search",{styleIconKey:"search"}),lx=Ut({animation:"linear 1s spin infinite"}),sx={background:"conic-gradient(from 90deg,rgba(255, 255, 255, 0) 0deg,rgba(148, 216, 232, 1) 360deg)",height:"100%",width:"100%",opacity:1};function cx({size:e}){const t=e??15;return P("svg",{className:lx,width:t,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S("g",{clipPath:"url(#paint0_angular_27751_8190_clip_path)","data-figma-skip-parse":"true",children:S("g",{transform:"matrix(0 0.0075 -0.0075 0 8.5 8.5)",children:S("foreignObject",{x:"-1266.67",y:"-1266.67",width:"2533.33",height:"2533.33",children:S("div",{style:sx})})})}),S("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"stopsVar":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"transform":{"m00":-9.1848822316819949e-16,"m01":-14.999998092651367,"m02":15.999998092651367,"m10":14.999998092651367,"m11":-9.1848822316819949e-16,"m12":1.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),S("defs",{children:S("clipPath",{id:"paint0_angular_27751_8190_clip_path",children:S("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z"})})})]})}const dx=Qt(zt["filter-bar"],Ut({display:"flex",padding:"16px",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",borderRadius:"2px",border:"1px solid {colors.border.layout}",background:"surface.foreground",xl:{display:"flex",flex:"1 0 0",flexDirection:"column",height:"35px",padding:"0 10px",justifyContent:"center",alignItems:"flex-start",gap:"10px",borderRadius:"sm",background:"surface.background"}})),ux=Qt(zt["filter-search-bar"],Ut({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),hx=Qt(null,Ut({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),px=Qt(null,Ut({border:"none",outline:"none",background:"transparent",fontSize:"16px",fontStyle:"normal",fontWeight:"sm",lineHeight:"18px",letterSpacing:"0.96px",display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",height:"100%",minWidth:0,padding:0,_placeholder:{color:"typography.base.weak"},xl:{fontSize:"14px",lineHeight:"16px"}}));function gx({onChange:e,searchTerm:t,isFetching:n}){const[r,a]=y(t),[o,i]=y(!1),l=ox(x(t=>{e(t),i(!1)},[e,i]),280),s=Ut({width:25});return S("div",{...dx,children:P("div",{...ux,children:[S("div",{className:s,children:n||o?S(cx,{}):S(Sd,{stylists:[hx],Component:ix})}),S("input",{...px,value:r,onChange:e=>{return t=e.target.value,a(t),o||i(!0),void l(t);var t},placeholder:"Search",onKeyDown:Ru})]})})}const mx=Ut({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),vx=Qt(zt["filter-pill"],Ut({display:"inline-flex",height:"25px",padding:"5px 10px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"md",border:"{borderWidths.lg} solid",borderColor:"border.intent.secondary",background:"surface.intent.secondary",fontSize:"sm",fontWeight:"sm",lineHeight:"14px",color:"typography.intent.secondary"})),bx=Qt(null,Ut({border:"none",background:"none",padding:0,cursor:"pointer"})),fx=Qt(null,Ut({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function yx({text:e,onClickRemove:t}){return P("div",{...vx,children:[S("div",{...fx,children:e}),S("button",{...bx,onClick:t,children:S(Ss,{Component:Is,stylists:[Qt(null,mx)]})})]})}function xx({filters:e,removeFilter:t}){return e.map((e,n)=>{if(e.modelKey===je)return;const r=`${e.name}`;return S(yx,{text:r,onClickRemove:()=>{t(n)}},e.id)})}const kx=Ti(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_24404_41655)"},p.createElement("path",{d:"M1 1V3.366L6.317 9.866V14L8.683 12.817V9.866L14 3.366V1H1Z",strokeWidth:1,strokeMiterlimit:10}))),"Filter");function Tx({children:e,forceMount:t,fadeIn:n=!0}){const r={transform:"none",willChange:"auto",...n?{}:{animation:"none"}};return S(Fs,{style:r,forceMount:t,children:e})}const wx=Ut({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),Cx=Qt(null,wx);function Ax({children:e,clickHandler:t}){const n=As();return t||(t=()=>{n.close()}),S(ge,{lockScroll:!0,...Cx,onClick:t,children:e})}const Ex=qt({base:{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative"},variants:{width:{lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"}},sm:{minWidth:{sm:"360px",base:"100dvw"},maxWidth:{sm:"392px",base:"100dvw"}}}}});function Ix({width:e="lg",children:t}){const n=Qt(zt["modal-popup"],Ex({width:e}));return S("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function Sx({model:e,handleFilterClick:t}){return P(Cs,{placement:"right-start",modal:!0,children:[S(Es,{children:t=>S(Wh,{...t,children:S(Aa,{children:e.name})})}),S(Tx,{children:S(Ax,{children:S(Ix,{children:e.ModalComponent&&S(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function Nx({filterModels:e,addFilters:t}){const n=As(),r=e=>{t([e]),n.close()};return S(Fs,{children:S(Mh,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return On(t)?S(Sx,{model:e,handleFilterClick:r},e.key):S(Px,{model:e,handleFilterClick:r},e.key)})})})}function Px({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return S(mp,{triggerChildren:S(fp,{icon:e.icon,displayLabel:e.name}),popupChildren:r?S(zh,{}):S(Rx,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function Rx({values:e,handleValueClick:t}){return S(Mh,{children:e.length>0?e.map(e=>S(Dx,{handleClick:()=>t(e),value:e},e.name)):S(qh,{text:"No data"})})}function Dx({value:e,handleClick:t}){return S(Wh,{onClick:t,children:S(Aa,{children:e.name})})}function Mx({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["medium-icon"],zt.icon),...t??[]],size:17})}const Lx=Ut({display:"flex",padding:{base:"26px",xl:"16px"},gap:"8px",height:"35px"});function Ox({addFilters:e,filterModels:t}){const n=If();return P(Cs,{modal:!1,placement:"bottom-start",children:[S(Es,{children:e=>S(Xl,{popupTriggerProps:e,stylists:[Qt(null,Lx)],children:n?S(Mx,{Component:kx}):P(N,{children:[S(Ni,{Component:kx}),S(cs,{children:"Filters"})]})})}),S(Nx,{filterModels:t,addFilters:e})]})}const Fx=Qt(zt["dashboard-header"],Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),Bx=Qt(null,Ut({display:"flex",alignItems:"center",gap:"8px",padding:"15px 15px 0 15px",width:"100%",xl:{gap:"12px"}})),Ux=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"})),Vx=Ut({display:"none",xl:{display:"flex"}});function Wx({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a,isFetching:o}){const i=m(()=>On(t)?"":t.find(e=>e.modelKey===je)?.value.search?.value,[t]);return P("div",{...Fx,children:[P("div",{...Bx,children:[S(gx,{isFetching:o,searchTerm:i,onChange:e=>{const t=a(je);if(void 0===t)return;const r=t.createFilter({name:"Search",value:{search:{name:e,value:e}}});n([r])}}),S(Ox,{addFilters:n,filterModels:e}),S("div",{className:Vx,children:S(Li,{})})]}),t.length>0&&S("div",{...Ux,children:S(xx,{filters:t,getModel:a,removeFilter:r})})]})}const Hx=et.filter(e=>e!==$e.COMMENTS&&e!==$e.CLASS_SEGMENT),qx=Qt(null,Ut({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function jx(){return S("div",{...qx,children:S(Li,{})})}function zx({Component:e,stylists:t}){return S(e,{stylists:[Qt(zt["xx-large-icon"],zt.icon),...t??[]],size:50})}function Kx(){return P(N,{children:[S(zx,{Component:ix}),S(an,{children:"No results found"}),S(Ia,{wrap:"wrap",children:"Based on the filters that are applied, there are no results to display."})]})}const Yx=v({resetSelected:void 0});function _x({Icon:e,label:t,children:n,onClick:r}){return n?P(Cs,{placement:"bottom-start",children:[S(Es,{children:n=>P(js,{popupTriggerProps:n,children:[e&&S(Sd,{Component:e}),S(bs,{children:t})]})}),n]}):P(js,{onClick:r,children:[e&&S(Sd,{Component:e}),S(bs,{children:t})]})}const Zx=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2768)"},p.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),p.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),p.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots"),Gx=Ti(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Qx({transactions:e,id:t,label:n}){const{mutate:r}=pb(),a=As(),{resetSelected:o}=b(Yx);return Db(t)?S(Wh,{onClick:()=>(t=>{if(e.length>0){const a=(n=t,e.map(e=>({id:e.id,reviewStatus:n})));r(a)}var n;a.close(),o&&o()})(t),children:n}):null}const Xx=[{id:"delete",label:"Delete",Icon:Gx,component:function({transactions:e,...t}){const{mutate:n}=pb(),r=()=>{const t=Gy(e);n(t)};return S(_x,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&Gd({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:Vd,label:"Cancel"},{key:Wd,label:"Delete",type:Zd}]}).then(e=>{e===Wd&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:Ti(e=>p.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.36217 8.45534H7.95444C8.20781 8.45534 8.45081 8.35469 8.62998 8.17552C8.80914 7.99636 8.9098 7.75336 8.9098 7.49998C8.9098 7.24661 8.80914 7.00361 8.62998 6.82444C8.45081 6.64528 8.20781 6.54463 7.95444 6.54463H7.31753C7.06416 6.54463 6.82116 6.44397 6.64199 6.26481C6.46283 6.08564 6.36217 5.84265 6.36217 5.58927C6.36217 5.33589 6.46283 5.09289 6.64199 4.91373C6.82116 4.73456 7.06416 4.63391 7.31753 4.63391H8.9098",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.54074 14.1875L4.23491 12.9137L5.93545 14.1875L7.62962 12.9137L9.33015 14.1875L11.0307 12.9137L12.7312 14.1875L13.3681 13.5506V0.8125H1.90384V13.5506L2.54074 14.1875Z",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"})),"Expenses"),filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=pb(),a=e.length;return a>0&&S(_x,{label:`${t} ${Qd("Expense","Expenses",a,!0)}`,...n,children:S(kp,{onClick:function(t){var n,a;t?.id&&r((n=e,a=t.id.toString(),n.map(e=>({id:e.id,categoryId:a}))))}})})}},{id:"review",label:"Change Review Status",Icon:Sb,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Qx},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Qx},{id:"RECONCILED",label:"Reconciled",component:Qx}]},{id:"more",label:"More",Icon:Zx,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=As(),{mutate:n}=pb(),{resetSelected:r}=b(Yx),a="Recategorize "+Qd("Revenue","Revenues",e.length,!0);return S(mp,{triggerChildren:S(fp,{displayLabel:a}),popupChildren:S(cb,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.close(),r&&r()},types:Op})})},filter:e=>"REVENUE"===e.type}]}];function Jx({subActionList:e}){return S(Mh,{children:e})}function $x({subActions:e,transactions:t,label:n,Icon:r}){const a=m(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?S(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return S(_x,{label:n,Icon:r,children:S(Fs,{children:a.length>0?S(Jx,{subActionList:a}):S(Wh,{children:S(cs,{children:"No Actions Available for Selection"})},"no-actions")})})}const ek=Qt(zt["bulk-select"],Ut({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function tk({table:e}){const t=e.getSelectedRowModel(),n=m(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=m(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return P("div",{...ek,children:[S(uv,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),S(Yx.Provider,{value:o,children:a&&P(N,{children:[S(Aa,{children:`${r} selected`}),Xx.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?S($x,{subActions:r,transactions:n,...i},a):t&&S(t,{transactions:l,...i},a)})]})})]})}const nk=Ut({padding:"8px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"surface.elevated",border:"none",gap:"8px"});function rk({formattedDate:e,formattedSum:t}){return P("div",{className:nk,children:[S(Aa,{wrap:"wrap",children:e}),S(Aa,{wrap:"wrap",children:t})]})}function ak({rows:e}){const t=m(()=>function(e){return Array.from(function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=n.original.date;if(t.has(e)){const r=t.get(e);r&&(r.netSumCents+=n.original.amount,r.formattedSumDollars=wa(Th(r.netSumCents)),r.rows.push(n))}else{const r=An(e);t.set(e,{date:e,formattedDate:r?Tn(r):e,netSumCents:n.original.amount,formattedSumDollars:wa(Th(n.original.amount)),rows:[n]})}}return t}(e).values())}(e),[e]);return S(N,{children:t.map(e=>P(I,{children:[S(rk,{formattedDate:e.formattedDate,formattedSum:e.formattedSumDollars}),e.rows.map(e=>S(ff,{rowData:e},e.id))]},e.date))})}function ok({table:e}){const t=hf();return S(sl,{children:t?S(ak,{rows:e.getRowModel().rows}):e.getRowModel().rows.map(e=>S(ff,{rowData:e},e.id))})}function ik({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=hf(),o=function({transactions:e,columns:t}){const n=hf(),r=gf({transactions:e,columns:t?[$e.SELECT,...t,$e.EXPAND]:void 0});return function(e,t,n=!0){const r=n&&!On(t.getColumn(Je.SELECT)),a=g(r?e:null);if(r){if(a.current!==e&&void 0!==a.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}a.current=e}}(e,r,!n),r}({transactions:e,columns:t});let i;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?i=S(Kx,{}):r&&0===e?.length&&(i=S(Ef,{})):i=S(Cf,{}),P(rs,{dashboard:"transactionDashboard",children:[On(i)&&!a&&S(tk,{table:o}),S(il,{headerGroups:o.getHeaderGroups()}),On(i)?S(ok,{table:o}):S(kc,{children:i})]})}const lk=Ut({display:"flex",padding:"16px 12px",border:"0.75px",borderStyle:"solid",borderRadius:["borderWidths.sm"],borderColor:["border.layout"]}),sk=Wt(lk,Ut({flexDirection:"column",alignItems:"flex-start",gap:"16px",flex:1}));function ck({children:e}){return S("div",{className:sk,children:e})}const dk=Qt(zt["card-header"],Ut({display:"flex",alignItems:"center",gap:"10px",alignSelf:"stretch"}));function uk({children:e}){return S("div",{...dk,children:e})}const hk=qt({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"12px",alignSelf:"stretch"}});function pk({children:e}){return S("div",{className:hk(),children:e})}const gk=qt({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}});function mk({children:e,type:t,isSample:n=!1}){const r=Qt(zt.card,gk({type:t,isSample:n}));return S("div",{...r,children:e})}const vk=e=>["banks/transactions/summary",e],bk=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query/summary",bodyParams:t[1],accessToken:t[2].accessToken,endpointManager:Ao(t[2].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};const fk=qt({base:{display:"flex",width:"200px",height:"48px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",cursor:"pointer"},variants:{filterStatus:{inactive:{},active:{borderRadius:"borderWidths.sm",borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:"brand.action.strong",background:"surface.background.hover"}}},defaultVariants:{filterStatus:"inactive"}});function yk({filterApiNames:e,filterStatus:t,filterModelKey:n,extractFilterValue:r,children:a}){const{addFilters:o,filters:i,getModel:l,removeFilter:s}=rx();if(!l(n))return null;const c=Qt(zt["card-button"],fk({filterStatus:t}));return S("div",{onClick:"inactive"===t?()=>{const t=l(n);if(!t||!t.possibleValues)return;const a=[];t.possibleValues().values.forEach(n=>{const o=r(n.value);if(o&&e.includes(o)){const e=t.createFilter(n);a.push(e)}}),o(a)}:()=>{(function(e,t,n){const r=[];return e.forEach((e,a)=>{const o=e.value[t]?.value;o&&Object.entries(o).forEach(([,e])=>{Array.isArray(e)&&e.some(e=>n.includes(e))&&r.push(a)})}),r})(i,n,e).forEach(e=>{s(e)})},...c,children:a})}const xk=qt({base:{display:"flex",padding:"8px",alignItems:"center",gap:"8px",alignSelf:"stretch",background:"surface.background"},variants:{filterStatus:{inactive:{paddingLeft:"8px"},active:{paddingLeft:"4px"}}},defaultVariants:{filterStatus:"inactive"}}),kk=qt({base:{display:"flex",padding:"10px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"borderWidths.sm",borderWidth:"1px",borderStyle:"solid"},variants:{reviewStatus:{PARTNER_REVIEW_REQUIRED_RECONCILIATION_STAGED:{borderColor:"border.layout",background:"surface.background"},USER_REVIEW_REQUIRED:{borderColor:"surface.intent.warning.active",background:"surface.intent.warning"},RECONCILIATION_DISCREPANCY:{borderColor:"surface.intent.danger.weak",background:"surface.intent.danger.opaque"},RECONCILED:{borderColor:"surface.intent.success.active",background:"surface.intent.success"}}},defaultVariants:{reviewStatus:"PARTNER_REVIEW_REQUIRED_RECONCILIATION_STAGED"}}),Tk=Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",flex:"1 0 0"}),wk=qt({base:{display:"flex",padding:"1px 0",alignItems:"center",gap:"10px",alignSelf:"stretch",fontFamily:"label",fontSize:"14px",fontStyle:"normal",lineHeight:"16px",letterSpacing:"0.84px"},variants:{filterStatus:{inactive:{fontWeight:"label.sub"},active:{fontWeight:"label.strong"}}},defaultVariants:{filterStatus:"inactive"}}),Ck=Ut({display:"flex",padding:"1px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function Ak(){const{apiFilters:{reviewStatus:e,...t}}=rx(),{data:n}=function(e){const{query:{data:t},isFilling:n,isRehydrating:r}=function({groupBy:e,filter:t}){return _n({queryKey:vk({groupBy:e,filter:t}),queryFn:bk})}({groupBy:"REVIEW_STATUS",filter:e});return{data:t?.data??void 0,isFilling:n,isRehydrating:r}}(t),r=e=>{let t=0;return n?.forEach(n=>{n.value&&Db(n.value)&&e.value.includes(n.value)&&(t+=n.count??0)})??t};return S(mk,{children:P(ck,{children:[S(uk,{children:S(cs,{children:"Review Status"})}),S(pk,{children:Pb.map(t=>{const n=t.value.some(t=>{return!(!(n=t)||!Db(n))&&(e?.in?.includes(n)??!1);var n})?"active":"inactive",a=t.value.join("_");if(t.value.includes("ACCOUNTANT_REVIEW_REQUIRED"))return;const o=Qt(zt["card-button-icon"],kk({reviewStatus:(i=a,kk.variantMap.reviewStatus.includes(i)?a:void 0)}));var i;return S(yk,{filterStatus:n,filterApiNames:t.value,filterModelKey:"reviewStatus",extractFilterValue:e=>e.reviewStatus?.value.in?.[0],children:P("div",{className:xk({filterStatus:n}),children:[S("div",{...o,children:S(Ni,{Component:t.icon})}),S("div",{className:Tk,children:S("div",{className:wk({filterStatus:n}),children:t.name})}),S("div",{className:Ck,children:String(r(t))})]})},t.name)})})]})})}const Ek=Ut({display:"none",xl:{display:"flex",height:"318px",maxHeight:"318px",alignItems:"flex-start",gap:"16px",alignSelf:"stretch",borderRadius:"borderWidths.sm"}});function Ik(e){return S("div",{className:Ek,children:e.children})}const Sk=Qt(null,Ut({display:"flex",flexDirection:"column",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"12px",gap:"8px",minWidth:"180px"})),Nk=Qt(null,Ut({width:"100%",height:"1px",backgroundColor:"border.layout"})),Pk=Qt(null,Ut({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"20px"})),Rk=Ra.var("colors.money.positive"),Dk=Ra.var("colors.money.negative");function Mk({active:e,payload:t}){if(!e||!t||0===t.length)return null;const n=t.find(e=>"income"===e.dataKey),r=t.find(e=>"expense"===e.dataKey),a=t[0]?.payload?.longLabel||"",o=n?.value??0,i=r?.value??0;return P("div",{...Sk,children:[S(Aa,{children:a}),S("div",{...Nk}),P("div",{...Pk,children:[S(Oa,{color:Rk,label:"Income",diameter:12}),S(Ia,{children:Ta(Number(o))})]}),P("div",{...Pk,children:[S(Oa,{color:Dk,label:"Expense",diameter:12}),S(Ia,{children:Ta(Number(i))})]})]})}const Lk={top:20,right:20,left:20,bottom:5},Ok=Qt(zt["profit-loss-graph"],Ut({"& .recharts-surface":{outline:"none"}})),Fk=Ra.var("colors.border.layout"),Bk={fill:Ra.var("colors.typography.base"),fontSize:Ra.var("fontSizes.metric.sm")},Uk=Ra.var("colors.money.positive.weak"),Vk=Ra.var("colors.money.negative.weak"),Wk=Ra.var("colors.money.positive"),Hk=Ra.var("colors.money.negative");function qk({data:e}){return S(U,{width:"100%",height:"100%",...Ok,style:{flexGrow:1},children:P(V,{data:e,accessibilityLayer:!0,barCategoryGap:"20%",margin:Lk,children:[S(q,{dataKey:"label",interval:0,tickLine:!1,stroke:Fk,tick:Bk}),S(z,{content:({active:e,payload:t})=>S(Mk,{active:e,payload:t}),isAnimationActive:!1,cursor:{fill:"transparent"}}),S(K,{name:"Income",dataKey:"income",minPointSize:2,fill:Uk,isAnimationActive:!1,activeBar:{fill:Wk}}),S(K,{name:"Expense",dataKey:"expense",minPointSize:2,fill:Vk,isAnimationActive:!1,activeBar:{fill:Hk}})]})})}const jk=Ut({display:"flex",flexDirection:"row",gap:"8px",justifyContent:"flex-end"}),zk=Ra.var("colors.money.positive.weak"),Kk=Ra.var("colors.money.negative.weak");function Yk(){return P("div",{className:jk,children:[S(Oa,{color:zk,label:"Income",diameter:10}),S(Oa,{color:Kk,label:"Expense",diameter:10})]})}const _k=qt({base:{display:"flex",flexDirection:"row","& > * + *":{marginLeft:"-1px"}},variants:{width:{full:{width:"100%"}}}});function Zk({width:e,children:t}){return S("div",{className:_k({width:e}),children:t})}function Gk({options:e,handleClick:t,selected:n}){return S(Zk,{width:"full",children:e.map(e=>S(Wp,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground",corners:"rounded"},e.value))})}const Qk=Qt(null,Ut({display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"20px"})),Xk=Qt(null,Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px"})),Jk=Qt(null,Ut({flexDirection:"column",alignItems:"flex-end",gap:"10px",width:"300px",display:"flex"})),$k=Qt(zt.card,Wt(lk,Ut({flexGrow:1,flexShrink:0,minHeight:"100%",flexDirection:"column"}))),eT=e=>"QUARTERLY"===e?function(e){const t=/* @__PURE__ */new Date,n=3*(e-1),r=function(e){const t=e.getMonth(),n=t-t%3+3;return on(ln(e.getFullYear(),n,0))}(t);return{beginDate:function(e){const t=e.getMonth(),n=t-t%3;return on(ln(e.getFullYear(),n,1))}(ln(t.getFullYear(),t.getMonth()-n,t.getDate())),endDate:r}}(4):"YEARLY"===e?{beginDate:on(ln(/* @__PURE__ */(new Date).getFullYear()-4,0,1)),endDate:cn()}:"PAST_YEAR";const tT=[{label:"Months",value:"MONTHLY"},{label:"Quarters",value:"QUARTERLY"},{label:"Years",value:"YEARLY"}];function nT(){const[e,t]=y({label:"Months",value:"MONTHLY"}),n=function(e){const{query:{data:t}}=Qr({filter:eT(e),grouping:e,select:t=>{if("SUCCESS"!==t.result)return[];const n=t.json?.data;if(void 0===n)return[];let r=n;return"YEARLY"===e&&(r=function(e){let t=!1;const n=[],r=e.length-1,a=e.length-2;return e.forEach((e,o)=>{((e?.income?.total??0)>0||(e?.expenses?.total??0)>0)&&(t=!0),(t||o===r||o===a)&&n.push(e)}),n}(n)),r.map(t=>{const n=t.period?.beginDate,{label:r,longLabel:a}=function(e,t){return void 0===e?{label:"",longLabel:""}:"MONTHLY"===t?function(e){const t=An(e??"");return{longLabel:t?Nn(t,{abbreviateMonth:!1,abbreviateYear:!1}):"",label:Jr(e)}}(e):"QUARTERLY"===t?function(e){const t=sn(e),n=t.getMonth(),r=Math.trunc(n/3)+1,a=t.getFullYear();return{label:`Q${r} ${"'"+a%100}`,longLabel:`Quarter ${r} ${a}`}}(e):"YEARLY"===t?function(e){const t=sn(e).getFullYear();return{label:t.toString(),longLabel:t.toString()}}(e):{label:"",longLabel:""}}(n,e);return{longLabel:a,income:(t.income?.total??0)+(t.otherIncome?.total??0),expense:(t.cogs?.total??0)+(t.expenses?.total??0)+(t.otherExpenses?.total??0),label:r}})}});return t??[]}(e.value),r=n.reduce((e,t)=>e+t.income-t.expense,0);return P("div",{...$k,children:[P("div",{...Qk,children:[P("div",{...Xk,children:["All Transactions",S(ma,{title:Ta(r),label:void 0})]}),P("div",{...Jk,children:[S(Gk,{options:tT,handleClick:e=>t(e),selected:e}),S(Yk,{})]})]}),S(qk,{data:n})]})}function rT(){const e=If(),{taskBanners:t,isFilling:n}=function(e){const{isMobile:t=!1}=e??{},n=(()=>{const e={filter:{status:{in:["ACTIVE"]}}};return _n({select:e=>fi(e,!0),queryKey:e?pi(e):["tasks",{}],queryFn:vi})})(),r=bi({select:e=>fi(e,t)},mi),{query:{data:a},isFilling:o}=t?n:r,{query:{data:i},isFilling:l}=si(),{query:{data:s},isFilling:c}=Ho();return{taskBanners:m(()=>{let e=[];const t=s?.data;t&&(e=t.map(e=>Ro(e)));let n=[];!1===i?.hasPlaidLinkedBankAccount&&(n=[Po]);const r=a??[];return[...e,...n,...r]},[a,i,s]),isFilling:o||l||c}}({isMobile:e}),{apiFilters:r}=rx(),a={filter:{...r}},{query:{data:o}}=Cl(a),i=o?.data,l=(i?.length??0)>0,{query:{data:s}}=si();return P(N,{children:[P(Jt,{children:[S(an,{children:"Action Items"}),S(sy,{})]}),S(bo,{children:S(oy,{taskBanners:t,handleScrollAction:yi,isWaitingForPlaidItemAccountsSync:!l&&!0===s?.plaidItemAccountsReadyToSync,isFilling:n})})]})}const aT=Ut({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1440px"}),oT=Ut({display:"flex",justifyContent:"center"}),iT=Ut({border:"{borderWidths.md} solid {colors.border.layout}",borderBottom:"none",paddingTop:"8px",marginTop:"16px"}),lT=Ut({border:"{borderWidths.md} solid {colors.border.layout}",borderTop:{xl:"{borderWidths.md} solid {colors.border.layout}",base:"none"},paddingTop:{xl:"8px",base:0}}),sT=Ut({display:"flex",flexDirection:"column",gap:"10px"});function cT({limit:e=100,columns:t=Hx}){const{userRole:n}=b(Qs),{sortInstance:r,setSortInstance:a,apiSort:o}=ov(),{filters:i,filterPopupModels:l,addFilters:s,removeFilter:c,apiFilters:d,getModel:u}=rx(),h={limit:e,sort:o,filter:{...d}},{isFilling:p,paginationControls:g,query:{data:m,isError:v,error:f,isFetching:y}}=Cl(h),x=m?.data;!function(e,t,n){const r=Xe(e=>e.initializeDefaultFilters),a=Xe(e=>e.hasInitializedTransactionFilters);k(()=>{a||n||!e||r({userRole:e,hasNonReconciledTransactions:t})},[a,n,e,t,r])}(n,x?.some(e=>"RECONCILED"!==e.reviewStatus)??!1,p);const{hasPlaidLinkedBankAccount:T}=li(),w=T??!1,C=If();if(v)return S("div",{children:`Error: ${f?.message}`});if(p)return S(Wi,{});if(void 0!==x){const e=function(e,t){let n;return n=0===e?"FILTERS_NOT_APPLIED":e>0&&0===t?"FILTERS_MATCHED_NONE":"FILTERS_MATCHED_ANY",n}(i.length,x.length);return S("div",{className:oT,children:S("div",{className:aT,children:P(Si.Provider,{value:g,children:[C&&S("div",{className:sT,children:S(rT,{})}),!C&&P(Ik,{children:[S(Ak,{}),S(nT,{})]}),S("div",{className:iT,children:S(Wx,{filterModels:l,addFilters:s,filters:i,removeFilter:c,getModel:u,isFetching:y})}),S("div",{className:lT,children:S(as.Provider,{value:{sortInstance:r,setSortInstance:a},children:S(ik,{hasLinkedBankAccount:w,filterState:e,transactions:x,columns:t})})}),S(jx,{})]})})})}return"zero state"}const dT=e=>S(vy,{children:S(cT,{...e})}),uT=Wt(Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"12px",flexShrink:1}),la);function hT({children:e}){return S("div",{className:uT,children:e})}const pT=Qt(null,Ut({display:"flex",backgroundColor:"surface.intent.action.discreet",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),Ei),gT=()=>bl();function mT({Icon:e=Is,handleClose:t=gT}={}){return S("button",{...pT,onClick:t,type:"button",children:S(Sd,{Component:e,...pT})})}const vT=Ut({display:"flex",flexDirection:"column"});function bT({task:e}){return S("div",{className:vT,children:S(Jf,{task:e})})}const fT=Ut({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),yT=Ut({width:"80px",height:"12px"}),xT=Ut({width:"150px",height:"16px"}),kT=Ut({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),TT=Ut({userSelect:"none",cursor:"pointer"});function wT(){return P("div",{className:kT,children:[P("div",{className:TT,children:[P("div",{className:fT,children:[S($a,{styles:xT}),S($a,{styles:yT})]}),P("div",{className:fT,children:[S($a,{styles:xT}),S($a,{styles:yT})]})]}),S("div",{className:TT,children:P("div",{className:fT,children:[S($a,{styles:xT}),S($a,{styles:yT})]})})]})}const CT=Ut.raw({"&::before":{content:{base:"''",sm:"none"},position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function AT({children:e,stylists:t,shouldUseButtonDiscreteStyles:n=!1}){const r=If(),a=n||r?js:Xl;return P(Cs,{placement:"bottom-start",children:[S(Es,{children:e=>S(a,{extraClassNames:[CT],popupTriggerProps:e,children:S(Ni,{Component:Zx,stylists:t})})}),S(Fs,{children:e})]})}const ET=Ti(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),p.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),IT=Ut({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),ST=Ut({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),NT=Ut({display:"flex",flexDirection:"column",gap:"12px"}),PT=Ut({display:"flex",flexDirection:"row",gap:"10px"}),RT=Ut({display:"flex",flexDirection:"column",gap:"10px"}),DT=({acknowledged:e,setAcknowledged:t})=>P("div",{className:NT,children:[S(cs,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),P("div",{className:PT,children:[S(cv,{checked:e,onClick:()=>t(!e)}),S(cs,{wrap:"wrap",children:"I understand."})]})]});function MT({bankAccounts:e}){const{apiPartnerName:t}=b(Qs),n=e.reduce((e,t)=>{const n=An(t.tranStartDate||""),r=An(e.tranStartDate||"");return n&&r&&kn(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=du();return Fg({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;Gd({title:"Start Date Updated",body:P("div",{className:RT,children:[S(cs,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),S(cs,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:Hd,type:_d}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:$o(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=As(),o=()=>{a.close()},[i,l]=y(!1),{query:{data:s}}=Wo(),c=s?.data?.find(t=>t.id===(e[0]?.integration?.id??""))?.apiInstitutionName||"bank",d=An(e.reduce((e,t)=>{const n=An(t.tranMinStartDate||""),r=An(e.tranMinStartDate||"");return n&&r&&kn(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${Go(e[0]?.name,e[0]?.mask)} account dating back to ${Rn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${Rn(d)}.`;return P("form",{className:IT,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.close()},children:[S(Aa,{children:"Set Bank Transaction Start Date"}),S(cs,{wrap:"wrap",children:u}),S(cs,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),S(r.AppField,{name:"tranStartDate",children:e=>S(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),S(r.Subscribe,{selector:e=>e,children:e=>{const t=An(e.values.tranStartDate||""),r=An(n),a=t&&r&&kn(t,r);return P(N,{children:[e.isDirty&&a&&S(DT,{acknowledged:i,setAcknowledged:l}),P("div",{className:ST,children:[S(Vg,{showIcon:!1,onClick:o}),S(yu,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function LT({bankAccounts:e}){return P(Cs,{placement:"right-start",modal:!0,children:[S(Es,{children:e=>P(Wh,{...e,children:[S(Sd,{Component:ET}),S(Aa,{children:"Edit Start Date"})]})}),S(Tx,{children:S(Ax,{children:S(Ix,{width:"sm",children:S(MT,{bankAccounts:e})})})})]})}const OT=Ti(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M7.49998 14.4245C11.3242 14.4245 14.4244 11.3244 14.4244 7.50011C14.4244 3.67585 11.3242 0.575684 7.49998 0.575684C3.67573 0.575684 0.575562 3.67585 0.575562 7.50011C0.575562 11.3244 3.67573 14.4245 7.49998 14.4245Z",strokeMiterlimit:10}),p.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),FT=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),p.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),BT={QBO:"QuickBooks Online",XERO:"Xero",STRIPE:"Stripe",SHOPIFY:"Shopify",SQUARE:"Square",RUTTER:"Rutter",UBER:"Uber",MOOV:"Moov",QUALPAY:"Qualpay",BENCH:"Bench",WAVE:"Wave",MANUAL_ENTRY:"Manual Entry",CSV_IMPORT:"CSV Import",PARTNER_IMPLEMENTATION:"Partner Implementation",FRESHBOOKS:"FreshBooks",FRESHBOOKS2:"FreshBooks"};function UT(e){const{apiPartnerName:t,unitIntegrationBankName:n}=b(Qs);return"UNIT"===e?n??t??"Unit":BT[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const VT=Ut({display:"flex",flexDirection:"column",gap:"16px"}),WT=Qt(null,Ut({color:"brand.danger"}));function HT({integration:e,accounts:t}){const{mutate:n}=xm(),r=As(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=wm(),{query:{data:l}}=(s=e.id,Vo({},{select:e=>{return{...e,data:(t=e.data,n=s,t?.find(e=>e.id===n))};var t,n}}));var s;const c=l?.data,{query:{data:d}}=ui(e.id),u=d?.data,h=UT(e.apiName),p="PLAID"===e.apiName;return P(Mh,{children:[p&&!o&&P(Wh,{onClick:()=>(a({plaidEvent:sm,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r.close()),children:[S(Sd,{Component:Ul}),S(Aa,{children:"Add Account"})]}),p&&u&&S(LT,{bankAccounts:u}),He(t)&&P(Wh,{onClick:()=>$g({plaidItemAccounts:t}),children:[S(Sd,{Component:FT}),S(Aa,{children:"Merge Accounts"})]}),p&&P(Wh,{onClick:()=>(async()=>{let o;var l;o=He(t)?await(async e=>Gd({title:"Remove Institution",body:S("div",{className:VT,children:S(cs,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:Vd,label:"Cancel"},{key:Wd,label:"Remove",type:Zd}]}))(e.apiInstitutionName??h):await(async e=>Gd({title:"Remove Institution",body:S("div",{className:VT,children:S(cs,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:Vd,label:"Cancel"},{key:Wd,label:"Remove",type:Zd}]}))(h),r.close(),o===Wd&&(p&&i?a({plaidEvent:cm,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(l=e.id,n({id:l,removeFromApi:p})))})(),children:[S(Sd,{stylists:[WT],Component:OT}),S(Aa,{stylists:[WT],children:"Delete Connection"})]})]})}const qT=Ut({userSelect:"none"});function jT({children:e}){return S("div",{className:qT,children:e})}const zT=Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"16px 12px 16px 16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"});function KT({children:e}){return S("div",{className:zT,children:e})}const YT=Qt(zt.badge,Wv),_T=Qt(null,ca),ZT=Qt(null,Ei),GT=Qt(zt["neutral-badge"],qv),QT=Qt(zt["highlight-badge"],zv),XT=Qt(zt["success-badge"],Yv),JT=Qt(zt["warning-badge"],Zv),$T=Qt(zt["critical-badge"],Qv);function ew({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=$T;break;case"warning":o=JT;break;case"neutral":o=GT;break;case"success":o=XT;break;case"highlight":o=QT}const i=tn([YT,_T,o,ZT]);return S("button",{...i,onClick:n,disabled:r,...a,children:t})}function tw({plaidItem:e}){const t=Qf(e);return P(ew,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(Pr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),Xf(t))},disabled:On(t),children:[S(Sd,{Component:xu}),S(Ia,{children:"Fix Bank Error"}),S(Ni,{Component:Ci})]})}const nw=qt({base:{padding:"16px 16px 16px 24px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",cursor:"pointer"}}}}}),rw=Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"14px",overflow:"hidden"});function aw({bankAccountId:e,name:t,mask:n,syncText:r,active:a,integration:o}){const i="PLAID"===o?.apiName,l=Wt(nw({active:a}),Ei);return P("button",{className:l,onClick:t=>{t.stopPropagation(),vl("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[P("div",{className:rw,children:[S(Sd,{Component:i?yv:_p}),S(Gp,{accountName:t,accountNo:n,syncText:r,active:a})]}),a&&S(Sd,{Component:Ci})]})}const ow=Ut({display:"flex",flexDirection:"column",gap:"4px"}),iw=Ut({display:"flex",alignItems:"center",gap:"8px"}),lw=Qt(null,Ut({color:"brand.primary.weak"})),sw=Ut({overflow:"hidden"});function cw({integration:e,isCompact:t=!1}){const{query:{data:n}}=ui(e.id),r=n?.data,a="PLAID"===e.apiName,o=Xp(a?e.apiInstitutionId??void 0:void 0),i=UT(e.apiName);return He(r)?P(jT,{children:[P(KT,{children:[P(hT,{children:[S("img",{src:o,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}),P("div",{className:ow,children:[S(cs,{children:e.apiInstitutionName??i}),S(Ia,{children:om(r)})]})]}),P("div",{className:iw,children:[a&&Fn(e.apiErrorCode)&&S(tw,{plaidItem:e}),S(AT,{stylists:[lw],shouldUseButtonDiscreteStyles:t,children:S(HT,{integration:e,accounts:r})})]})]}),S("div",{className:sw,children:r.map(t=>{const n=t.isSupported&&"ACTIVE"===t.status;return S(aw,{bankAccountId:t.id,mask:t.mask,name:t.name,syncText:im(t),active:n,integration:e},t.id)})})]}):null}const dw=Ut({objectFit:"contain"});function uw(e,t,n){const r=({size:n=24})=>{const{icons:r}=b(xi);return S("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:dw})};return r.displayName=t,r}const hw=uw("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj3dOl9A+pf7A3WH3gwN+++/GhlEOJ6e23f3h6sHf3R3sTvff31ZQcmR0GipR97PcZyukhL5OD0aQ351CyIgCBiX46yNh8ywWuaXloulKuzXbCO2NCbngdG135HBOTlYZwySLRAwXwie+fWPpg+Yf3LFXJUkjO2r7dX+z1+2+hOsaTYywczQrQ0A5V520UIc3tvMYtualT3WiBaE5ix6uxigWPSbVhOjZcnp6FDzH0ianDoEsvkpHUC/t2EsdYqsT9T7y4/A6S5HKIyonkINuCY1IDH08OwSHXZAk2nWJMpV0sOSRQfJ8Mxg4cY4w1gUfP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/xiA5GpOYlSvf0SgB2Ji0rVp1W42W9zxyu2EJ53phUaflFcCp6nu9u445MYSJ09lzqplnJGEwp20Z2oKYXncMcjsahE/B6tn5XSHE1o3EHrWe01+rQIqkrDw1qpYSm3AAKjwlXCw6F2yYEZUmfPFxrujUsrQtlRtlLwoVAwNu/GUhbhgXoVphV2aV60fZdbLDJvwjvUKTblZS91Xfdgq5mYIN0Nz6DGXtRQIlJXHCholApmC+VdV6mqT+f2k0URUFdXd5C/5KGhD2ULoeBlunsheDHhZqnhH/57auhDoidbbFBLA2W0oJvyvItTGnv4VyAomEgNBppFsYrmRFJhwz5ipJ8VNjT/btXuv4Wn6X+FwhH0WiIDFzXfxJzc4r488H9C0rMPxyn4LQAAAABJRU5ErkJggg==","Bank"),yw={GUSTO:mw,FRESHBOOKS:vw,FRESHBOOKS2:vw,SHOPIFY:gw,STRIPE:hw,SQUARE:pw,UBER:bw};function xw(e){return yw[e]??fw}const kw=Ut({display:"flex",flexDirection:"column",gap:"4px"});function Tw({integration:e,isCompact:t}){const n=UT(e.apiName),r=function(e){if(e)return`Last synced ${Pn(e)}`}(e.lastSyncedDate),a=xw(e.apiName);return S(jT,{children:P(KT,{children:[P(hT,{children:[S(Tc,{Component:a}),P("div",{className:kw,children:[S(cs,{wrap:"wrap",children:e.apiUsername?`${n} (${e.apiUsername})`:n}),r&&S(Ia,{intent:"normal",children:r})]})]}),S(AT,{shouldUseButtonDiscreteStyles:t,children:S(HT,{integration:e})})]})})}const ww=Ut({display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:"16px 12px",marginBottom:"8px"}),Cw=Ut.raw({color:"typography.base.weak"}),Aw=Ut({overflow:"hidden"});function Ew({manualBankAccounts:e,isCompact:t=!1}){const n=If(),r=t||n?js:Xl;return P(jT,{children:[P("div",{className:ww,children:[S(cs,{extraClassNames:[Cw],children:"Manually Tracked Accounts"}),S(r,{onClick:()=>vl("BankAccountForm"),active:!1,children:S(Ni,{Component:Ul})})]}),S("div",{className:Aw,children:e.map(e=>S(aw,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const Iw=Qt(zt["selector-row"],Wt(Ut(jl,{backgroundColor:"surface.foreground",minWidth:"100%",justifyContent:"start",marginBottom:"5px",padding:"16px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"}),Ai)),Sw=Ut({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),Nw=Ut({display:"flex",alignItems:"center",gap:"8px"}),Pw=Ut({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",gap:"4px"}),Rw=Qt(null,Ut({width:"20px",height:"20px"}));function Dw(){const{linkPlaid:e,loading:t}=Cm();return S("button",{...Iw,disabled:t,onClick:()=>{Pr("Add New Connection button pressed"),e({plaidEvent:lm,message:"Add New Connection button pressed"})},children:P("div",{className:Sw,children:[P("div",{className:Nw,children:[S(Tc,{stylists:[Rw],Component:_p}),P("div",{className:Pw,children:[S(cs,{children:"Connect your bank"}),S(Ia,{children:"Find your banking institution with Plaid"})]})]}),S(Sd,{Component:Ci})]})})}const Mw=Ut({paddingInline:"16px",paddingBottom:"8px"}),Lw=Ut.raw({color:"typography.base.weak",fontWeight:"label"});function Ow({title:e,children:t}){return P("div",{children:[S("div",{className:Mw,children:S(cs,{extraClassNames:[Lw],children:e})}),t]})}const Fw=Ut({minWidth:"100%",height:"45px"});function Bw(){return P(N,{children:[S($a,{styles:Fw}),S($a,{styles:Fw}),S($a,{styles:Fw})]})}const Uw=Qt(zt["selector-row"],Wt(Ut(jl,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Ai)),Vw=Ut({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),Ww=Ut({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),Hw=Ut({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function qw({integration:e}){const{linkPlaid:t,loading:n}=wm(),r=Xp(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=xw(e.apiName),i=UT(e.apiName);return S("button",{...Uw,disabled:n||!a,onClick:()=>{Pr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:sm,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:P("span",{className:Vw,children:[P("div",{className:Ww,children:[r?S("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):S(Tc,{Component:o}),S(cs,{children:e.apiInstitutionName??i??void 0})]}),a&&P("div",{className:Hw,children:[S(Ni,{Component:Id}),S(cs,{children:"Relink"})]})]})})}const jw=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},p.createElement("g",{fill:"none",fillRule:"nonzero"},p.createElement("path",{fill:"#95BF47",d:"M48.024 12.24a.567.567 0 0 0-.536-.495c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69c-.357-.36-1.073-.27-1.341-.18-.045 0-.716.225-1.878.585-1.118-3.285-3.086-6.255-6.529-6.255h-.313C27.768.585 26.517 0 25.487 0c-8.048 0-11.894 10.125-13.1 15.255-3.13.99-5.367 1.665-5.635 1.755-1.744.54-1.789.585-2.012 2.25C4.56 20.52 0 56.07 0 56.07l35.549 6.705L54.82 58.59c0-.045-6.752-46.035-6.797-46.35zm-14.443-3.6c-.894.27-1.922.585-2.996.945V8.91c0-1.98-.268-3.6-.715-4.905 1.789.27 2.951 2.295 3.711 4.635zm-5.947-4.185c.492 1.26.805 3.015.805 5.445v.36c-1.967.63-4.07 1.26-6.215 1.935 1.207-4.635 3.487-6.885 5.41-7.74zm-2.37-2.295c.358 0 .716.135 1.029.36-2.594 1.215-5.321 4.275-6.484 10.44-1.7.54-3.354 1.035-4.919 1.53 1.342-4.68 4.606-12.33 10.374-12.33z"}),p.createElement("path",{fill:"#5E8E3E",d:"M47.488 11.7c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69a.716.716 0 0 0-.492-.225l-2.683 55.35 19.273-4.185s-6.752-46.035-6.797-46.35a.776.776 0 0 0-.581-.54z"}),p.createElement("path",{fill:"#FFF",d:"M29.02 22.41l-2.37 7.11S24.55 28.395 22 28.395c-3.756 0-3.935 2.385-3.935 2.97 0 3.24 8.407 4.5 8.407 12.105 0 5.985-3.757 9.855-8.854 9.855-6.126 0-9.211-3.825-9.211-3.825l1.654-5.445s3.22 2.79 5.902 2.79c1.789 0 2.504-1.395 2.504-2.43 0-4.23-6.886-4.41-6.886-11.385 0-5.85 4.159-11.52 12.61-11.52 3.22-.045 4.83.9 4.83.9z"}),p.createElement("path",{fill:"#000",d:"M77.835 35.263c-1.938-1.032-2.93-1.93-2.93-3.141 0-1.526 1.398-2.513 3.56-2.513 2.524 0 4.777 1.032 4.777 1.032L85 25.256S83.378 24 78.6 24c-6.669 0-11.31 3.814-11.31 9.154 0 3.051 2.163 5.34 5.047 7 2.343 1.301 3.154 2.243 3.154 3.634 0 1.436-1.171 2.603-3.334 2.603-3.2 0-6.264-1.66-6.264-1.66L64 50.115S66.794 52 71.526 52c6.85 0 11.807-3.365 11.807-9.423-.045-3.32-2.524-5.61-5.498-7.314zM103.897 24.304c-3.316 0-5.925 1.62-7.914 4.053l-.089-.045L98.768 13h-7.472L84 52h7.473l2.476-13.33c.972-5.044 3.537-8.152 5.925-8.152 1.68 0 2.343 1.171 2.343 2.838 0 1.035-.088 2.341-.31 3.377L99.078 52h7.473l2.919-15.762c.31-1.666.53-3.648.53-4.999.045-4.368-2.166-6.935-6.102-6.935zM127.92 24C118.943 24 113 32.23 113 41.4c0 5.859 3.565 10.6 10.255 10.6C132.058 52 138 43.994 138 34.6c.044-5.456-3.081-10.6-10.08-10.6zm-3.653 22.185c-2.552 0-3.609-2.191-3.609-4.965 0-4.338 2.201-11.405 6.25-11.405 2.641 0 3.521 2.326 3.521 4.562 0 4.652-2.244 11.808-6.162 11.808zM157.168 24c-5.102 0-8.01 4.489-8.01 4.489h-.09l.447-4.045h-6.713c-.313 2.712-.94 6.89-1.521 10L136 62h7.563l2.104-11.156h.179s1.566.978 4.43.978c8.906 0 14.724-9.066 14.724-18.222 0-5.067-2.282-9.6-7.832-9.6zm-7.25 22.133c-1.969 0-3.133-1.11-3.133-1.11L148.04 38c.895-4.711 3.356-7.822 5.996-7.822 2.328 0 3.044 2.133 3.044 4.133 0 4.889-2.91 11.822-7.16 11.822zM176.287 14A4.25 4.25 0 0 0 172 18.284c0 2.186 1.414 3.716 3.536 3.716h.088c2.343 0 4.332-1.574 4.376-4.284 0-2.186-1.459-3.716-3.713-3.716zM166 52h7.736L179 25h-7.782zM198.487 25.574h-5.453l.277-1.276c.462-2.642 2.034-4.965 4.668-4.965 1.387 0 2.496.41 2.496.41l1.525-6.06S200.66 13 197.748 13c-2.773 0-5.546.774-7.672 2.551-2.681 2.233-3.929 5.467-4.53 8.747l-.23 1.276h-3.652l-1.156 5.831h3.652L180 53h7.81l4.16-21.595h5.408l1.11-5.831z"}),p.createElement("path",{fill:"#000",d:"M216.005 25s-4.788 11.928-6.912 18.45h-.09c-.135-2.1-1.897-18.45-1.897-18.45h-8.04l4.607 24.615c.09.536.045.894-.18 1.251-.904 1.698-2.395 3.35-4.157 4.557-1.445 1.027-3.071 1.697-4.336 2.144L197.123 64c1.536-.313 4.788-1.608 7.498-4.11 3.479-3.216 6.731-8.22 10.029-15.01L224 25h-7.995z"}))),zw=Qt(zt["selector-row"],Wt(Ut(jl,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Ai)),Kw=Ut({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),Yw=Ut({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),_w=Ut({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),Zw=Ut({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",outline:"none",backgroundColor:"surface.foreground",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",padding:"12px 16px",borderRadius:"md",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"}}),Gw=Ut({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function Qw(){const e=As(),{mutateAsync:t}=vm(),[n,r]=y("");return P("div",{className:Yw,children:[S(Aa,{children:"Enter your shop name"}),S("div",{className:Gw,children:S(jw,{})}),S(cs,{children:"Please enter the name of your shop below."}),S("input",{className:Zw,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),P("div",{className:_w,children:[S(Vg,{showIcon:!1,onClick:()=>{e.close()}}),S(Ud,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.close()},children:S(Aa,{children:"Connect"})})]})]})}function Xw(){const e=xw("SHOPIFY")??Id;return P(Cs,{placement:"bottom",modal:!0,children:[S(Es,{children:t=>P("button",{...zw,...t,children:[P("div",{className:Kw,children:[S(Tc,{Component:e}),S(cs,{children:"Shopify"})]}),S(Sd,{Component:Ci})]})}),S(Tx,{children:S(Ax,{children:S(Ix,{width:"sm",children:S(Qw,{})})})})]})}const Jw=Qt(zt["selector-row"],Wt(Ut(jl,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Ai)),$w=Ut({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function eC({apiName:e}){const{mutateAsync:t}=vm(),n=UT(e);if("SHOPIFY"===e)return S(Xw,{});const r=xw(e)??Id;return P("button",{...Jw,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[P("div",{className:$w,children:[S(Tc,{Component:r}),S(cs,{children:n})]}),S(Sd,{Component:Ci})]})}const tC=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function nC(e){return tC.includes(e)}const rC=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],aC=Ut({display:"flex",flexDirection:"column",paddingTop:"16px",gap:"16px",overflowY:"auto",height:"100%",backgroundColor:"surface.background"}),oC=Ut({display:"flex",flexDirection:"column",borderTop:"{borderWidths.md} solid {colors.border.layout.weak}"});function iC(){const{query:{data:e},isFilling:t}=qo(),n=e?.multiAccountIntegrations,r=e?.integrations,a=Fn(n)&&n.length>0||Fn(r)&&r.length>0,o=function({connectedIntegrations:e}){const t=b(Qs),n=Xe(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(nC),a=e?.map(e=>e.apiName)||[];let o=r??rC;return t&&(o=o.filter(e=>{switch(e){case"GUSTO":return t.hasPayroll;case"SHOPIFY":return t.hasShopify;case"SQUARE":return t.hasSquare;case"STRIPE":return t.useStripeInvoicePaymentProcessing;default:return!0}})),o=o.filter(e=>!a.includes(e)),o}({connectedIntegrations:r});return P("div",{className:aC,children:[(t||a)&&S(Ow,{title:"Already Connected",children:t?S(Bw,{}):P(N,{children:[n?.map(e=>S(qw,{integration:e},e.id)),r?.map(e=>S(qw,{integration:e},e.id))]})}),S(Ow,{title:"Available Banks",children:S(Dw,{})}),o&&o.length>0&&S(Ow,{title:"Integrations",children:S("div",{className:oC,children:o.map(e=>S(eC,{apiName:e},e))})})]})}const lC=Ut({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}),sC=Ut({marginTop:"16px"}),cC=Ut.raw({color:"typography.base.weak",fontWeight:"label",paddingInline:"16px",marginBottom:"8px"});function dC({isCompact:e,showPlaidItems:t,showNewConnectionContent:n,multiAccountIntegrations:r,integrations:a,manualBankAccounts:o}){return n?S(iC,{}):t?P(N,{children:[P("div",{className:sC,children:[S(cs,{extraClassNames:[cC],children:"Connected Accounts"}),r?.map(t=>S(cw,{integration:t,isCompact:e},t.id)),a?.map(t=>S(Tw,{integration:t,isCompact:e},t.id))]}),o&&o.length>0&&S(Ew,{manualBankAccounts:o,isCompact:e})]}):o&&o.length>0?S(Ew,{manualBankAccounts:o}):P("div",{className:lC,children:[S(Tc,{Component:_p}),S(Aa,{wrap:"wrap",textAlign:"center",children:"If you prefer to manually input your transactions as opposed to having them automatically tracked, you can add your Manually Tracked Bank Account(s) here."})]})}const uC=Ut.raw({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}),hC=Qt(null,Ut({color:"typography.base.weak"})),pC=Qt(zt["drawer-header"],Ut({padding:"10px 12px 10px 15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"},uC)),gC=Ut({display:"flex",gap:"8px"}),mC=Ut({display:"flex",flexDirection:"column",gap:"16px",height:"100%"}),vC=qt({base:{overflowY:"auto",height:{base:"100%",sm:"fit-content"},scrollbar:"hidden"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),bC=Ut({padding:"20px 16px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.foreground",width:"100%"}),fC=Ut({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"16px",margin:"16px"}),yC=Qt(null,Ut({minWidth:"100%",padding:"16px",border:"1px solid {colors.border.intent.primary}"})),xC=qt({base:{},variants:{refreshLoading:{true:{animation:"spin 1s linear infinite"},false:{animation:"none"}}}});function kC({inOverlay:e,showCloseButton:t=!1,onPlaidLink:n}){const r=If()||e;wm();const{query:{data:a},isFilling:o}=qo(),i=a?.multiAccountIntegrations,l=a?.integrations,{query:{data:s}}=Yo({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>ti(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:ci(e?.data)};var t}}),{mutate:c,isPending:d}=fm(),u=s?s.manualAccounts:null,h=i&&l?i.length+l.length:0,p=i?.find(e=>e.apiErrorCode),g=p&&Ro(p,!1),m="connected"===Xe(e=>e.banksAndIntegrationsSelectedTab).value,v=0===h&&m,b=m?"Add New Connection":"Add New Account",f=()=>{vl(m?"NewConnection":"BankAccountForm")},y=r?js:Xl;return P(hm,{onPlaidLink:n,children:[P("div",{...pC,children:[P(hT,{children:[t&&S(mT,{}),r?S(Aa,{children:"Banks & Integrations"}):S(an,{stylists:[hC],children:"Banks & Integrations"})]}),P("div",{className:gC,children:[0!==h&&P(y,{onClick:()=>c(),active:!1,disabled:d,children:[S(Sd,{Component:Id,stylists:[Qt(null,xC({refreshLoading:d}))]}),!r&&S(cs,{children:"Sync Accounts"})]}),P(y,{onClick:()=>f(),active:!1,children:[S(Sd,{Component:Ul}),!r&&S(cs,{children:"Add New Connection"})]})]})]}),g&&S("div",{className:fC,children:S(bT,{task:g})}),o?S(wT,{}):P(N,{children:[S("div",{className:vC({height:v?"fill":void 0,background:v?"foreground":void 0}),children:S("div",{className:mC,children:S(dC,{isCompact:r,showPlaidItems:m,showNewConnectionContent:v,multiAccountIntegrations:i,integrations:l,manualBankAccounts:u})})}),r&&!(m&&v)&&S("div",{className:bC,children:P(Xl,{stylists:[yC],onClick:()=>f(),disabled:m&&!1,children:[S(Sd,{Component:Ul}),S(Aa,{children:b})]})})]})]})}const TC=Ut({display:"flex",justifyContent:"center"}),wC=Ut({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1150px",border:"{borderWidths.md} solid {colors.border.layout.weak}",borderRadius:"lg",backgroundColor:"surface.foreground",marginBottom:"42px"});function CC({onPlaidLink:e}){return S(vy,{children:S("div",{className:TC,children:S("div",{className:wC,children:S(kC,{showCloseButton:!1,onPlaidLink:e,inOverlay:!1})})})})}const AC=Ae("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),EC={queryClient:zn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await AC).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await AC).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await AC).delete("queryClient",e)}(e)}}}(),maxAge:jn,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function IC({children:e}){return S(Ee,{client:zn,persistOptions:EC,children:e})}const SC=Ut({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100%",height:"100%",minWidth:"100%",minHeight:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden",overscrollBehavior:{base:"contain",xl:"none"}}),NC=Ut({position:"fixed",inset:0,overflow:"hidden",boxSizing:"border-box",maxWidth:"100dvw",backgroundColor:{base:"transparent",xl:"overlay"},overscrollBehavior:{base:"contain",xl:"none"}}),PC=Qt(null,zt.component,SC);function RC({children:e}){const t=g(null),n=g(null),r=If();return E(()=>{const e=document.documentElement,t=e.style.overflow;return r&&(e.style.overflow="hidden"),()=>{e.style.overflow=t}},[r]),S(me,{children:S(ge,{lockScroll:!0,className:NC,children:S("div",{onMouseDown:e=>{n.current=e.target},onClick:e=>{const r=n.current===t.current,a=e.target===t.current;r&&a&&(n.current=null,Xe.getState().requestCloseAllDrawers())},ref:t,"data-testid":"drawerContainer",...PC,children:e})})})}const DC=v({drawerHistory:[]});function MC({children:e}){const t=Xe(e=>e.drawerHistory),n=m(()=>({drawerHistory:t}),[t]),r=t.length>0;return S(DC.Provider,{value:n,children:r&&S(RC,{children:e})})}const LC=v({isActive:!0,isInHistory:!0});function OC({Component:e,name:t}){const{drawerHistory:n}=b(DC),r=n.at(-1);if(void 0===r)return null;const a=n.find(e=>void 0!==e[t]),o=void 0!==r[t],i=void 0!==a;return a&&a[t]?S(LC.Provider,{value:{isActive:o,isInHistory:i},children:S(e,{...a[t].routeProps})}):void 0}const FC=qt({base:{position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",overscrollBehavior:{base:"contain",xl:"none"},_focus:{outline:"none"}},variants:{shouldDisplay:{true:{},false:{display:"none"}},animationVariant:{slideInRight:{animation:"slideIn.right"},slideInUp:{animation:"slideIn.up"},slideOutRight:{animation:"slideOut.right"},slideOutDown:{animation:"slideOut.down"},none:{}}},defaultVariants:{shouldDisplay:!0,animationVariant:"none"}});function BC({children:e}){const t=g(null),{isActive:n,isInHistory:r}=b(LC),{animationState:a,handleAnimationEnd:o,shouldDisplay:i}=function({isActive:e,isInHistory:t,focusRef:n}){const r=g(!1),a=g(!1),[o,i]=y("none"),l=Xe(e=>e.closingDrawerCount),s=l>0,c=e&&s,d=e||s||t;E(()=>{e&&t&&!a.current&&!s&&i("opening"),r.current=e,a.current=t},[e,t,s]),E(()=>{c&&"closing"!==o&&i("closing")},[c,o]);const u=x(e=>{("slide-out-right"===e.animationName||"slide-out-down"===e.animationName)&&(l>1?Xe.getState().confirmCloseAllDrawers():Xe.getState().confirmCloseDrawer()),i("none")},[l]);return k(()=>{e&&!s&&n.current?.focus()},[e,s,n]),{animationState:o,handleAnimationEnd:u,shouldDisplay:d}}({isActive:n,isInHistory:r,focusRef:t});return S("div",{ref:t,tabIndex:-1,className:FC({shouldDisplay:i,animationVariant:/* @__PURE__ */function(e){return"none"===e?"none":"opening"===e?"slideInRight":"slideOutRight"}(a)}),onAnimationEnd:o,children:e})}const UC=Qt(null,Ut({display:"flex",backgroundColor:"surface.foreground",flexDirection:"column",height:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",minWidth:"fit-content",borderLeft:"1px solid {colors.border.layout.strong}",justifyContent:"flex-start",alignItems:"center",padding:5,gap:"10px"}));function VC({children:e}){return S("div",{tabIndex:-1,...UC,children:e})}const WC=qt({base:{display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"},variants:{background:{foreground:{backgroundColor:"surface.foreground"}}}});function HC({background:e,children:t}){return S("div",{className:WC({background:e}),children:t})}const qC=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function jC(e){return void 0!==qC[e]}function zC(e){return qC[e]}const KC=Ti(e=>p.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},p.createElement("defs",null,p.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),p.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),p.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),YC=Ut({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function _C({cldrShortName:e}){return S("div",{className:YC,children:zC(e)})}const ZC=qt({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),GC=Ut({display:"flex",gap:"4px",backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",padding:"4px 8px",alignItems:"center",justifyContent:"center",scrollbar:"hidden",overflow:"hidden"});function QC({reactions:e,type:t,handleClick:n}){return S("div",{className:GC,children:e.map((e,r)=>S("button",{className:ZC({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:S(_C,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const XC=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:Ao(n)};return await Hr(o)},JC=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:Ao(n)};return await async function(e){return gm(e)}(o)};function $C(e,t,n){return Mn(Sl({id:e}),t,n)}async function eA(e){const t=Sl({id:e});return Pr("mutation successful, invalidating messages queries"),zn.invalidateQueries({queryKey:t}).catch(e=>Rr({error:e,severity:"error"}))}function tA(e,t,n){const r=[...e];return r[n]=t,r}const nA=Ut({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),rA=Object.keys(qC).filter(jC).map(e=>({emojiCode:e,authorInfo:[]}));function aA({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=b(Qs),{mutate:l}=function(e){const{userId:t,userEmail:n}=b(Qs);return ru({mutationFn:XC,onMutateFn:({data:r,accessToken:a,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a,userEmail:o}){const i=$C(n,t,r);await zn.cancelQueries({queryKey:i});const l=zn.getQueryData(i);return zn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:tA(t,(r=t[n],i=e,l=a,s=o,{...r,reactions:[...r.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),n);var r,i,l,s}),{oldMessages:l}}({data:r,accessToken:a,conversationId:e,environment:o,userId:t,userEmail:n})},onSettled:()=>eA(e)})}(e);return P(Cs,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[S(Es,{children:e=>S("button",{className:nA,...e,children:S(Sd,{Component:KC})})}),S(Fs,{type:"reaction",children:S(QC,{reactions:rA,type:n,handleClick:e=>{r.some(t=>{const n=t.emojiCode===e,r=t.authorInfo.some(e=>e.userId===i);return n&&r})||(l({id:t,emojiCode:e}),o(!1))}})})]})}const oA=qt({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function iA({reactions:e,type:t,handleClick:n}){const r=oA({type:t});return S("div",{className:r,children:S(QC,{reactions:e,handleClick:n,type:t})})}const lA=qt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),sA=qt({base:{position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"column",alignItems:"flex-start",borderRadius:"md",borderWidth:1,borderStyle:"solid",flexShrink:1,overflow:"wrap",wordBreak:"break-word",whiteSpace:"pre-wrap"},variants:{type:{sent:{color:"typography.intent.primary",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary"},received:{color:"typography.base",borderColor:"border.layout",backgroundColor:"surface.foreground"}}}}),cA=Ut({position:"relative",display:"flex",flexDirection:"column"});function dA({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=g(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=y(!1),[r,a]=y(!1);return k(()=>{if(null===o.current||!i||s)return;const e=o.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,o=e,s=r,l=n]),{isHover:t,reactionIsOpen:r,setIsHover:n,setReactionIsOpen:a};var o,i,l,s}(o),{mutate:d}=function(e){const{userId:t}=b(Qs);return ru({mutationFn:JC,onMutateFn:({data:n,accessToken:r,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a}){const o=$C(n,t,r);await zn.cancelQueries({queryKey:o});const i=zn.getQueryData(o);return zn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return On(r)||0===r.reactions.length?t:tA(t,function(e,t,n){const r=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===n));return{...e,reactions:r}}(r,e.emojiCode,a),n)}),{oldMessages:i}}({data:n,accessToken:r,conversationId:e,environment:a,userId:t})},onSettled:()=>eA(e)})}(e),u=n?"sent":"received",h=a.filter(e=>jC(e.emojiCode)),p=h.length>0,m=Qt(zt[`message-${u}`],sA({type:u}));return P("div",{className:lA({type:u,hasReactionsOnMessage:p}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[P("div",{className:cA,children:[S("div",{...m,children:r}),p&&S(iA,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&S(aA,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const uA=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),p.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),p.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),hA=qt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),pA=Ut({position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"12px",borderRadius:"md",borderWidth:1,borderStyle:"solid",borderColor:"border.layout",backgroundColor:"surface.foreground",flexShrink:1}),gA=Ut({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),mA=Ut({textDecoration:"none",color:"inherit",cursor:"pointer"});function vA({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:a}=t,o=If();return S("div",{className:hA({type:e?"sent":"received"}),children:S("div",{onClick:async()=>{if(o)window.open(a,"_self","noopener,noreferrer");else try{if(a){const e=await fetch(a),t=await e.blob(),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n??"attachment",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}}catch(e){await Rr({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(a,"_blank","noopener,noreferrer")}},className:mA,children:P("div",{className:pA,children:[P("div",{className:gA,children:[S(cs,{children:n}),S(Ia,{children:`${r}`})]}),S(Sd,{Component:uA})]})})})}const bA=Qt(null,Ut({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function fA({children:e}){return S("div",{...bA,children:e})}const yA=Qt(null,Ut({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),xA=Ut({minHeight:1,width:"100%"}),kA=w(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=g(null);t&&r?.current?.focus();const i=x(()=>{t&&Fn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){k(()=>{const r=e.current;if(null!==r){let e=r.scrollTop,a=Date.now();const o=()=>{if(t){const{scrollVelocity:t,currentScrollTop:o,currentTime:i}=function(e,t,n){const r=e.scrollTop,a=Date.now(),o=Math.abs(r-t),i=a-n;return{scrollVelocity:i>0?o/i:0,currentScrollTop:r,currentTime:a}}(r,e,a);t>5&&n(),e=o,a=i}};return r.addEventListener("scroll",o),()=>{r.removeEventListener("scroll",o)}}},[t,n,e])}(o,t,i),P("div",{tabIndex:-1,...yA,ref:o,children:[S("div",{className:xA,ref:a}),e]})}),TA=Object.freeze({message:{text:"",attachments:[]}});function wA(e){const t=0==e?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}const CA=Ut({display:"flex",flex:"1 1 0",flexDirection:"row",justifyContent:"space-between",backgroundColor:"surface.foreground",borderWidth:"1px",borderStyle:"solid",borderColor:"border.layout",padding:"8px 16px",marginBottom:"8px"}),AA=Ut({display:"flex",flexDirection:"row",gap:"8px"}),EA=Ut({display:"grid",flexDirection:"column"});function IA({attachment:e,onRemove:t}){const n=(r=e).isPending?{text:"Uploading...",accent:"active"}:null===r.id?{text:"Failed to upload. Try uploading again.",intent:"danger"}:{text:wA(r.size)};var r;return P("div",{className:CA,children:[P("div",{className:AA,children:[S(Sd,{Component:Js}),P("div",{className:EA,children:[S(cs,{children:e.name}),S(Ia,{intent:n.intent,accent:n.accent,children:n.text})]})]}),!e.isPending&&S(js,{onClick:()=>t(e),children:S(Ni,{Component:Is})})]})}const SA=Ut({width:"100%"});function NA({conversationId:e,addMessage:t,blockSubmit:n,isMobile:r,scrollRef:a,setActiveKeyboard:o,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:Fg({defaultValues:t??TA,onSubmit:t=>{uh.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=g(null),d=x(e=>{s.setFieldValue("message",t=>({...t,attachments:[...t.attachments,...e.map(e=>({localId:e.localId,name:e.name,size:e.size,id:null,isPending:!0}))]}))},[s]),u=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.map(t=>e.find(e=>e.localId===t.localId)||t)}))},[s]),{mutate:h}=ru({mutationFn:lh,onSuccess:async()=>zn.invalidateQueries({queryKey:["files/attachments"]})}),p=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.filter(t=>t.localId!==e.localId)})),null!==e.id&&h({id:e.id})},[s,h]);return S("form",{className:SA,ref:c,onKeyDown:e=>function(e,t,n,r){if(!r&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!n)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,n,r),onSubmit:e=>{if(!n)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:S(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>P(N,{children:[e.map(e=>S(IA,{attachment:e,onRemove:p},e.localId)),S(s.AppField,{name:"message",children:t=>S(t.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function PA(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text??"",reactions:[],attachments:[]}}async function RA(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return Pr("mutation successful, invalidating messages queries"),Promise.all([zn.invalidateQueries({queryKey:e}),zn.invalidateQueries({queryKey:t}),zn.invalidateQueries({queryKey:n})]).catch(e=>Rr({error:e,severity:"error"}))}const DA=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>tl({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),MA=async({data:e,accessToken:t,environment:n})=>tl({data:{data:[e]},accessToken:t,environment:n}),LA=Ut({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),OA=Ut({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),FA=Ut({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),BA="Marked As Resolved";function UA({resolver:e}){const t=e?`${e} ${BA}`:BA;return P("div",{className:OA,children:[S("div",{className:LA}),S("div",{className:FA,children:t}),S("div",{className:LA})]})}const VA=qt({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function WA({width:e="md",height:t="md"}){return S($a,{styles:VA({width:e,height:t})})}const HA=Ut({display:"flex",flexDirection:"row-reverse"});function qA(){return P(N,{children:[S(WA,{width:"lg",height:"lg"}),S("div",{className:HA,children:S(WA,{width:"md",height:"lg"})}),S("div",{className:HA,children:S(WA,{width:"lg",height:"xl"})}),S(WA,{width:"md",height:"lg"})]})}const jA=Ut({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function zA({isConversationLoading:e,isFilling:t,message:n}){return e?n?S(fA,{children:S(dA,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?S(fA,{children:S(qA,{})}):P("div",{className:jA,children:[S(Aa,{textAlign:"center",wrap:"wrap",children:"Send your bookkeeper a message"}),S(cs,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const KA=Qt(null,Ut({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",flexDirection:"column",position:"relative",backgroundColor:"surface.background",borderTop:"{borderWidths.lg} solid",borderTopColor:"border.layout",padding:"12px 15px"}));function YA({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=b(Qs),{mutate:s}=function(){const{userId:e}=b(Qs);return ru({mutationFn:Rl,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=Mn(Sl({id:e.conversationId}),t,n);await zn.cancelQueries({queryKey:a});const o=zn.getQueryData(a);return zn.setQueryData(a,t=>[PA(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:RA})}(),{query:{data:c},isFilling:d}=function(e){const t=Fn(e);return _n({queryKey:Sl({id:e??""}),queryFn:Pl,select:Nl,enabled:t})}(e),{mutate:u,isPending:h,variables:p}=(w=t,C=o,ru({mutationFn:MA,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(On(e)||On(t))return;w(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(Fn(C)){const e={id:C};Xo(C,Qo.BANK_TRANSACTION)?o=async()=>{const t=Tl(e);return await zn.invalidateQueries({queryKey:t})}:Xo(C,Qo.FINANCIAL_SUMMARY)&&(i=async()=>await zn.invalidateQueries({queryKey:a}))}return Pr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([zn.invalidateQueries({queryKey:n}),zn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>Rr({error:e,severity:"error"}))}})),{mutate:m}=ru({mutationFn:DA,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return Pr("mutation successful, invalidating conversations queries"),Promise.all([zn.invalidateQueries({queryKey:e}),zn.invalidateQueries({queryKey:t})]).catch(e=>Rr({error:e,severity:"error"}))}}),[v,f]=y(!1),x=g(null),T=g(null);var w,C;k(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),k(()=>{oh(T)},[c,T]);const A=On(e)||On(c)||d;return P(N,{children:[A?S(kA,{ref:T,inputRef:x,activeKeyboard:v,setActiveKeyboard:f,children:S(zA,{isConversationLoading:h,isFilling:d,message:p?.message?.text})}):P(kA,{ref:T,activeKeyboard:v,setActiveKeyboard:f,inputRef:x,children:[n&&S(UA,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return S(fA,{children:t.map(t=>P(N,{children:[t.attachments.filter(e=>!On(e)).map(e=>S(vA,{sentByCurrentUser:r,attachment:e},e?.id)),t.text&&S(dA,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),S("div",{...KA,children:S(NA,{scrollRef:T,inputRef:x,conversationId:e,blockSubmit:h,isMobile:a,addMessage:({value:t})=>{const{text:n,attachments:r}=t.message,a=n.trim(),i=r.filter(e=>null!==e.id&&!e.isPending),l=i.map(e=>`att_${e.id}`),c=a.length>0,d=l.length>0;if(c||d)if(On(e)){let e="";c?e=a:d&&(e=i[0]?.name);const t=(h=a,p=e.slice(0,40),g=l,{subject:p,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Fn(m=o)&&{attachedEntityId:m},message:{text:h,...g.length>0&&{attachmentIds:g}}});u(t)}else s({conversationId:e,text:a,...d&&{attachmentIds:l}});var h,p,g,m},setActiveKeyboard:f,defaultValues:i})})]})}const _A=Qt(zt["drawer-header"],Ut({padding:"10px 25px 10px 15px"},uC));function ZA({hideDivider:e=!1,children:t}){return P(N,{children:[S("div",{..._A,children:t}),!e&&S(tg,{alignment:"horizontal",color:"normal"})]})}function GA({conversationId:e,attachedEntityId:t}){const[n,r]=y(e),{query:{data:a}}=el(n),o="CLOSED"===a?.resolutionStatus;return P(HC,{children:[S(ZA,{}),S(YA,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const QA=Qt(zt["form-body"],Ut({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflowY:"auto",overflowX:"hidden",overscrollBehavior:{base:"contain",xl:"none"},minWidth:{base:0,sm:"512px"}}));function XA({children:e}){return S("div",{...QA,children:e})}function JA({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:a}){return S(js,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:a,children:S(Tc,{Component:t})})}function $A({activeTab:e,onClick:t,popupTriggerProps:n}){return S(JA,{active:"conversation"===e,onClick:()=>t("conversation"),icon:Wc,ariaLabel:"conversation-tab",popupTriggerProps:n})}const eE=Ut({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function tE({conversationId:e,attachedEntityId:t}){const n=As(),[r,a]=y(e),{query:{data:o}}=el(r),i="CLOSED"===o?.resolutionStatus;return S(Tx,{children:P("div",{className:eE,children:[S(ZA,{children:P(hT,{children:[S(mT,{Icon:wi,handleClose:()=>n.setOpen(!1)}),S(Aa,{children:"Back"})]})}),S(YA,{conversationId:r,setConversationId:a,isResolved:i,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})})}const nE=Qt(null,Ut({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),rE=Qt(null,Ut({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),aE=Ut({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),oE=e=>{Pu(e),Ru(e)},iE=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const i=If(),[l,s]=y(r??null),c=e=>s(e===l?null:e);return S(BC,{children:P("div",{...nE,children:[S(HC,{children:P("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:oE,...rE,children:[n,S(XA,{children:e})]})}),null!==l&&S("div",{className:aE}),"conversation"===l&&S(GA,{conversationId:a,attachedEntityId:o}),S(VC,{children:i?P(Cs,{children:[S(Es,{children:e=>S($A,{onClick:c,activeTab:l,popupTriggerProps:e})}),S(tE,{conversationId:a,attachedEntityId:o})]}):S($A,{onClick:c,activeTab:l})})]})})},lE=Qt(null,Ut({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function sE({transaction:e,bankAccount:t}){const n=e?e.description:"",r=On(t)||On(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=ni(t.amount);return`${n?`${r} `:""}${Go(e.name,e.mask)}`})(t,e);return P("div",{...lE,children:[S(Aa,{wrap:"wrap",children:n}),t&&S(Ia,{children:r})]})}const cE=h.object({id:h.string(),type:h.enum(Object.values(zy)),reviewStatus:h.enum(Object.values(Nb)),amount:h.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:h.string("Required").refine(e=>(function(e,t){const n=ln(e.getFullYear(),e.getMonth(),e.getDate()),r=ln(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||yn(new Date(e),/* @__PURE__ */new Date))&&kn(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),customer:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),frequency:h.union([h.object({name:h.string(),value:h.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),h.undefined()]),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()})),bankAccount:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}),notes:h.string().nullable()}),dE=cE.extend({children:h.array(h.object({amount:h.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()}))})),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"})}),uE=cE.extend({id:h.string(),type:h.literal(Object.values(zy)),description:h.string(),displayName:h.string(),iconUrl:h.string().optional(),status:h.literal(Object.values(_y)),reviewStatus:h.literal(Object.values(Nb)),apiName:h.literal(Object.values({PLAID:"PLAID",UNIT:"UNIT",STRIPE:"STRIPE",SHOPIFY:"SHOPIFY",SQUARE:"SQUARE",RUTTER:"RUTTER",UBER:"UBER",MOOV:"MOOV",QUALPAY:"QUALPAY",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",QBO:"QBO",XERO:"XERO",BENCH:"BENCH",WAVE:"WAVE"})),apiSourceId:h.string().nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),customer:h.object({id:h.string(),name:h.string().optional(),email:h.string().optional()}).nullable(),vendor:h.object({id:h.string(),name:h.string().optional()}).nullable(),invoice:h.object({id:h.string(),name:h.string(),date:h.string(),lineItems:h.array(h.object({id:h.string(),amount:h.number()}))}).nullable(),bill:h.object({id:h.string(),name:h.string().optional()}).nullable(),payroll:h.object({id:h.string(),date:h.string().optional(),checkDate:h.string().optional(),description:h.string().optional()}).nullable(),apiItemId:h.string().nullable()});uE.extend({});const hE=dE.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);s(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),pE=dE.extend({reconciliationMatch:h.object({id:h.string(),description:h.string().optional(),amount:h.number().optional(),date:h.string().optional(),apiInstitutionId:h.string().nullable().optional(),apiName:h.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",ADYEN:"ADYEN"}).optional()}).nullish()}).refine(e=>{const t=e.reconciliationMatch?.amount,n=e.amount;return!!On(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["reconciliationMatch"],when:e=>pE.pick({amount:!0,reconciliationMatch:!0}).safeParse(e.value).success});uE.extend({});const gE=dE.extend({});uE.extend({});const mE=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],vE=["FEDERAL","STATE","SALES"],bE=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function fE(e){if(!On(e))return bE.find(t=>t.value===e)?.label}const yE=h.object({tax:h.object({paymentInfo:h.object({region:h.enum(vE,{message:`Tax region must be one of: ${vE.join(", ")}`}),quarter:h.enum(["Q1","Q2","Q3","Q4"]).optional(),year:h.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${vE.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),xE=h.intersection(yE,dE);h.intersection(yE,uE);const kE={id:"",type:"EXPENSE",reviewStatus:"USER_REVIEW_REQUIRED",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:fl[0],notes:null,classSegments:[],children:[],reconciliationMatch:{id:"",description:"",amount:0,date:"",apiInstitutionId:"",apiName:void 0},tax:{paymentInfo:null}};function TE(e){const{mutate:t}=gb(),{query:{data:n}}=$h(),r=e?{id:(a=e).id,type:a.type,reviewStatus:a.reviewStatus,amount:Th(a.amount),category:a.category,date:a.date,vendor:a.vendor,customer:a.customer,frequency:a.frequency,bankAccount:a.bankAccount,glAccount:a.glAccount,notes:a.notes,classSegments:a.classSegments,children:a.children.map(e=>({amount:Th(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),reconciliationMatch:a.reconciliationMatch,tax:a.tax}:kE;var a;return Fg({defaultValues:r,validators:{onBlur:dE,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return hE;case"BANK_TRANSFER":return pE;case"REVENUE":return gE;case"TAX_PAYMENT":return xE;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);if(!n.success){const e={};for(const t of n.error.issues){const n=t.path.join(".");e[n]||(e[n]={message:t.message})}return{fields:e}}}},onSubmit:r=>{if(!e)return;const a=function({payload:e,expenseCategories:t}){if("EXPENSE"===e.type){const n=t.find(t=>t.id===e.categoryId)?.accountId;return On(n)?e:{...e,glAccountId:Jo({id:n,prefix:"GL_ACCOUNT"})}}return e}({payload:function(e,t){const n={id:e,type:t.type,amount:t.amount?wh(t.amount):0,date:t.date,bankAccountId:t.bankAccount.id,frequency:t.frequency?.value,notes:t.notes,classSegmentIds:t.classSegments.map(e=>e.id),children:t.children.map(e=>({amount:e.amount?wh(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:t.classSegments.map(e=>e.id)}))};switch(t.type){case"EXPENSE":return{...n,vendorId:t.vendor?.id,customerId:t.customer?.id,categoryId:t.category?.id};case"REVENUE":return{...n,customerId:t.customer?.id,glAccountId:t.glAccount?.id};case"BANK_TRANSFER":return{...n,glAccountId:t.glAccount?.id,matchingBankTransactionId:t.reconciliationMatch?.id,reviewStatus:t.reviewStatus};case"TAX_PAYMENT":return{...n,tax:t.tax};default:return n}}(e.id,r.value),expenseCategories:n?.data??[]});t(a),r.formApi.reset(r.value,{keepDefaultValues:!0})},onSubmitInvalid:()=>{}})}function wE({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=As();return P(Wh,{onClick:()=>{r&&a.close(),t()},children:[n&&S(Sd,{Component:n}),S(Aa,{children:e})]})}function CE({transaction:e}){const{mutate:t}=pb(),n=()=>t(Gy([e]));return S(wE,{onClick:()=>{return e=n,void Gd({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Vd,label:"Cancel"},{key:Wd,label:"Delete",type:Zd}]}).then(t=>{t===Wd&&e()});var e},children:"Delete"})}function AE({transaction:e}){const{mutate:t}=pb();return S(wE,{onClick:()=>{t([e].map(e=>({id:e.id,status:_y.ACTIVE})))},children:"Restore"})}const EE=Bg({defaultValues:kE,render:function({form:e}){return S(wE,{onClick:()=>{hr()},closeOnClick:!0,children:"Attach Bill(s)"})}}),IE=Bg({defaultValues:kE,render:function({form:e}){return S(wE,{onClick:()=>{hr()},closeOnClick:!0,children:"Attach Payroll"})}}),SE=Bg({defaultValues:kE,render:function({form:e}){return S(wE,{onClick:()=>{hr()},Icon:Mf,closeOnClick:!0,children:"Attach Invoice(s)"})}}),NE=fl.filter(e=>"ONE_TIME"!=e.value);function PE({onClick:e}){const t=As();return S(mp,{triggerChildren:S(fp,{displayLabel:"Make recurring"}),popupChildren:S(Og,{frequencies:NE,onClick:n=>{e(n),t.close()}})})}const RE=Bg({defaultValues:kE,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=Xe(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Pe(),o=!On(n)&&Ch(n)&&"EXPENSE"===n.type;return P(ZA,{children:[P(hT,{children:[S(mT,{}),S(Aa,{children:t}),S(AT,{shouldUseButtonDiscreteStyles:!0,children:P(Mh,{children:[n?.status===_y.ACTIVE&&S(CE,{transaction:n}),n?.status===_y.INACTIVE&&S(AE,{transaction:n}),r&&P(N,{children:["EXPENSE"===n?.type&&S(EE,{form:e}),"EXPENSE"===n?.type&&S(IE,{form:e}),"REVENUE"===n?.type&&S(SE,{form:e})]}),o&&S(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return a&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&S(PE,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]}),S(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:S(e.SaveButton,{})})]})}}),DE=[{value:"EXPENSE",label:"Expense"},{value:"REVENUE",label:"Income"},{value:"TAX_PAYMENT",label:"Tax Pmt"},{value:"BANK_TRANSFER",label:"Transfer"}],ME=qt({base:{display:"flex",flexDirection:"column",position:"fixed",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",width:{base:"100%",sm:"562px"},minWidth:{base:"100%",sm:"fit-content"},backgroundColor:"surface.background"},variants:{status:{unmounted:{},initial:{animation:"slideIn.right"},open:{animation:"slideIn.right"},close:{animation:"slideOut.right"}}},defaultVariants:{status:"unmounted"}}),LE=Ut({display:"flex",padding:"16px 16px 45px 16px",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"});function OE({children:e,title:t}){const n=As(),{isMounted:r,status:a}=function(e){const{isMounted:t,status:n}=be(e,{duration:300});return{isMounted:t,status:n}}(n.context),o=x(e=>{e.stopPropagation()},[]);return r?S(Tx,{fadeIn:!1,forceMount:!0,children:P("div",{className:ME({status:a}),onAnimationEnd:o,children:[S(ZA,{children:P(hT,{children:[S(mT,{Icon:wi,handleClose:n.close}),S(Aa,{children:t})]})}),S("div",{className:LE,children:e})]})}):null}const FE=Ut({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"});function BE({text:e,handleClick:t,iconUrl:n,RightIcon:r,popupTriggerChildrenProps:a}){return S(Xl,{onClick:t,stylists:[ks],popupTriggerProps:a,children:P("div",{className:FE,children:[P("div",{className:FE,children:[n&&S("img",{src:n,alt:void 0,width:"15px",height:"15px"}),S(Aa,{wrap:"wrap",children:e})]}),r&&S(Sd,{Component:r})]})})}const UE=Ut({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function VE({children:e}){return S("div",{className:UE,children:e})}const WE=Ut({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function HE(){return S($a,{styles:Wt(xs,WE)})}const qE=Ut({width:"70px",height:"24px"}),jE=Ut({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function zE(){return P("div",{className:jE,children:[S($a,{styles:qE}),P(VE,{children:[S(HE,{}),S(HE,{}),S(HE,{})]}),S($a,{styles:qE}),P(VE,{children:[S(HE,{}),S(HE,{}),S(HE,{})]})]})}function KE({title:e,category:t,onClick:n,currentCategory:r}){return P(Cs,{children:[S(Es,{children:e=>S(BE,{text:t.name??"",iconUrl:t.iconUrl,RightIcon:Ci,popupTriggerChildrenProps:e},t.id)}),S(OE,{title:e,children:S(lI,{listLabel:t.name??"",onClick:n,nestedCategories:t.children??[],type:"EXPENSE",currentCategory:r})})]})}function YE({onClick:e,showSuggestedCategories:t,listLabel:n,categories:r,isFilling:a,currentCategory:o}){const i=Re();return a?S(zE,{}):P(VE,{children:[i&&t&&S(Aa,{children:"Suggested"}),S(Aa,{children:n}),S("div",{children:r?.map(t=>t.hasChilds?S(KE,{title:"All Categories",category:t,onClick:e,currentCategory:o},t.id):S(BE,{text:t.name??"",iconUrl:t.iconUrl,handleClick:()=>e(t),RightIcon:o?.id===t.id?Sb:void 0},t.id))})]})}function _E(e){const t={};for(const{parent:n,child:r}of e){const e=n.id;n.id===r.id?t[e]={parent:n,children:[]}:t[e]?t[e].children.push(r):t[e]={parent:n,children:[r]}}return t}const ZE=Ut({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function GE({singularSearchCTANoun:e,pluralNounNotFound:t,showSearchCTA:n}){return P("div",{className:ZE,children:[S(Sd,{Component:Zx}),S(Aa,{wrap:"wrap",children:`No ${t} found`}),n&&S(Ia,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}const QE=Ut({display:"flex",flexDirection:"column",gap:"16px"}),XE=Ut({display:"flex",flexDirection:"column",gap:"8px"});function JE({searchTerm:e,onClick:t,categories:n,isFilling:r,currentCategory:a}){const o=m(()=>We(n),[n]),i=m(()=>np(o),[o]),l=m(()=>new Ce(i??[],sp),[i]),s=m(()=>i?_E(dp(l.search(e),i)):{},[i,e,l]);return r?S(zE,{}):0===Object.keys(s).length?S(GE,{singularSearchCTANoun:"category",pluralNounNotFound:"categories",showSearchCTA:!0}):S(VE,{children:S("div",{className:QE,children:Object.entries(s).map(([e,{parent:n,children:r}])=>{const o=r.length>0;return P("div",{className:XE,children:[o&&S(Aa,{children:n.name}),S("div",{children:o?r.map(e=>S(BE,{text:e.name??"",handleClick:()=>t(e),iconUrl:e.iconUrl,RightIcon:a?.id===e.id?Sb:void 0},e.id)):S(BE,{text:n.name??"",handleClick:()=>t(n),iconUrl:n.iconUrl,RightIcon:a?.id===n.id?Sb:void 0},e)})]},e)})})})}const $E=Ut({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),eI=Ut({display:"flex",padding:"16px",flexDirection:"row",alignItems:"center",gap:"8px",flex:"1 0 0",borderRadius:"sm",border:"1px solid {colors.border.layout}",backgroundColor:"surface.foreground",maxHeight:"49px",minWidth:"fit-content"}),tI=Wt(Ut({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),nn({label:"strongLabel"})),nI=Qt(null,Ut({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function rI({searchTerm:e,setSearchTerm:t,placeholder:n}){return P("div",{className:$E,children:[S(Aa,{children:"Search"}),P("div",{className:eI,children:[S(Sd,{Component:ix}),S("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:tI}),Vn(e)&&S(Xl,{stylists:[nI],onClick:()=>t(""),children:S(Sd,{Component:Is})})]})]})}function aI({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o}){const[i,l]=y("");return S(Lh,{searchTerm:i,setSearchTerm:l,onClick:t=>{e?.(t)},placeholder:t,SearchInput:rI,SearchList:n,DefaultList:r,extraProps:a,listLength:o})}const oI="Search expense categories...",iI=[];function lI({listLabel:e="All Expense Categories",onClick:t,showSuggestedCategories:n,nestedCategories:r,currentCategory:a}){const{query:{data:o,isFetched:i},isFilling:l}=ep(),s=r??o?.data??iI,c=As();return S(aI,{placeholder:oI,onClick:e=>{t(e),c.close()},SearchList:JE,DefaultList:YE,listLength:s.length,extraProps:{categories:s,listLabel:e,isFetched:!!On(r)&&i,isFilling:!!On(r)&&l,showSuggestedCategories:n,currentCategory:a}})}function sI({title:e,glAccount:t,onClick:n,currentGlAccount:r}){return P(Cs,{children:[S(Es,{children:e=>S(BE,{text:t.name,RightIcon:Ci,popupTriggerChildrenProps:e},t.id)}),S(OE,{title:e,children:S(mI,{headerLabel:e,listLabel:t.name,nestedGlAccounts:t.children,parentAccount:t,onClick:n,type:"REVENUE",currentGlAccount:r})})]})}function cI({onClick:e,showSuggestedCategories:t,glAccounts:n,listLabel:r,isFilling:a,currentGlAccount:o}){const i=Re(),l=Fp([...n],Op);return a?S(zE,{}):P(VE,{children:[i&&t&&S(Aa,{children:"Suggested"}),S(Aa,{children:r}),S("div",{children:l?.map(t=>t.hasChilds?S(sI,{glAccount:t,title:"All Categories",onClick:e,currentGlAccount:o},t.id):S(BE,{text:t.name,handleClick:()=>e(t),RightIcon:o?.id===t.id?Sb:void 0},t.id))})]})}const dI=Ut({display:"flex",flexDirection:"column",gap:"16px"}),uI=Ut({display:"flex",flexDirection:"column",gap:"8px"});function hI({searchTerm:e,onClick:t,glAccounts:n,isFilling:r,parentAccount:a,currentGlAccount:o}){const i=m(()=>n.flatMap(e=>[e,...e.children]),[n]),l=m(()=>a?[a,...i]:i,[a,i]),s=Fp(i,Op),c=m(()=>new Ce(s,eb),[s]),d=m(()=>_E(nb(c.search(e),l)),[l,e,c]);return r?S(zE,{}):0===Object.keys(d).length?S(GE,{singularSearchCTANoun:"category",pluralNounNotFound:"income categories",showSearchCTA:!0}):S(VE,{children:S("div",{className:dI,children:Object.entries(d).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return P("div",{className:uI,children:[a&&S(Aa,{children:n.name}),S("div",{children:a?r.map(e=>S(BE,{text:e.name,handleClick:()=>t(e),RightIcon:o?.id===e.id?Sb:void 0},e.id)):S(BE,{text:n.name,handleClick:()=>t(n),RightIcon:o?.id===n.id?Sb:void 0},e)})]},e)})})})}const pI="Search income categories...",gI=[];function mI({listLabel:e="All Income Categories",onClick:t,showSuggestedCategories:n,nestedGlAccounts:r,parentAccount:a,currentGlAccount:o}){const{query:{data:i,isFetched:l},isFilling:s}=Sp(),c=r??i??gI,d=As();return S(aI,{placeholder:pI,onClick:e=>{t(e),d.close()},SearchList:hI,DefaultList:cI,listLength:c.length,extraProps:{glAccounts:c,listLabel:e,isFetched:l,isFilling:s,showSuggestedCategories:n,parentAccount:a,currentGlAccount:o}})}function vI({onClick:e,showSuggestedCategories:t,currentRegion:n}){const r=Re(),a=As();return P(VE,{children:[r&&t&&S(Aa,{children:"Suggested"}),S(Aa,{children:"All Tax Categories"}),S("div",{children:bE.map(t=>S(BE,{text:t.label,handleClick:()=>(e(t.value),void a.close()),RightIcon:n===t.value?Sb:void 0},t.value))})]})}function bI({onClick:e,onNeedsMatchClick:t,showSuggestedCategories:n,bankTransfers:r,holdingAccount:a,listLabel:o,isFetched:i,isFilling:l,currentTransfer:s}){const c=Re(),d=!l&&i&&0===r.length;return l?S(zE,{}):P(VE,{children:[a&&S(BE,{text:"Needs Match",handleClick:t}),c&&n&&S(Aa,{children:"Suggested"}),!d&&P(N,{children:[S(Aa,{children:o}),S("div",{children:r?.map(t=>S(BE,{text:Ah(t),handleClick:()=>e(t),RightIcon:s?.id===t.id?Sb:void 0},t.id))})]})]})}const fI={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function yI({searchTerm:e,onClick:t,bankTransfers:n,isFilling:r,currentTransfer:a}){const o=m(()=>new Ce(n??[],fI),[n]),i=m(()=>n?o.search(e).map(e=>e.item):[],[n,e,o]);return r?S(zE,{}):0===i.length?S(GE,{singularSearchCTANoun:"matching bank transaction",pluralNounNotFound:"matching bank transactions",showSearchCTA:!0}):S(VE,{children:S("div",{children:i.map(e=>S(BE,{text:Ah(e),handleClick:()=>t(e),RightIcon:a?.id===e.id?Sb:void 0},e.id))})})}const xI=[];function kI({listLabel:e="All Matching Bank Transactions",onClick:t,showSuggestedCategories:n,transactionBankAccountId:r,transactionAmount:a,transactionDate:o,currentTransfer:i}){const l=An(o),s=(c=r,{filter:{status:{in:["ACTIVE"]},type:{in:["BANK_TRANSFER",(d=a)>0?"EXPENSE":"REVENUE"]},amount:{equal:-d},date:{greaterThanEqual:En(Dn(u=l??/* @__PURE__ */new Date,-3)),lessThanEqual:En(Dn(u,3))},bankAccount:{id:{notIn:[c]}},reconciliationMatch:{id:{equal:null}}}});var c,d,u;const{query:{data:h,isFetched:p},isFilling:g}=Cl(s,{enabled:null!==l}),m=h?.data??xI,{query:{data:v}}=Ip({select:e=>e.find(e=>"CLEARING_ACCOUNT"===e.assetType)}),b=As();return S(aI,{placeholder:"Search matching bank transfers...",onClick:e=>{t({transfer:e}),b.close()},SearchList:yI,DefaultList:bI,listLength:m.length??0,extraProps:{listLabel:e,bankTransfers:m,isFetched:p,isFilling:g,holdingAccount:v,showSuggestedCategories:n,transactionDate:o,onNeedsMatchClick:()=>{v&&t({glAccount:v}),b.close()},currentTransfer:i}})}const TI=Bg({defaultValues:kE,props:{},render:function({form:e,...t}){const{transactionType:n,onExpenseClick:r,onRevenueClick:a,onTaxPaymentClick:o,onBankTransferClick:i,transaction:l}=t;switch(n){case"EXPENSE":return S(e.Subscribe,{selector:e=>e.values.category,children:e=>S(lI,{...t,type:"EXPENSE",onClick:r,currentCategory:e})});case"REVENUE":return S(e.Subscribe,{selector:e=>e.values.glAccount,children:e=>S(mI,{...t,type:"REVENUE",onClick:a,currentGlAccount:e})});case"TAX_PAYMENT":return S(e.Subscribe,{selector:e=>e.values.tax?.paymentInfo?.region,children:e=>S(vI,{...t,type:"TAX_PAYMENT",onClick:o,currentRegion:e})});case"BANK_TRANSFER":return S(e.Subscribe,{selector:e=>e.values.reconciliationMatch,children:n=>S(kI,{...t,type:"BANK_TRANSFER",onClick:i,transaction:l,transactionBankAccountId:l?.bankAccount.id??e.store.state.values.bankAccount.id,transactionAmount:l?.amount??0,transactionDate:l?.date??e.store.state.values.date,currentTransfer:n})})}}}),wI=Bg({defaultValues:kE,props:{},render:function({form:e,...t}){const{headerLabel:n="Back",initialType:r}=t,[a,o]=y(r);return P(OE,{title:n,children:[S(Hp,{rows:1,cols:4,options:DE,handleClick:e=>o(e.value),selected:(i=a,DE.find(e=>e.value===i))}),S(TI,{form:e,transactionType:a,onExpenseClick:t=>{e.setFieldValue("category",t),e.setFieldValue("type","EXPENSE")},onRevenueClick:t=>{e.setFieldValue("glAccount",t),e.setFieldValue("type","REVENUE")},onTaxPaymentClick:t=>{e.setFieldValue("tax.paymentInfo.region",t),e.setFieldValue("type","TAX_PAYMENT")},onBankTransferClick:({transfer:t,glAccount:n})=>{Fn(t)&&e.setFieldValue("reconciliationMatch",t),Fn(n)&&(e.setFieldValue("glAccount",n),e.setFieldValue("reviewStatus","RECONCILIATION_AWAITING")),e.setFieldValue("type","BANK_TRANSFER")},...t})]});var i}}),CI=Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),AI=Ut({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),EI=Qt(null,Ut({color:"typography.base.weak"})),II=Bg({defaultValues:kE,props:{},render:function({form:e,transaction:t}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(e.AppField,{name:"category",children:e=>S(Uu,{label:"Category",popupTriggerProps:t,children:P("button",{className:CI,type:"button",children:[Fn(e.state.value)?P("div",{className:AI,children:[S("img",{src:e.state.value.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Aa,{wrap:"wrap",children:e.state.value.name})]}):S(Aa,{stylists:[EI],children:"Select category"}),S(Sd,{Component:Ci})]})})})}),S(wI,{initialType:"EXPENSE",form:e,transaction:t})]})}}),SI=Bg({defaultValues:kE,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=Pe();return P(N,{children:[S(e.AppField,{name:"vendor",children:e=>S(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),S(e.AppField,{name:"customer",children:e=>S(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),S(e.Subscribe,{selector:e=>e.values.frequency,children:a=>{return r&&n&&(o=t.type,void 0!==(i=a)&&"ONE_TIME"!==i.value&&"EXPENSE"===o)&&S(e.AppField,{name:"frequency",children:e=>S(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var o,i}}),S(II,{form:e,transaction:t}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),NI=Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),PI=Ut({display:"flex",gap:"8px",alignItems:"center"}),RI=Qt(null,Ut({color:"typography.base.weak"})),DI=Bg({defaultValues:kE,props:{},render:function({form:e,transaction:t}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(e.AppField,{name:"glAccount",children:e=>{const n=e.state.value;return S(Uu,{label:"Category",popupTriggerProps:t,children:P("button",{className:NI,type:"button",children:[Fn(n)?P("div",{className:PI,children:[S("img",{src:n.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Aa,{children:n.name})]}):S(Aa,{stylists:[RI],children:"Select category"}),S(Sd,{Component:Ci})]})})}})}),S(wI,{initialType:"REVENUE",form:e,transaction:t})]})}}),MI=Bg({defaultValues:kE,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return P(N,{children:[S(e.AppField,{name:"customer",children:e=>S(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),S(DI,{form:e,transaction:t}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),LI=Qt(null,Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"})),OI=Qt(null,Ut({color:"typography.base.weak"})),FI=Bg({defaultValues:kE,props:{},render:function({form:e,transaction:t}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(e.AppField,{name:"reconciliationMatch",children:e=>{const n=e.state.value,r=n?Ah(n):"Select",a=n?[]:[OI];return S(Uu,{label:"Matching Bank Transfer",popupTriggerProps:t,children:P("button",{...LI,children:[S(Aa,{stylists:a,children:r}),S(Sd,{Component:Ci,stylists:a})]})})}})}),S(wI,{initialType:"BANK_TRANSFER",form:e,transaction:t})]})}}),BI=Bg({defaultValues:kE,props:{transaction:{}},render:function({form:e,transaction:t}){return P(N,{children:[S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})}),S(e.AppField,{name:"glAccount",children:e=>S(e.BankGlAccountField,{transaction:t})}),S(FI,{form:e,transaction:t})]})}}),UI=Ut({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),VI=Bg({defaultValues:kE,props:{},render:function({form:e,transaction:t}){return P(Cs,{placement:"bottom-start",children:[S(Es,{children:t=>S(e.AppField,{name:"tax.paymentInfo.region",children:e=>S(Uu,{label:"Category",popupTriggerProps:t,children:P("button",{className:UI,type:"button",children:[S(Aa,{children:fE(e.state.value)??"Select region..."}),S(Sd,{Component:Ci})]})})})}),S(wI,{initialType:"TAX_PAYMENT",form:e,transaction:t})]})}}),WI=Bg({defaultValues:kE,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return P(N,{children:[S(VI,{form:e,transaction:t}),S(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>S(e.ButtonGroupField,{label:"Quarter",options:mE})}),S(e.AppField,{name:"tax.paymentInfo.year",children:e=>S(e.GenericSelectorField,{label:"Year",options:fn({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),HI=Ut({display:"flex",flexDirection:"column",gap:"8px"}),qI=Bg({defaultValues:kE,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const{startPrefetch:r,cancelPrefetch:a}=ap();return S("div",{className:HI,onMouseEnter:r,onMouseLeave:a,children:S(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return S(SI,{form:e,transaction:t,isManual:n});case"REVENUE":return S(MI,{form:e,transaction:t,isManual:n});case"BANK_TRANSFER":return S(BI,{form:e,transaction:t});case"TAX_PAYMENT":return S(WI,{form:e,transaction:t,isManual:n});default:return null}}})})}}),jI={EXPENSE:"Expense",REVENUE:"Income",BANK_TRANSFER:"Bank Transfer",TAX_PAYMENT:"Tax Payment",INVOICE_PAYMENT:"Invoice Payment",PAYOUT:"Payout",PAYROLL_PAYMENT:"Payroll Payment",BILL_PAYMENT:"Bill Payment",LOAN_PAYMENT:"Loan Payment"};function zI({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:a,transactionId:o,initialTab:i,currentType:l}){const s=S(RE,{form:t,transaction:e,title:jI[l]});return P(iE,{onSubmit:t.handleSubmit,Header:s,initialTab:i,conversationId:a,transactionId:o,children:[e.description&&S(sE,{transaction:e,bankAccount:n}),S(t.AppField,{name:"amount",children:e=>S(r?e.EditableAmountField:e.DiscreetAmountField,{label:"Total"})}),S(t.AppField,{name:"date",children:e=>S(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),S(qI,{form:t,transaction:e,isManual:r}),S(t.AppField,{name:"notes",children:e=>S(e.TextAreaInput,{label:"Note"})}),S(t.AppField,{name:"type",children:()=>null})]})}function KI({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=function({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=El({id:e});return{transaction:t,form:TE(t),bankAccount:oi(t?.bankAccount?.id??""),isManual:!On(t)&&Ch(t),isLoading:r||n&&!t}}({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return S(r.Subscribe,{selector:e=>e.values.type,children:i=>S(zI,{transaction:n,form:r,bankAccount:a,isManual:o,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function YI({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=El({id:e});return k(()=>{!r&&On(n)&&bl()},[n,r]),On(n)?null:S(KI,{transactionId:e,initialTab:t})}const _I={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},ZI=(e={})=>{const t=Nt(_I,e);return _I.transform(t,St)},GI=e=>Ut(ZI(e));GI.raw=ZI;const QI={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},XI=(e={})=>{const t=Nt(QI,e);return QI.transform(t,St)},JI=e=>Ut(XI(e));function $I({subject:e,children:t}){return P(ZA,{children:[P(hT,{children:[S(mT,{}),S(Aa,{children:e})]}),S("div",{className:JI({alignItems:"center",gap:15}),children:t})]})}function eS({conversationId:e,defaultValues:t}){const[n,r]=y(e),{query:{data:a}}=el(n),o="CLOSED"===a?.resolutionStatus;return S(BC,{children:P(HC,{children:[S($I,{subject:a?.subject??"Conversation"}),S(YA,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}JI.raw=XI;const tS=Ti(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_18201_5557)"},p.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_18201_5557"},p.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function nS({onClick:e,active:t}){return S(Xl,{type:"button",onClick:e,active:t,children:S(Sd,{Component:tS})})}const rS=Ut({display:"flex",flexDirection:"column"});function aS({label:e,data:t,isFilling:n,shimmerWidth:r}){return P("div",{className:rS,children:[S(Ia,{children:e}),n?S(WA,{width:r}):S(Aa,{wrap:"wrap",children:t??""})]})}function oS({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=El({id:e}),a=oi(n?.bankAccount.id??"");if(On(n))return null;const o=GI({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return P("div",{"data-open":t,className:o,children:[P("div",{className:JI({justifyContent:"space-between"}),children:[S(aS,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),S(aS,{label:"Amount",data:wa(Th(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),S(aS,{label:"Bank Account",data:Go(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),S(aS,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function iS({conversationId:e,transactionId:t}){const[n,r]=y(e),[a,o]=y(!0),{query:{data:i}}=el(n),l="CLOSED"===i?.resolutionStatus;return S(BC,{children:P(HC,{children:[S($I,{subject:i?.subject??"Conversation",children:Fn(t)&&S(nS,{onClick:()=>o(!a),active:a},"infoButton")}),Fn(t)&&S(oS,{transactionId:t,isOpen:a}),S(YA,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function lS(){const e=Xe(e=>e.drawerHistory).length>1;return S(BC,{children:P(HC,{background:"foreground",children:[S(ZA,{children:P(hT,{children:[S(mT,e?{Icon:wi}:{}),S(Aa,{children:"Add New Connection"})]})}),S(iC,{})]})})}function sS(){return S(ZA,{children:P(hT,{children:[S(mT,{}),S(Aa,{children:"Financial Summary"})]})})}const cS=Ut({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),dS=nn.raw({body:"default"}),uS=Ut({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},dS);function hS({summaryText:e}){return S("div",{className:cS,children:S("div",{className:uS,children:e})})}const pS=Ut({display:"flex",flexDirection:"column",overflow:"auto"});function gS({summary:e}){return P("div",{className:pS,children:[S(sS,{}),S(hS,{summaryText:e})]})}const mS=Ut({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function vS({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return _n({queryKey:Ll({id:e}),queryFn:Fl})}({id:e});return S(BC,{children:P("div",{className:mS,children:[S(HC,{children:S(gS,{summary:n?.summary})}),S(tg,{}),S(GA,{conversationId:t??null,attachedEntityId:e})]})})}function bS(){return S(BC,{children:S(HC,{children:S(kC,{showCloseButton:!0,inOverlay:!0})})})}const fS=h.object({id:h.string(),name:h.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:h.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),type:h.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),yS={mergeDestination:og,selectedAccount:null};const xS=Ut({display:"flex",flexDirection:"column",gap:"20px"}),kS=Ut({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),TS=Ut.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),wS=Ut(TS,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),CS=Ut(TS,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),AS=Ut(TS,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),ES=Ut({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),IS=Ut({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),SS=Ut({width:"100%",display:"flex",justifyContent:"flex-start"}),NS=Ut({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),PS=Ut({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),RS=e=>{Pu(e),Ru(e)};function DS({account:e}){const t=As(),n=function(e,t){const{mutateAsync:n}=cu();return Fg({defaultValues:yS,onSubmit:async r=>{if(await hu()===Wd&&Fn(e)&&Fn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===og?{...ri(i),duplicateBankAccountIds:[$o(a.id)]}:{...ri(a),duplicateBankAccountIds:[$o(i.id)]});try{await n(l),t.close(),r.value.mergeDestination===og&&bl()}catch{await pu()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=Yo();if(!(r&&r.data||a))return null;const o=r?.data?.filter(t=>t.glAccountId&&t.isSupported&&t.id!==e?.id&&t.integration?.id!==e?.integration?.id);return P("form",{className:xS,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:RS,children:[S(Aa,{children:"Merge Accounts"}),S("div",{className:kS,children:S(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>P(N,{children:[P("div",{className:wS,children:[S("div",{className:SS,children:S(Aa,{children:"Duplicate Account"})}),t===og?S($p,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):S(n.AppField,{name:"selectedAccount",children:n=>S(lg,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sg(t,e,n.state.value)})})]}),P("div",{className:CS,children:[S("div",{className:NS,children:S(Aa,{children:"Into"})}),S(n.AppField,{name:"mergeDestination",children:e=>S("div",{className:IS,children:S(Xl,{onClick:()=>e.handleChange(e.state.value===og?ag:og),children:S(Sd,{Component:Ci})})})})]}),P("div",{className:AS,children:[S("div",{className:PS,children:S(Aa,{children:"Destination Account"})}),t===og?S(n.AppField,{name:"selectedAccount",children:n=>S(lg,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sg(t,e,n.state.value)})}):S($p,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),P("div",{className:ES,children:[S(Vg,{showIcon:!1,onClick:()=>{t.close()}}),S(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>S(yu,{disabled:On(e),showIcon:!1,textContent:"Merge"})})]})]})}function MS({bankAccount:e}){return S(Mh,{children:P(Cs,{placement:"right-start",modal:!0,children:[S(Es,{children:e=>P(Wh,{...e,children:[S(Sd,{Component:FT}),S(Aa,{children:"Merge Account"})]})}),S(Tx,{children:S(Ax,{children:S(Ix,{children:S(DS,{account:e})})})})]})})}const LS=Ut({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"left",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discreet"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discreet.hover"}}}),OS=({tranStartDate:e})=>P(N,{children:[S(Ia,{children:"Start Date"}),Vn(e)?S(Aa,{children:`${Rn(An(e))}`}):S(Aa,{children:"Set Start Date"})]});function FS({bankAccount:e}){return P(Cs,{placement:"right-start",modal:!0,children:[S(Es,{children:t=>S("button",{className:Wt(LS,Ei),...t,type:"button",children:S(OS,{tranStartDate:e.tranStartDate})})}),S(Tx,{children:S(Ax,{children:S(Ix,{width:"sm",children:S(MT,{bankAccounts:[e]})})})})]})}const BS=e=>["accounting/manualJournalEntry",e.id],US=async e=>{const t=e.queryKey,n=t[2].accessToken,r=t[2].environment,a={path:"/accounting/manualJournalEntry?id={id}",pathParams:{id:t[1]},accessToken:n,environment:r};return await zi(a)};function VS({id:e}){return _n({queryKey:BS({id:String($o(e))}),queryFn:US,enabled:Fn(e)})}const WS=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/accounting/manualJournalEntry",bodyParams:{manualJournalEntry:e},accessToken:t,endpointManager:_r(n)};return await qr(r)})({data:e,accessToken:t,environment:n});const HS=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:_r(n)};return await qr(r)},qS=h.object({amount:h.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:h.string("Required")}),jS=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===$o(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},zS=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=VS({id:t??null}),r=function(){const{query:{data:e}}=Np();return Fp(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=ru({mutationFn:HS,onSuccess:async()=>{Pr("beginning balance mutation successful, invalidating bank account queries");try{return zn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&Rr({error:e,severity:"error"})}}});const{mutate:o}=ru({onSuccess:async()=>{Pr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([zn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),zn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&Rr({error:e,severity:"error"})}},mutationFn:WS}),i=As(),l=((e,t)=>{const n=jS(e,t);return{amount:Fn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Fn(t?.date)?t.date:""}})(e,n);return Fg({defaultValues:l,validators:{onBlur:qS},onSubmit:l=>{if(i.close(),On(t)||On(n))a({bankAccountId:$o(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(On(e.id))return null;const o={...e,id:e.id},i=a.map(e=>$o(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===$o(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),On(l)?null:(o.transactions?.forEach(e=>{i.includes(e.glAccountId)&&(e.drAmount?e.drAmount=Number(e.drAmount)-l:e.crAmount&&(e.crAmount=Number(e.crAmount)-l))}),o.date=En(t)??o.date,o)})(n,An(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Fn(t)&&o(t)}}})},KS=Ut({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),YS=Ut({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function _S({bankAccount:e}){const t=zS(e),n=As(),r=()=>{n.close()};return P("form",{className:KS,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[S(Aa,{children:"Set Beginning Balance"}),S(t.AppField,{name:"date",children:e=>S(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),S(t.AppField,{name:"amount",children:e=>S(e.EditableAmountField,{label:"Beginning Balance Amount"})}),S(t.Subscribe,{selector:e=>e,children:e=>P("div",{className:YS,children:[S(Vg,{showIcon:!1,onClick:r}),S(yu,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const ZS=qt({base:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"right",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discreet"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discreet.hover"}}},variants:{layout:{left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}}}}),GS=Ut({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function QS({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=Wt(ZS({layout:a}),Ei),i=Wt(ZS({layout:"right"}),Ei),l=r&&Rn(r);return P(Cs,{placement:"right-start",modal:!0,children:[S(Es,{children:e=>P("div",{className:GS,children:[P("button",{className:o,...e,type:"button",children:[S(Ia,{children:"Beginning Balance"}),S(Aa,{children:Fn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&P("button",{className:i,...e,type:"button",children:[S(Ia,{children:"Migration Date"}),S(Aa,{children:l})]})]})}),S(Tx,{children:S(Ax,{children:S(Ix,{width:"sm",children:S(_S,{bankAccount:e})})})})]})}const XS=qt({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function JS({bankAccount:e,showStartDate:t}){const{query:{data:n}}=VS({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=jS(e,n),a=Fn(n?.date)?An(n?.date):null,o=Fn(e.tranStartDate)?An(e.tranStartDate):null,i=Fn(a)&&Fn(o)&&!yn(a,o),l=i?"left":t?"right":"left";return P("div",{className:XS({layout:i?"stacked":"inline"}),children:[t&&S(FS,{bankAccount:e}),S(QS,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const $S=Ut({marginTop:"15px",marginBottom:"15px"}),eN={id:"",name:"",mask:"",type:void 0};const tN=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],nN=e=>{Pu(e),Ru(e)};function rN({bankAccountId:e}){const t=oi(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:eN,[r,a]=y(n),o=function(e,t){const{mutate:n}=cu(),{mutateAsync:r}=su({mutationFn:ou}),a=Vn(String(e.id));return Fg({defaultValues:e,validators:{onBlur:fS},onSubmit:async e=>{if(a)n(ri(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const n=await r((o=e.value,{apiAccountName:o.name,apiAccountNo:o.mask,apiAccountType:o.type||"DEPOSITORY",duplicateBankAccountIds:[]})),a={id:Jo({id:n?.dataObject?.id,prefix:"BANK_ACCOUNT"}),name:n?.dataObject?.apiAccountName??"",mask:n?.dataObject?.apiAccountNo??"",type:e.value.type};t(a),e.formApi.reset(a,{keepDefaultValues:!0})}var o},onSubmitInvalid:()=>{}})}(r,a),i=!t||ei(t.apiName),l=!!t&&ti(t.apiName),s=Go(r?.name??"",r?.mask??""),c=Vn(s)?s:"New Bank Account",d=l&&Fn(t?.tranStartDate),u=Fn(t)&&(d||!0);return S(BC,{children:S(HC,{children:P("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:nN,children:[P(ZA,{children:[P(hT,{children:[S(mT,{Icon:wi}),S(Aa,{children:c}),Fn(t)&&S(AT,{shouldUseButtonDiscreteStyles:!0,children:S(MS,{bankAccount:t})})]}),S(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:S(o.SaveButton,{})})]}),P(XA,{children:[S(o.AppField,{name:"name",children:e=>S(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),S(o.AppField,{name:"mask",children:e=>S(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),S(o.AppField,{name:"type",children:e=>S(e.GenericSelectorField,{label:"Account Type",options:tN,disabled:!i})}),u&&P(N,{children:[S("div",{className:$S,children:S(tg,{alignment:"horizontal"})}),S(JS,{bankAccount:t,showStartDate:d})]})]})]})})})}function aN(){return P(MC,{children:[S(OC,{name:"BankTransactionFormRouter",Component:YI}),S(OC,{name:"Conversation",Component:eS}),S(OC,{name:"MobileConversation",Component:iS}),S(OC,{name:"FinancialSummary",Component:vS}),S(OC,{name:"BanksAndIntegrations",Component:bS}),S(OC,{name:"BankAccountForm",Component:rN}),S(OC,{name:"NewConnection",Component:lS})]})}const oN=({environment:e,children:t})=>S(Kn.Provider,{value:e,children:t});function iN({children:e}){const{query:{data:t}}=Cy(),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Jo({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName,clientId:t?.clientId,useStripeInvoicePaymentProcessing:t?.useStripeInvoicePaymentProcessing,hasPayroll:t?.hasPayroll,hasShopify:t?.hasShopify,hasSquare:t?.hasSquare,unitIntegrationBankName:t?.unitIntegrationBankName??null};return S(Qs.Provider,{value:n,children:e})}const lN=e=>["whiteLabels",e??{}],sN=async e=>{const t=e.queryKey,n={path:"/v6/whiteLabels/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ao(t[3].environment)},r=await Hr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function cN({children:e}){const t=ky(),{query:{data:n}}=Oo({queryKey:lN({filter:{name:{equal:t}}}),queryFn:sN}),r={icons:n?.data?.[0]?.icons};return S(xi.Provider,{value:r,children:e})}const dN=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const uN="SSE connection failed with status";function hN({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Yn();k(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Yr[o]}/sse/v1/subscribe`);var o;return a.searchParams.append("customerPartnerId",n),t.forEach(e=>a.searchParams.append("events",e)),r&&a.searchParams.append("companyId",r),a.toString()}(r,n,t,e);let i=0;return Ie(o,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${uN} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case dN.CONNECTED:return void Pr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case dN.ERROR:throw Rr({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case dN.CACHE_BUST:return Pr("cache bust event received",{sseTypes:JSON.stringify(Array.from(r))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{zn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>Rr({error:e,severity:"error"}))},500*Math.random()),Pr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void Rr({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:a.event,data:a.data,env:r,sseTypes:n,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw Rr({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(uN))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>Rr({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const pN=[dN.CACHE_BUST];function gN({children:e}){const{companyId:t,customerPartnerId:n}=b(Qs);return hN({companyId:t,customerPartnerId:n,sseTypes:pN}),e}const mN="undefined"!=typeof window?E:k,vN="undefined"==typeof window;const bN=({children:e})=>{const{width:t,height:n}=function(e={}){let{initializeWithValue:t=!0}=e;vN&&(t=!1);const[n,r]=y(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=ox(r,e.debounceDelay,{leading:!0});function o(){(e.debounceDelay?a:r)({width:window.innerWidth,height:window.innerHeight})}return function(e,t,n,r){const a=g(t);mN(()=>{a.current=t},[t]),k(()=>{const t=window;if(!t||!t.addEventListener)return;const n=e=>{a.current(e)};return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}},[e,void 0,r])}("resize",o),mN(()=>{o()},[]),n}({debounceDelay:150}),r={dimensions:{width:t,height:n}};return S(uf.Provider,{value:r,children:e})};function fN({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return k(()=>{var e,r;e=n,r=t,Ar.setProperties(Sr),Ir=r,Er=e},[n,t]),S(oN,{environment:t,children:S(IC,{children:S(Wn.Provider,{value:r,children:S(iN,{children:S(cN,{children:S(gN,{children:P(bN,{children:[S(fe.ConfirmationRoot,{}),e,S(aN,{})]})})})})})})})}export{CC as BanksAndIntegrations,by as BusinessOwnerDashboard,fN as Tight,dT as TransactionsDashboard,st as useOptions};
2
2
  //# sourceMappingURL=index.js.map