@accounter/client 0.0.8-alpha-20251023071148-6bed0891f04559f888e1e0d8bb275809dc36bf3b → 0.0.8-alpha-20251023071611-4357687c6963ad74c80f62140eb0de9252d7bca7

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/assets/{Checkbox-lfqFDKZM.js → Checkbox-iZ--iyJF.js} +2 -2
  3. package/dist/assets/{Progress-DvGsu87E.js → Progress-CSjfE5bV.js} +1 -1
  4. package/dist/assets/{Typography-BX4mj53o.js → Typography-D14P1nN1.js} +1 -1
  5. package/dist/assets/{accordion-lOk81yKP.js → accordion-CcwG2M8I.js} +1 -1
  6. package/dist/assets/accountant-approvals-3mWk2IJb.js +1 -0
  7. package/dist/assets/{all-charges-DhPxcK73.js → all-charges-kAC8rw9C.js} +1 -1
  8. package/dist/assets/{arrow-up-down-CFrneqND.js → arrow-up-down-BS_znu7y.js} +1 -1
  9. package/dist/assets/business-Cv0e_Q3p.js +42 -0
  10. package/dist/assets/{business-transactions-single-CJ5pLN-D.js → business-transactions-single-B23INPyA.js} +1 -1
  11. package/dist/assets/{business-trip-Jlc0bfXC.js → business-trip-c4pY18e_.js} +1 -1
  12. package/dist/assets/charges-filters-DaVBQ_jS.js +1 -0
  13. package/dist/assets/{charges-ledger-validation-Bln73m_U.js → charges-ledger-validation-DZtDlOTx.js} +1 -1
  14. package/dist/assets/{chart-Wut6cPCx.js → chart-BgPuhGqj.js} +1 -1
  15. package/dist/assets/{data-table-pagination-BnQGVnmE.js → data-table-pagination-P75qqcV4.js} +1 -1
  16. package/dist/assets/{editable-business-trip-CjJg13b0.js → editable-business-trip-80Bf0nf4.js} +2 -2
  17. package/dist/assets/{index-y8Z-aJKc.js → index-1yUzw9-e.js} +2 -2
  18. package/dist/assets/index-ASrM5c3z.js +1 -0
  19. package/dist/assets/{index-C2INIVq3.js → index-BIiK-vW-.js} +1 -1
  20. package/dist/assets/index-BUJZ6CG6.js +1 -0
  21. package/dist/assets/{index-BagyRbeI.js → index-BopVOgtm.js} +2 -2
  22. package/dist/assets/index-Bt1Iynf-.js +1 -0
  23. package/dist/assets/index-BtF8NkXw.js +1 -0
  24. package/dist/assets/index-Buu6jU2e.js +1 -0
  25. package/dist/assets/{index-BoSqeUi7.js → index-BwJkbwi9.js} +6 -6
  26. package/dist/assets/index-CNBPVFd1.js +1 -0
  27. package/dist/assets/index-Cca4zCek.js +1 -0
  28. package/dist/assets/index-CgVLV78R.js +1 -0
  29. package/dist/assets/index-CmRugx3-.js +1 -0
  30. package/dist/assets/index-CzzfC-dD.css +1 -0
  31. package/dist/assets/index-D-K_l8g8.js +9 -0
  32. package/dist/assets/{index-BX3VSsge.js → index-D0eVaZI5.js} +1 -1
  33. package/dist/assets/{index-CVz9TqoS.js → index-D3y74IdY.js} +2 -2
  34. package/dist/assets/{index-DquDHLbE.js → index-D7rFUnXc.js} +1 -1
  35. package/dist/assets/{index-DjSJrgv5.js → index-DUDlwA28.js} +2 -2
  36. package/dist/assets/index-DWdQvLZN.js +1 -0
  37. package/dist/assets/{index-Csqyxwgx.js → index-DfYVR_1G.js} +2 -2
  38. package/dist/assets/index-DmBjrSud.js +1 -0
  39. package/dist/assets/index-Ucx6U5YY.js +1 -0
  40. package/dist/assets/{index-CN7VPpiB.js → index-iLt1WIM9.js} +65 -65
  41. package/dist/assets/{index.es-D8leRAY2.js → index.es-VMf2fRct.js} +1 -1
  42. package/dist/assets/{issue-document-DKE0dzdE.js → issue-document-BustWthK.js} +1 -1
  43. package/dist/assets/login-page-DbBOFdaj.js +1 -0
  44. package/dist/assets/{missing-info-charges-CgMJ4Bu3.js → missing-info-charges-sf4ZGQoC.js} +1 -1
  45. package/dist/assets/page-not-found-CzE13z4R.js +1 -0
  46. package/dist/assets/{pencil-CUSCcyVn.js → pencil-1-tPx_Bq.js} +1 -1
  47. package/dist/assets/report-commentary-row-BqTwvfOv.js +1 -0
  48. package/dist/assets/save-CMGkGXCM.js +11 -0
  49. package/dist/assets/similar-charges-by-business-modal-Dj7iCQhJ.js +1 -0
  50. package/dist/assets/sub-3l-gAINS.js +1 -0
  51. package/dist/assets/subMonths-LVothVpu.js +1 -0
  52. package/dist/index.html +2 -2
  53. package/package.json +1 -1
  54. package/src/components/business/business-header.tsx +2 -21
  55. package/src/components/businesses/all-businesses-row.tsx +87 -0
  56. package/src/components/businesses/cells/hebrew-name.tsx +31 -0
  57. package/src/components/businesses/cells/index.ts +2 -0
  58. package/src/components/businesses/cells/name.tsx +31 -0
  59. package/src/components/businesses/index.tsx +36 -45
  60. package/src/components/common/forms/business-card.tsx +234 -0
  61. package/src/components/common/forms/index.ts +1 -0
  62. package/src/gql/gql.ts +30 -6
  63. package/src/gql/graphql.ts +30 -7
  64. package/src/providers/urql-client.ts +26 -0
  65. package/src/providers/urql.tsx +32 -0
  66. package/src/router/loaders/business-loader.ts +2 -4
  67. package/src/router/loaders/charge-loader.ts +2 -4
  68. package/dist/assets/accountant-approvals-DWLEu1Um.js +0 -1
  69. package/dist/assets/building-2-Bqvbwz7Q.js +0 -6
  70. package/dist/assets/business--eNnF4xF.js +0 -42
  71. package/dist/assets/business-header-DjutqTRC.js +0 -1
  72. package/dist/assets/charges-filters-C-H07qp1.js +0 -1
  73. package/dist/assets/index-BE5nnZYY.js +0 -9
  74. package/dist/assets/index-BQrSA2Kk.js +0 -1
  75. package/dist/assets/index-BkeJsHyM.js +0 -1
  76. package/dist/assets/index-BtAgm6J8.js +0 -1
  77. package/dist/assets/index-BwIQ8ifH.js +0 -1
  78. package/dist/assets/index-Bxlzprxi.js +0 -1
  79. package/dist/assets/index-C--YkrHw.js +0 -1
  80. package/dist/assets/index-CQXFj3Uj.css +0 -1
  81. package/dist/assets/index-CalcGztb.js +0 -1
  82. package/dist/assets/index-Dr2UkUOm.js +0 -1
  83. package/dist/assets/index-E2rO9Bsf.js +0 -1
  84. package/dist/assets/index-Ggixi4PP.js +0 -1
  85. package/dist/assets/index-WCosiqtQ.js +0 -1
  86. package/dist/assets/index-vsZbkVMv.js +0 -1
  87. package/dist/assets/login-page-BYwtRBMd.js +0 -1
  88. package/dist/assets/page-not-found-Cfte6bjZ.js +0 -1
  89. package/dist/assets/report-commentary-row-B-uxVnyO.js +0 -1
  90. package/dist/assets/save-qyt28nOG.js +0 -6
  91. package/dist/assets/sub-LLu8afpC.js +0 -1
  92. package/dist/assets/subMonths-C1UIPrOU.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @accounter/client
2
2
 
3
- ## 0.0.8-alpha-20251023071148-6bed0891f04559f888e1e0d8bb275809dc36bf3b
3
+ ## 0.0.8-alpha-20251023071611-4357687c6963ad74c80f62140eb0de9252d7bca7
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -146,6 +146,21 @@
146
146
  added to the transactions table. It will only appear if either `enableEdit` or
147
147
  `enableChargeLink` props are true, making the table more dynamic and adaptable.
148
148
 
149
+ - [#2609](https://github.com/Urigo/accounter-fullstack/pull/2609)
150
+ [`4357687`](https://github.com/Urigo/accounter-fullstack/commit/4357687c6963ad74c80f62140eb0de9252d7bca7)
151
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Centralized Error Handling**:
152
+ Implemented a centralized approach to handle GraphQL network and operation errors within the URQL
153
+ client configuration, ensuring consistent error feedback across the application.
154
+ - **User-Friendly Notifications**: Integrated the `sonner` toast library to display clear and
155
+ concise toast notifications for network connectivity issues and general GraphQL operation
156
+ failures, improving the user experience.
157
+ - **Refined Data Loader Logic**: Simplified data loaders by removing generic GraphQL error checks,
158
+ allowing them to focus on specific application-level errors (e.g., 404 Not Found) that should
159
+ trigger error boundaries, while other errors are handled by the new toast system.
160
+ - **Authentication Error Prioritization**: Ensured that authentication-related GraphQL errors
161
+ (e.g., `FORBIDDEN`) continue to trigger navigation to the login page, with these errors
162
+ explicitly skipped by the new toast notification system to avoid redundant alerts.
163
+
149
164
  - [#2582](https://github.com/Urigo/accounter-fullstack/pull/2582)
150
165
  [`32276b4`](https://github.com/Urigo/accounter-fullstack/commit/32276b47e164f0976fcdd5523fa5e26f0704014f)
151
166
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Business/Client Page**: Introduced
@@ -1,6 +1,6 @@
1
- import{z as fr,r as w,bD as Q,eC as ur,ag as t,eD as R,bB as X,bC as D,bE as n,eE as z,bF as I,eF as _r,eG as vr,eH as br}from"./index-CN7VPpiB.js";/**
1
+ import{V as fr,r as w,bJ as Q,eF as ur,aj as t,eG as R,bH as X,bI as V,bK as n,eH as I,bL as z,eI as _r,eJ as vr,eK as br}from"./index-iLt1WIM9.js";/**
2
2
  * @license lucide-react v0.546.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const yr=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],Yr=fr("merge",yr),Z=w.createContext(null),mr=Z.Provider,gr=()=>w.useContext(Z);var Pr=Object.defineProperty,h=Object.getOwnPropertySymbols,rr=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,M=(r,e,a)=>e in r?Pr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,W=(r,e)=>{for(var a in e||(e={}))rr.call(e,a)&&M(r,a,e[a]);if(h)for(var a of h(e))er.call(e,a)&&M(r,a,e[a]);return r},Or=(r,e)=>{var a={};for(var o in r)rr.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&h)for(var o of h(r))e.indexOf(o)<0&&er.call(r,o)&&(a[o]=r[o]);return a};const wr={size:"sm"},ar=w.forwardRef((r,e)=>{const a=Q("CheckboxGroup",wr,r),{children:o,value:f,defaultValue:u,onChange:i,size:c,wrapperProps:s}=a,d=Or(a,["children","value","defaultValue","onChange","size","wrapperProps"]),[l,y]=ur({value:f,defaultValue:u,finalValue:[],onChange:i}),m=_=>{const v=_.currentTarget.value;y(l.includes(v)?l.filter($=>$!==v):[...l,v])};return t.createElement(mr,{value:{value:l,onChange:m,size:c}},t.createElement(R.Wrapper,W(W({labelElement:"div",size:c,__staticSelector:"CheckboxGroup",ref:e},s),d),o))});ar.displayName="@mantine/core/CheckboxGroup";var $r=Object.defineProperty,xr=Object.defineProperties,hr=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Sr=Object.prototype.propertyIsEnumerable,B=(r,e,a)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Y=(r,e)=>{for(var a in e||(e={}))kr.call(e,a)&&B(r,a,e[a]);if(H)for(var a of H(e))Sr.call(e,a)&&B(r,a,e[a]);return r},U=(r,e)=>xr(r,hr(e));const Cr={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Er=X((r,{radius:e,color:a,transitionDuration:o,labelPosition:f,error:u,indeterminate:i},{size:c})=>{const s=D({size:c,sizes:Cr}),d=r.fn.variant({variant:"filled",color:a});return{icon:U(Y({},r.fn.cover()),{ref:z("icon"),color:i?"inherit":r.white,transform:i?"none":`translateY(${n(5)}) scale(0.5)`,opacity:i?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${o}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:r.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:s,height:s,order:f==="left"?2:1},input:U(Y({},r.fn.focusStyles()),{appearance:"none",backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white,border:`${n(1)} solid ${u?r.fn.variant({variant:"filled",color:"red"}).background:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[4]}`,width:s,height:s,borderRadius:r.fn.radius(e),padding:0,display:"block",margin:0,transition:`border-color ${o}ms ease, background-color ${o}ms ease`,cursor:r.cursorType,"&:checked":{backgroundColor:d.background,borderColor:d.background,[`& + .${z("icon")}`]:{opacity:1,color:r.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[2],borderColor:r.colorScheme==="dark"?r.colors.dark[6]:r.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${z("icon")}`]:{color:r.colorScheme==="dark"?r.colors.dark[6]:r.colors.gray[5]}}})}}),Nr=Object.defineProperty,zr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable,A=(r,e,a)=>e in r?Nr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Dr=(r,e)=>{for(var a in e||(e={}))jr.call(e,a)&&A(r,a,e[a]);if(q)for(var a of q(e))Rr.call(e,a)&&A(r,a,e[a]);return r},Vr=(r,e)=>zr(r,Ir(e));const j={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Gr=X((r,{labelPosition:e},{size:a})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]}},labelWrapper:Vr(Dr({},r.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:a in j?D({size:a,sizes:r.fontSizes}):void 0,lineHeight:a in j?D({size:a,sizes:j}):void 0,color:r.colorScheme==="dark"?r.colors.dark[0]:r.black,cursor:r.cursorType,order:e==="left"?1:2}),description:{marginTop:`calc(${r.spacing.xs} / 2)`,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm},error:{marginTop:`calc(${r.spacing.xs} / 2)`,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm},label:{cursor:r.cursorType,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm,"&:disabled, &[data-disabled]":{color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]}}})),Tr=Object.defineProperty,k=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,J=(r,e,a)=>e in r?Tr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Fr=(r,e)=>{for(var a in e||(e={}))or.call(e,a)&&J(r,a,e[a]);if(k)for(var a of k(e))tr.call(e,a)&&J(r,a,e[a]);return r},Lr=(r,e)=>{var a={};for(var o in r)or.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&k)for(var o of k(r))e.indexOf(o)<0&&tr.call(r,o)&&(a[o]=r[o]);return a};const nr=w.forwardRef((r,e)=>{var a=r,{__staticSelector:o,className:f,classNames:u,styles:i,unstyled:c,children:s,label:d,description:l,id:y,disabled:m,error:_,size:v,labelPosition:$,bodyElement:g="div",labelElement:P="label",variant:C}=a,E=Lr(a,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","bodyElement","labelElement","variant"]);const{classes:p,cx:O}=Gr({labelPosition:$},{name:o,styles:i,classNames:u,unstyled:c,variant:C,size:v});return t.createElement(I,Fr({className:O(p.root,f),ref:e},E),t.createElement(I,{component:g,htmlFor:g==="label"?y:void 0,className:O(p.body)},s,t.createElement("div",{className:p.labelWrapper},d!=null&&t.createElement(I,{component:P,htmlFor:P==="label"?y:void 0,className:p.label,"data-disabled":m||void 0},d),l&&t.createElement(R.Description,{className:p.description},l),_&&_!=="boolean"&&t.createElement(R.Error,{className:p.error},_))))});nr.displayName="@mantine/core/InlineInput";var Mr=Object.defineProperty,S=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,K=(r,e,a)=>e in r?Mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,x=(r,e)=>{for(var a in e||(e={}))sr.call(e,a)&&K(r,a,e[a]);if(S)for(var a of S(e))lr.call(e,a)&&K(r,a,e[a]);return r},Wr=(r,e)=>{var a={};for(var o in r)sr.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&S)for(var o of S(r))e.indexOf(o)<0&&lr.call(r,o)&&(a[o]=r[o]);return a};const Hr={size:"sm",transitionDuration:100,icon:_r,labelPosition:"right"},ir=w.forwardRef((r,e)=>{const a=Q("Checkbox",Hr,r),{className:o,style:f,sx:u,checked:i,disabled:c,color:s,label:d,indeterminate:l,id:y,size:m,radius:_,wrapperProps:v,children:$,classNames:g,styles:P,transitionDuration:C,icon:E,unstyled:p,labelPosition:O,description:cr,error:V,variant:G}=a,dr=Wr(a,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),b=gr(),T=vr(y),{systemStyles:pr,rest:F}=br(dr),{classes:N}=Er({radius:_,color:s,transitionDuration:C,labelPosition:O,error:!!V,indeterminate:l},{name:"Checkbox",classNames:g,styles:P,unstyled:p,variant:G,size:b?.size||m}),L=b?{checked:b.value.includes(F.value),onChange:b.onChange}:{};return t.createElement(nr,x(x({className:o,sx:u,style:f,id:T,size:b?.size||m,labelPosition:O,label:d,description:cr,error:V,disabled:c,__staticSelector:"Checkbox",classNames:g,styles:P,unstyled:p,"data-checked":L.checked||void 0,variant:G},pr),v),t.createElement("div",{className:N.inner},t.createElement("input",x(x({id:T,ref:e,type:"checkbox",className:N.input,checked:i,disabled:c},F),L)),t.createElement(E,{indeterminate:l,className:N.icon})))});ir.displayName="@mantine/core/Checkbox";ir.Group=ar;export{ir as C,Yr as M};
6
+ */const yr=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],Kr=fr("merge",yr),Z=w.createContext(null),mr=Z.Provider,gr=()=>w.useContext(Z);var Pr=Object.defineProperty,h=Object.getOwnPropertySymbols,rr=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,H=(r,e,a)=>e in r?Pr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,M=(r,e)=>{for(var a in e||(e={}))rr.call(e,a)&&H(r,a,e[a]);if(h)for(var a of h(e))er.call(e,a)&&H(r,a,e[a]);return r},Or=(r,e)=>{var a={};for(var o in r)rr.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&h)for(var o of h(r))e.indexOf(o)<0&&er.call(r,o)&&(a[o]=r[o]);return a};const wr={size:"sm"},ar=w.forwardRef((r,e)=>{const a=Q("CheckboxGroup",wr,r),{children:o,value:f,defaultValue:u,onChange:i,size:c,wrapperProps:s}=a,d=Or(a,["children","value","defaultValue","onChange","size","wrapperProps"]),[l,y]=ur({value:f,defaultValue:u,finalValue:[],onChange:i}),m=_=>{const v=_.currentTarget.value;y(l.includes(v)?l.filter($=>$!==v):[...l,v])};return t.createElement(mr,{value:{value:l,onChange:m,size:c}},t.createElement(R.Wrapper,M(M({labelElement:"div",size:c,__staticSelector:"CheckboxGroup",ref:e},s),d),o))});ar.displayName="@mantine/core/CheckboxGroup";var $r=Object.defineProperty,xr=Object.defineProperties,hr=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Sr=Object.prototype.propertyIsEnumerable,J=(r,e,a)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,K=(r,e)=>{for(var a in e||(e={}))kr.call(e,a)&&J(r,a,e[a]);if(W)for(var a of W(e))Sr.call(e,a)&&J(r,a,e[a]);return r},Y=(r,e)=>xr(r,hr(e));const Cr={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Er=X((r,{radius:e,color:a,transitionDuration:o,labelPosition:f,error:u,indeterminate:i},{size:c})=>{const s=V({size:c,sizes:Cr}),d=r.fn.variant({variant:"filled",color:a});return{icon:Y(K({},r.fn.cover()),{ref:I("icon"),color:i?"inherit":r.white,transform:i?"none":`translateY(${n(5)}) scale(0.5)`,opacity:i?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${o}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:r.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:s,height:s,order:f==="left"?2:1},input:Y(K({},r.fn.focusStyles()),{appearance:"none",backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white,border:`${n(1)} solid ${u?r.fn.variant({variant:"filled",color:"red"}).background:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[4]}`,width:s,height:s,borderRadius:r.fn.radius(e),padding:0,display:"block",margin:0,transition:`border-color ${o}ms ease, background-color ${o}ms ease`,cursor:r.cursorType,"&:checked":{backgroundColor:d.background,borderColor:d.background,[`& + .${I("icon")}`]:{opacity:1,color:r.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[2],borderColor:r.colorScheme==="dark"?r.colors.dark[6]:r.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${I("icon")}`]:{color:r.colorScheme==="dark"?r.colors.dark[6]:r.colors.gray[5]}}})}}),Nr=Object.defineProperty,Ir=Object.defineProperties,zr=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable,U=(r,e,a)=>e in r?Nr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Vr=(r,e)=>{for(var a in e||(e={}))jr.call(e,a)&&U(r,a,e[a]);if(B)for(var a of B(e))Rr.call(e,a)&&U(r,a,e[a]);return r},Dr=(r,e)=>Ir(r,zr(e));const j={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Gr=X((r,{labelPosition:e},{size:a})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]}},labelWrapper:Dr(Vr({},r.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:a in j?V({size:a,sizes:r.fontSizes}):void 0,lineHeight:a in j?V({size:a,sizes:j}):void 0,color:r.colorScheme==="dark"?r.colors.dark[0]:r.black,cursor:r.cursorType,order:e==="left"?1:2}),description:{marginTop:`calc(${r.spacing.xs} / 2)`,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm},error:{marginTop:`calc(${r.spacing.xs} / 2)`,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm},label:{cursor:r.cursorType,[e==="left"?"paddingRight":"paddingLeft"]:r.spacing.sm,"&:disabled, &[data-disabled]":{color:r.colorScheme==="dark"?r.colors.dark[3]:r.colors.gray[5]}}})),Tr=Object.defineProperty,k=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,q=(r,e,a)=>e in r?Tr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,Lr=(r,e)=>{for(var a in e||(e={}))or.call(e,a)&&q(r,a,e[a]);if(k)for(var a of k(e))tr.call(e,a)&&q(r,a,e[a]);return r},Fr=(r,e)=>{var a={};for(var o in r)or.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&k)for(var o of k(r))e.indexOf(o)<0&&tr.call(r,o)&&(a[o]=r[o]);return a};const nr=w.forwardRef((r,e)=>{var a=r,{__staticSelector:o,className:f,classNames:u,styles:i,unstyled:c,children:s,label:d,description:l,id:y,disabled:m,error:_,size:v,labelPosition:$,bodyElement:g="div",labelElement:P="label",variant:C}=a,E=Fr(a,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","bodyElement","labelElement","variant"]);const{classes:p,cx:O}=Gr({labelPosition:$},{name:o,styles:i,classNames:u,unstyled:c,variant:C,size:v});return t.createElement(z,Lr({className:O(p.root,f),ref:e},E),t.createElement(z,{component:g,htmlFor:g==="label"?y:void 0,className:O(p.body)},s,t.createElement("div",{className:p.labelWrapper},d!=null&&t.createElement(z,{component:P,htmlFor:P==="label"?y:void 0,className:p.label,"data-disabled":m||void 0},d),l&&t.createElement(R.Description,{className:p.description},l),_&&_!=="boolean"&&t.createElement(R.Error,{className:p.error},_))))});nr.displayName="@mantine/core/InlineInput";var Hr=Object.defineProperty,S=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,A=(r,e,a)=>e in r?Hr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,x=(r,e)=>{for(var a in e||(e={}))sr.call(e,a)&&A(r,a,e[a]);if(S)for(var a of S(e))lr.call(e,a)&&A(r,a,e[a]);return r},Mr=(r,e)=>{var a={};for(var o in r)sr.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&S)for(var o of S(r))e.indexOf(o)<0&&lr.call(r,o)&&(a[o]=r[o]);return a};const Wr={size:"sm",transitionDuration:100,icon:_r,labelPosition:"right"},ir=w.forwardRef((r,e)=>{const a=Q("Checkbox",Wr,r),{className:o,style:f,sx:u,checked:i,disabled:c,color:s,label:d,indeterminate:l,id:y,size:m,radius:_,wrapperProps:v,children:$,classNames:g,styles:P,transitionDuration:C,icon:E,unstyled:p,labelPosition:O,description:cr,error:D,variant:G}=a,dr=Mr(a,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),b=gr(),T=vr(y),{systemStyles:pr,rest:L}=br(dr),{classes:N}=Er({radius:_,color:s,transitionDuration:C,labelPosition:O,error:!!D,indeterminate:l},{name:"Checkbox",classNames:g,styles:P,unstyled:p,variant:G,size:b?.size||m}),F=b?{checked:b.value.includes(L.value),onChange:b.onChange}:{};return t.createElement(nr,x(x({className:o,sx:u,style:f,id:T,size:b?.size||m,labelPosition:O,label:d,description:cr,error:D,disabled:c,__staticSelector:"Checkbox",classNames:g,styles:P,unstyled:p,"data-checked":F.checked||void 0,variant:G},pr),v),t.createElement("div",{className:N.inner},t.createElement("input",x(x({id:T,ref:e,type:"checkbox",className:N.input,checked:i,disabled:c},L),F)),t.createElement(E,{indeterminate:l,className:N.icon})))});ir.displayName="@mantine/core/Checkbox";ir.Group=ar;export{ir as C,Kr as M};
@@ -1 +1 @@
1
- import{bB as W,bC as _,bE as o,dU as Y,r as q,bD as G,ag as s,T as H,bF as w,bY as O}from"./index-CN7VPpiB.js";const k={xs:o(3),sm:o(5),md:o(8),lg:o(12),xl:o(16)},J=Y({from:{backgroundPosition:"0 0"},to:{backgroundPosition:`${o(40)} 0`}});var K=W((a,{color:r,radius:e},{size:t})=>({root:{position:"relative",height:_({size:t,sizes:k}),backgroundColor:a.colorScheme==="dark"?a.colors.dark[4]:a.colors.gray[2],borderRadius:a.fn.radius(e),overflow:"hidden"},bar:{position:"absolute",top:0,bottom:0,left:0,height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:a.fn.variant({variant:"filled",primaryFallback:!1,color:r||a.primaryColor}).background,transition:"width 100ms linear","&[data-animate]":{animation:`${J} 1000ms linear infinite`},"&[data-striped]":{backgroundSize:`${o(20)} ${o(20)}`,backgroundImage:"linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)"},"&:last-of-type":{borderTopRightRadius:a.fn.radius(e),borderBottomRightRadius:a.fn.radius(e)},"&:first-of-type":{borderTopLeftRadius:a.fn.radius(e),borderBottomLeftRadius:a.fn.radius(e)},"@media (prefers-reduced-motion)":{transitionDuration:a.respectReducedMotion?"0ms":void 0}},label:{color:a.white,fontSize:`calc(${_({size:t,sizes:k})} * 0.65)`,fontWeight:700,userSelect:"none",overflow:"hidden",whiteSpace:"nowrap"}})),Q=Object.defineProperty,X=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,N=(a,r,e)=>r in a?Q(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,d=(a,r)=>{for(var e in r||(r={}))R.call(r,e)&&N(a,e,r[e]);if(n)for(var e of n(r))S.call(r,e)&&N(a,e,r[e]);return a},C=(a,r)=>X(a,Z(r)),x=(a,r)=>{var e={};for(var t in a)R.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&n)for(var t of n(a))r.indexOf(t)<0&&S.call(a,t)&&(e[t]=a[t]);return e};function aa(a){return a.reduce((r,e)=>(r.sections.push(C(d({},e),{accumulated:r.accumulated})),r.accumulated+=e.value,r),{accumulated:0,sections:[]}).sections}const ea={size:"md",radius:"sm",striped:!1,animate:!1,label:""},ra=q.forwardRef((a,r)=>{const e=G("Progress",ea,a),{className:t,value:c,color:E,size:h,radius:$,striped:u,animate:i,label:m,"aria-label":j,classNames:z,styles:D,sections:p,unstyled:T,variant:B}=e,F=x(e,["className","value","color","size","radius","striped","animate","label","aria-label","classNames","styles","sections","unstyled","variant"]),{classes:l,cx:f,theme:b}=K({color:E,radius:$},{name:"Progress",classNames:z,styles:D,unstyled:T,variant:B,size:h}),I=Array.isArray(p)?aa(p).map((L,A)=>{var v=L,{tooltip:g,accumulated:V,value:M,label:y,color:U}=v,P=x(v,["tooltip","accumulated","value","label","color"]);return s.createElement(H.Floating,{label:g,disabled:!g,key:A},s.createElement(w,C(d({},P),{className:f(l.bar,P.className),"data-striped":u||i||void 0,"data-animate":i||void 0,sx:{width:`${M}%`,left:`${V}%`,backgroundColor:b.fn.variant({variant:"filled",primaryFallback:!1,color:U||b.primaryColor}).background}}),y&&s.createElement(O,{className:l.label},y)))}):null;return s.createElement(w,d({className:f(l.root,t),ref:r},F),I||s.createElement("div",{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-label":j,className:l.bar,style:{width:`${c}%`},"data-striped":u||i||void 0,"data-animate":i||void 0},m?s.createElement(O,{className:l.label},m):""))});ra.displayName="@mantine/core/Progress";export{ra as P};
1
+ import{bH as K,bI as _,bK as o,dZ as M,r as W,bJ as Z,aj as s,T as q,bL as w,c2 as O}from"./index-iLt1WIM9.js";const k={xs:o(3),sm:o(5),md:o(8),lg:o(12),xl:o(16)},G=M({from:{backgroundPosition:"0 0"},to:{backgroundPosition:`${o(40)} 0`}});var Q=K((a,{color:r,radius:e},{size:t})=>({root:{position:"relative",height:_({size:t,sizes:k}),backgroundColor:a.colorScheme==="dark"?a.colors.dark[4]:a.colors.gray[2],borderRadius:a.fn.radius(e),overflow:"hidden"},bar:{position:"absolute",top:0,bottom:0,left:0,height:"100%",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:a.fn.variant({variant:"filled",primaryFallback:!1,color:r||a.primaryColor}).background,transition:"width 100ms linear","&[data-animate]":{animation:`${G} 1000ms linear infinite`},"&[data-striped]":{backgroundSize:`${o(20)} ${o(20)}`,backgroundImage:"linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent)"},"&:last-of-type":{borderTopRightRadius:a.fn.radius(e),borderBottomRightRadius:a.fn.radius(e)},"&:first-of-type":{borderTopLeftRadius:a.fn.radius(e),borderBottomLeftRadius:a.fn.radius(e)},"@media (prefers-reduced-motion)":{transitionDuration:a.respectReducedMotion?"0ms":void 0}},label:{color:a.white,fontSize:`calc(${_({size:t,sizes:k})} * 0.65)`,fontWeight:700,userSelect:"none",overflow:"hidden",whiteSpace:"nowrap"}})),U=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,N=(a,r,e)=>r in a?U(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,c=(a,r)=>{for(var e in r||(r={}))R.call(r,e)&&N(a,e,r[e]);if(n)for(var e of n(r))S.call(r,e)&&N(a,e,r[e]);return a},h=(a,r)=>X(a,Y(r)),x=(a,r)=>{var e={};for(var t in a)R.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&n)for(var t of n(a))r.indexOf(t)<0&&S.call(a,t)&&(e[t]=a[t]);return e};function aa(a){return a.reduce((r,e)=>(r.sections.push(h(c({},e),{accumulated:r.accumulated})),r.accumulated+=e.value,r),{accumulated:0,sections:[]}).sections}const ea={size:"md",radius:"sm",striped:!1,animate:!1,label:""},ra=W.forwardRef((a,r)=>{const e=Z("Progress",ea,a),{className:t,value:d,color:C,size:E,radius:$,striped:u,animate:i,label:m,"aria-label":j,classNames:z,styles:I,sections:p,unstyled:L,variant:T}=e,D=x(e,["className","value","color","size","radius","striped","animate","label","aria-label","classNames","styles","sections","unstyled","variant"]),{classes:l,cx:f,theme:b}=Q({color:C,radius:$},{name:"Progress",classNames:z,styles:I,unstyled:L,variant:T,size:E}),A=Array.isArray(p)?aa(p).map((B,F)=>{var v=B,{tooltip:g,accumulated:V,value:H,label:y,color:J}=v,P=x(v,["tooltip","accumulated","value","label","color"]);return s.createElement(q.Floating,{label:g,disabled:!g,key:F},s.createElement(w,h(c({},P),{className:f(l.bar,P.className),"data-striped":u||i||void 0,"data-animate":i||void 0,sx:{width:`${H}%`,left:`${V}%`,backgroundColor:b.fn.variant({variant:"filled",primaryFallback:!1,color:J||b.primaryColor}).background}}),y&&s.createElement(O,{className:l.label},y)))}):null;return s.createElement(w,c({className:f(l.root,t),ref:r},D),A||s.createElement("div",{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d,"aria-label":j,className:l.bar,style:{width:`${d}%`},"data-striped":u||i||void 0,"data-animate":i||void 0},m?s.createElement(O,{className:l.label},m):""))});ra.displayName="@mantine/core/Progress";export{ra as P};
@@ -1 +1 @@
1
- import{eb as S,ec as K,ed as Q,ee as X,ef as W,eg as Y,d4 as Z,d3 as z,r as A,d8 as N,eh as ee,j as te,ah as re,dV as _}from"./index-CN7VPpiB.js";function ke(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const $=e=>e,ne=()=>{let e=$;return{configure(t){e=t},generate(t){return e(t)},reset(){e=$}}},oe=ne(),se={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function U(e,t,r="Mui"){const n=se[t];return n?`${r}-${n}`:`${oe.generate(e)}-${t}`}function ie(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=U(e,o,r)}),n}function G(e){const{variants:t,...r}=e,n={variants:t,style:S(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=S(o.style))}),n}const ae=K();function F(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function g(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function le(e){return e?(t,r)=>r[e]:null}function ue(e,t,r){e.theme=he(e.theme)?r:e.theme[t]||e.theme}function M(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(o=>M(e,o,r));if(Array.isArray(n?.variants)){let o;if(n.isProcessed)o=r?g(n.style,r):n.style;else{const{variants:s,...i}=n;o=r?g(S(i),r):i}return I(e,n.variants,[o],r)}return n?.isProcessed?r?g(S(n.style),r):n.style:r?g(S(n),r):n}function I(e,t,r=[],n=void 0){let o;e:for(let s=0;s<t.length;s+=1){const i=t[s];if(typeof i.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(o))continue}else for(const a in i.props)if(e[a]!==i.props[a]&&e.ownerState?.[a]!==i.props[a])continue e;typeof i.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?g(S(i.style(o)),n):i.style(o))):r.push(n?g(S(i.style),n):i.style)}return r}function ce(e={}){const{themeId:t,defaultTheme:r=ae,rootShouldForwardProp:n=F,slotShouldForwardProp:o=F}=e;function s(a){ue(a,t,r)}return(a,d={})=>{Q(a,u=>u.filter(c=>c!==W));const{name:l,slot:h,skipVariantsResolver:x,skipSx:C,overridesResolver:v=le(ye(h)),...T}=d,w=l&&l.startsWith("Mui")||h?"components":"custom",P=x!==void 0?x:h&&h!=="Root"&&h!=="root"||!1,k=C||!1;let b=F;h==="Root"||h==="root"?b=n:h?b=o:pe(a)&&(b=void 0);const V=X(a,{shouldForwardProp:b,label:fe(),...T}),q=u=>{if(u.__emotion_real===u)return u;if(typeof u=="function")return function(m){return M(m,u,m.theme.modularCssLayers?w:void 0)};if(Y(u)){const c=G(u);return function(y){return c.variants?M(y,c,y.theme.modularCssLayers?w:void 0):y.theme.modularCssLayers?g(c.style,w):c.style}}return u},L=(...u)=>{const c=[],m=u.map(q),y=[];if(c.push(s),l&&v&&y.push(function(f){const p=f.theme.components?.[l]?.styleOverrides;if(!p)return null;const B={};for(const E in p)B[E]=M(f,p[E],f.theme.modularCssLayers?"theme":void 0);return v(f,B)}),l&&!P&&y.push(function(f){const p=f.theme?.components?.[l]?.variants;return p?I(f,p,[],f.theme.modularCssLayers?"theme":void 0):null}),k||y.push(W),Array.isArray(m[0])){const O=m.shift(),f=new Array(c.length).fill(""),R=new Array(y.length).fill("");let p;p=[...f,...O,...R],p.raw=[...f,...O.raw,...R],c.unshift(p)}const J=[...c,...m,...y],j=V(...J);return a.muiName&&(j.muiName=a.muiName),j};return V.withConfig&&(L.withConfig=V.withConfig),L}}function fe(e,t){return void 0}function he(e){for(const t in e)return!1;return!0}function pe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function ye(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const D={theme:void 0};function de(e){let t,r;return function(o){let s=t;return(s===void 0||o.theme!==r)&&(D.theme=o.theme,s=G(e(D)),t=s,r=o.theme),s}}function me(e,t,r=void 0){const n={};for(const o in e){const s=e[o];let i="",a=!0;for(let d=0;d<s.length;d+=1){const l=s[d];l&&(i+=(a===!0?"":" ")+t(l),a=!1,r&&r[l]&&(i+=" "+r[l]))}n[o]=i}return n}function ge(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Se=e=>ge(e)&&e!=="classes",ve=ce({themeId:Z,defaultTheme:z,rootShouldForwardProp:Se}),we=de;function Ve(...e){const t=A.useRef(void 0),r=A.useCallback(n=>{const o=e.map(s=>{if(s==null)return null;if(typeof s=="function"){const i=s,a=i(n);return typeof a=="function"?a:()=>{i(null)}}return s.current=n,()=>{s.current=null}});return()=>{o.forEach(s=>s?.())}},e);return A.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}function be(e){return typeof e.main=="string"}function xe(e,t=[]){if(!be(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function Ce(e=[]){return([,t])=>t&&xe(t,e)}function Te(e){return U("MuiTypography",e)}ie("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Pe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Oe=ee(),Re=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:s,classes:i}=e,a={root:["root",s,e.align!=="inherit"&&`align${_(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return me(a,Te,i)},Ae=ve("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${_(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(we(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,r])=>t!=="inherit"&&r&&typeof r=="object").map(([t,r])=>({props:{variant:t},style:r})),...Object.entries(e.palette).filter(Ce()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${_(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),H={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Fe=A.forwardRef(function(t,r){const{color:n,...o}=N({props:t,name:"MuiTypography"}),s=!Pe[n],i=Oe({...o,...s&&{color:n}}),{align:a="inherit",className:d,component:l,gutterBottom:h=!1,noWrap:x=!1,paragraph:C=!1,variant:v="body1",variantMapping:T=H,...w}=i,P={...i,align:a,color:n,className:d,component:l,gutterBottom:h,noWrap:x,paragraph:C,variant:v,variantMapping:T},k=l||(C?"p":T[v]||H[v])||"span",b=Re(P);return te.jsx(Ae,{as:k,ref:r,className:re(b.root,d),...w,ownerState:P,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...w.style}})});export{Fe as T,ke as _,ie as a,F as b,me as c,Ce as d,U as g,we as m,ve as s,Ve as u};
1
+ import{eg as S,eh as K,ei as Q,ej as X,ek as W,el as Y,d9 as Z,d8 as z,r as k,dd as N,em as ee,j as te,ak as re,d_ as V}from"./index-iLt1WIM9.js";function Me(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const $=e=>e,ne=()=>{let e=$;return{configure(t){e=t},generate(t){return e(t)},reset(){e=$}}},oe=ne(),se={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function U(e,t,r="Mui"){const n=se[t];return n?`${r}-${n}`:`${oe.generate(e)}-${t}`}function ie(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=U(e,o,r)}),n}function G(e){const{variants:t,...r}=e,n={variants:t,style:S(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=S(o.style))}),n}const ae=K();function F(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function g(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function le(e){return e?(t,r)=>r[e]:null}function ue(e,t,r){e.theme=he(e.theme)?r:e.theme[t]||e.theme}function A(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(o=>A(e,o,r));if(Array.isArray(n?.variants)){let o;if(n.isProcessed)o=r?g(n.style,r):n.style;else{const{variants:s,...i}=n;o=r?g(S(i),r):i}return I(e,n.variants,[o],r)}return n?.isProcessed?r?g(S(n.style),r):n.style:r?g(S(n),r):n}function I(e,t,r=[],n=void 0){let o;e:for(let s=0;s<t.length;s+=1){const i=t[s];if(typeof i.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(o))continue}else for(const a in i.props)if(e[a]!==i.props[a]&&e.ownerState?.[a]!==i.props[a])continue e;typeof i.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?g(S(i.style(o)),n):i.style(o))):r.push(n?g(S(i.style),n):i.style)}return r}function ce(e={}){const{themeId:t,defaultTheme:r=ae,rootShouldForwardProp:n=F,slotShouldForwardProp:o=F}=e;function s(a){ue(a,t,r)}return(a,d={})=>{Q(a,u=>u.filter(c=>c!==W));const{name:l,slot:h,skipVariantsResolver:b,skipSx:C,overridesResolver:v=le(ye(h)),...T}=d,w=l&&l.startsWith("Mui")||h?"components":"custom",P=b!==void 0?b:h&&h!=="Root"&&h!=="root"||!1,M=C||!1;let x=F;h==="Root"||h==="root"?x=n:h?x=o:pe(a)&&(x=void 0);const _=X(a,{shouldForwardProp:x,label:fe(),...T}),q=u=>{if(u.__emotion_real===u)return u;if(typeof u=="function")return function(m){return A(m,u,m.theme.modularCssLayers?w:void 0)};if(Y(u)){const c=G(u);return function(y){return c.variants?A(y,c,y.theme.modularCssLayers?w:void 0):y.theme.modularCssLayers?g(c.style,w):c.style}}return u},j=(...u)=>{const c=[],m=u.map(q),y=[];if(c.push(s),l&&v&&y.push(function(f){const p=f.theme.components?.[l]?.styleOverrides;if(!p)return null;const B={};for(const E in p)B[E]=A(f,p[E],f.theme.modularCssLayers?"theme":void 0);return v(f,B)}),l&&!P&&y.push(function(f){const p=f.theme?.components?.[l]?.variants;return p?I(f,p,[],f.theme.modularCssLayers?"theme":void 0):null}),M||y.push(W),Array.isArray(m[0])){const O=m.shift(),f=new Array(c.length).fill(""),R=new Array(y.length).fill("");let p;p=[...f,...O,...R],p.raw=[...f,...O.raw,...R],c.unshift(p)}const J=[...c,...m,...y],L=_(...J);return a.muiName&&(L.muiName=a.muiName),L};return _.withConfig&&(j.withConfig=_.withConfig),j}}function fe(e,t){return void 0}function he(e){for(const t in e)return!1;return!0}function pe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function ye(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const D={theme:void 0};function de(e){let t,r;return function(o){let s=t;return(s===void 0||o.theme!==r)&&(D.theme=o.theme,s=G(e(D)),t=s,r=o.theme),s}}function me(e,t,r=void 0){const n={};for(const o in e){const s=e[o];let i="",a=!0;for(let d=0;d<s.length;d+=1){const l=s[d];l&&(i+=(a===!0?"":" ")+t(l),a=!1,r&&r[l]&&(i+=" "+r[l]))}n[o]=i}return n}function ge(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Se=e=>ge(e)&&e!=="classes",ve=ce({themeId:Z,defaultTheme:z,rootShouldForwardProp:Se}),we=de;function _e(...e){const t=k.useRef(void 0),r=k.useCallback(n=>{const o=e.map(s=>{if(s==null)return null;if(typeof s=="function"){const i=s,a=i(n);return typeof a=="function"?a:()=>{i(null)}}return s.current=n,()=>{s.current=null}});return()=>{o.forEach(s=>s?.())}},e);return k.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}function xe(e){return typeof e.main=="string"}function be(e,t=[]){if(!xe(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function Ce(e=[]){return([,t])=>t&&be(t,e)}function Te(e){return U("MuiTypography",e)}ie("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Pe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Oe=ee(),Re=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:s,classes:i}=e,a={root:["root",s,e.align!=="inherit"&&`align${V(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return me(a,Te,i)},ke=ve("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${V(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(we(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,r])=>t!=="inherit"&&r&&typeof r=="object").map(([t,r])=>({props:{variant:t},style:r})),...Object.entries(e.palette).filter(Ce()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${V(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),H={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Fe=k.forwardRef(function(t,r){const{color:n,...o}=N({props:t,name:"MuiTypography"}),s=!Pe[n],i=Oe({...o,...s&&{color:n}}),{align:a="inherit",className:d,component:l,gutterBottom:h=!1,noWrap:b=!1,paragraph:C=!1,variant:v="body1",variantMapping:T=H,...w}=i,P={...i,align:a,color:n,className:d,component:l,gutterBottom:h,noWrap:b,paragraph:C,variant:v,variantMapping:T},M=l||(C?"p":T[v]||H[v])||"span",x=Re(P);return te.jsx(ke,{as:M,ref:r,className:re(x.root,d),...w,ownerState:P,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...w.style}})});export{Fe as T,Me as _,ie as a,F as b,me as c,Ce as d,U as g,we as m,ve as s,_e as u};
@@ -1 +1 @@
1
- import{ag as l,j as t,fc as Q,fd as W,fe as O,ff as X,fg as Z,fh as T,fi as ee,fj as oe,fk as M,fl as re,fm as te,fn as ne,p as P,dS as ae}from"./index-CN7VPpiB.js";var d="Accordion",ce=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[k,ie,se]=Q(d),[b]=W(d,[se,O]),E=O(),V=l.forwardRef((e,n)=>{const{type:o,...a}=e,c=a,r=a;return t.jsx(k.Provider,{scope:e.__scopeAccordion,children:o==="multiple"?t.jsx(pe,{...r,ref:n}):t.jsx(fe,{...c,ref:n})})});V.displayName=d;var[H,le]=b(d),[K,de]=b(d,{collapsible:!1}),fe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},collapsible:r=!1,...s}=e,[i,f]=M({prop:o,defaultProp:a??"",onChange:c,caller:d});return t.jsx(H,{scope:e.__scopeAccordion,value:l.useMemo(()=>i?[i]:[],[i]),onItemOpen:f,onItemClose:l.useCallback(()=>r&&f(""),[r,f]),children:t.jsx(K,{scope:e.__scopeAccordion,collapsible:r,children:t.jsx($,{...s,ref:n})})})}),pe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},...r}=e,[s,i]=M({prop:o,defaultProp:a??[],onChange:c,caller:d}),f=l.useCallback(x=>i((u=[])=>[...u,x]),[i]),v=l.useCallback(x=>i((u=[])=>u.filter(h=>h!==x)),[i]);return t.jsx(H,{scope:e.__scopeAccordion,value:s,onItemOpen:f,onItemClose:v,children:t.jsx(K,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx($,{...r,ref:n})})})}),[ue,C]=b(d),$=l.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:c,orientation:r="vertical",...s}=e,i=l.useRef(null),f=re(i,n),v=ie(o),u=te(c)==="ltr",h=ne(e.onKeyDown,m=>{if(!ce.includes(m.key))return;const F=m.target,I=v().filter(R=>!R.ref.current?.disabled),g=I.findIndex(R=>R.ref.current===F),D=I.length;if(g===-1)return;m.preventDefault();let p=g;const j=0,w=D-1,_=()=>{p=g+1,p>w&&(p=j)},y=()=>{p=g-1,p<j&&(p=w)};switch(m.key){case"Home":p=j;break;case"End":p=w;break;case"ArrowRight":r==="horizontal"&&(u?_():y());break;case"ArrowDown":r==="vertical"&&_();break;case"ArrowLeft":r==="horizontal"&&(u?y():_());break;case"ArrowUp":r==="vertical"&&y();break}const J=p%D;I[J].ref.current?.focus()});return t.jsx(ue,{scope:o,disabled:a,direction:c,orientation:r,children:t.jsx(k.Slot,{scope:o,children:t.jsx(T.div,{...s,"data-orientation":r,ref:f,onKeyDown:a?void 0:h})})})}),A="AccordionItem",[ve,S]=b(A),z=l.forwardRef((e,n)=>{const{__scopeAccordion:o,value:a,...c}=e,r=C(A,o),s=le(A,o),i=E(o),f=X(),v=a&&s.value.includes(a)||!1,x=r.disabled||e.disabled;return t.jsx(ve,{scope:o,open:v,disabled:x,triggerId:f,children:t.jsx(Z,{"data-orientation":r.orientation,"data-state":B(v),...i,...c,ref:n,disabled:x,open:v,onOpenChange:u=>{u?s.onItemOpen(a):s.onItemClose(a)}})})});z.displayName=A;var L="AccordionHeader",G=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(L,o);return t.jsx(T.h3,{"data-orientation":c.orientation,"data-state":B(r.open),"data-disabled":r.disabled?"":void 0,...a,ref:n})});G.displayName=L;var N="AccordionTrigger",U=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(N,o),s=de(N,o),i=E(o);return t.jsx(k.ItemSlot,{scope:o,children:t.jsx(ee,{"aria-disabled":r.open&&!s.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...i,...a,ref:n})})});U.displayName=N;var Y="AccordionContent",q=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(Y,o),s=E(o);return t.jsx(oe,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...s,...a,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});q.displayName=Y;function B(e){return e?"open":"closed"}var xe=V,me=z,ge=G,Ae=U,be=q;function he({...e}){return t.jsx(xe,{"data-slot":"accordion",...e})}function Ie({className:e,...n}){return t.jsx(me,{"data-slot":"accordion-item",className:P("border-b last:border-b-0",e),...n})}function je({className:e,children:n,...o}){return t.jsx(ge,{className:"flex",children:t.jsxs(Ae,{"data-slot":"accordion-trigger",className:P("focus-visible:border-gray-950 focus-visible:ring-gray-950/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50",e),...o,children:[n,t.jsx(ae,{className:"text-gray-500 pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-gray-400"})]})})}function we({className:e,children:n,...o}){return t.jsx(be,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...o,children:t.jsx("div",{className:P("pt-0 pb-4",e),children:n})})}export{he as A,Ie as a,we as b,je as c};
1
+ import{aj as l,j as t,ff as J,fg as Q,fh as O,fi as W,fj as Z,fk as T,fl as ee,fm as oe,fn as M,fo as re,fp as te,fq as ne,y as P,dX as ae}from"./index-iLt1WIM9.js";var d="Accordion",ce=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[k,ie,se]=J(d),[b]=Q(d,[se,O]),E=O(),V=l.forwardRef((e,n)=>{const{type:o,...a}=e,c=a,r=a;return t.jsx(k.Provider,{scope:e.__scopeAccordion,children:o==="multiple"?t.jsx(pe,{...r,ref:n}):t.jsx(fe,{...c,ref:n})})});V.displayName=d;var[H,le]=b(d),[K,de]=b(d,{collapsible:!1}),fe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},collapsible:r=!1,...s}=e,[i,f]=M({prop:o,defaultProp:a??"",onChange:c,caller:d});return t.jsx(H,{scope:e.__scopeAccordion,value:l.useMemo(()=>i?[i]:[],[i]),onItemOpen:f,onItemClose:l.useCallback(()=>r&&f(""),[r,f]),children:t.jsx(K,{scope:e.__scopeAccordion,collapsible:r,children:t.jsx($,{...s,ref:n})})})}),pe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},...r}=e,[s,i]=M({prop:o,defaultProp:a??[],onChange:c,caller:d}),f=l.useCallback(x=>i((u=[])=>[...u,x]),[i]),v=l.useCallback(x=>i((u=[])=>u.filter(h=>h!==x)),[i]);return t.jsx(H,{scope:e.__scopeAccordion,value:s,onItemOpen:f,onItemClose:v,children:t.jsx(K,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx($,{...r,ref:n})})})}),[ue,C]=b(d),$=l.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:c,orientation:r="vertical",...s}=e,i=l.useRef(null),f=re(i,n),v=ie(o),u=te(c)==="ltr",h=ne(e.onKeyDown,m=>{if(!ce.includes(m.key))return;const B=m.target,I=v().filter(R=>!R.ref.current?.disabled),g=I.findIndex(R=>R.ref.current===B),D=I.length;if(g===-1)return;m.preventDefault();let p=g;const j=0,w=D-1,_=()=>{p=g+1,p>w&&(p=j)},y=()=>{p=g-1,p<j&&(p=w)};switch(m.key){case"Home":p=j;break;case"End":p=w;break;case"ArrowRight":r==="horizontal"&&(u?_():y());break;case"ArrowDown":r==="vertical"&&_();break;case"ArrowLeft":r==="horizontal"&&(u?y():_());break;case"ArrowUp":r==="vertical"&&y();break}const F=p%D;I[F].ref.current?.focus()});return t.jsx(ue,{scope:o,disabled:a,direction:c,orientation:r,children:t.jsx(k.Slot,{scope:o,children:t.jsx(T.div,{...s,"data-orientation":r,ref:f,onKeyDown:a?void 0:h})})})}),A="AccordionItem",[ve,S]=b(A),z=l.forwardRef((e,n)=>{const{__scopeAccordion:o,value:a,...c}=e,r=C(A,o),s=le(A,o),i=E(o),f=W(),v=a&&s.value.includes(a)||!1,x=r.disabled||e.disabled;return t.jsx(ve,{scope:o,open:v,disabled:x,triggerId:f,children:t.jsx(Z,{"data-orientation":r.orientation,"data-state":Y(v),...i,...c,ref:n,disabled:x,open:v,onOpenChange:u=>{u?s.onItemOpen(a):s.onItemClose(a)}})})});z.displayName=A;var L="AccordionHeader",G=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(L,o);return t.jsx(T.h3,{"data-orientation":c.orientation,"data-state":Y(r.open),"data-disabled":r.disabled?"":void 0,...a,ref:n})});G.displayName=L;var N="AccordionTrigger",U=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(N,o),s=de(N,o),i=E(o);return t.jsx(k.ItemSlot,{scope:o,children:t.jsx(ee,{"aria-disabled":r.open&&!s.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...i,...a,ref:n})})});U.displayName=N;var q="AccordionContent",X=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(q,o),s=E(o);return t.jsx(oe,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...s,...a,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});X.displayName=q;function Y(e){return e?"open":"closed"}var xe=V,me=z,ge=G,Ae=U,be=X;function he({...e}){return t.jsx(xe,{"data-slot":"accordion",...e})}function Ie({className:e,...n}){return t.jsx(me,{"data-slot":"accordion-item",className:P("border-b last:border-b-0",e),...n})}function je({className:e,children:n,...o}){return t.jsx(ge,{className:"flex",children:t.jsxs(Ae,{"data-slot":"accordion-trigger",className:P("focus-visible:border-gray-950 focus-visible:ring-gray-950/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50",e),...o,children:[n,t.jsx(ae,{className:"text-gray-500 pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-gray-400"})]})})}function we({className:e,children:n,...o}){return t.jsx(be,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...o,children:t.jsx("div",{className:P("pt-0 pb-4",e),children:n})})}export{he as A,Ie as a,we as b,je as c};
@@ -0,0 +1 @@
1
+ import{r as s,F as h,u as v,U as C,ai as A,a as F,j as e,c as P,L as b,fr as y}from"./index-iLt1WIM9.js";import{C as j}from"./charges-filters-DaVBQ_jS.js";import{P as D}from"./Progress-CSjfE5bV.js";import"./sub-3l-gAINS.js";import"./subMonths-LVothVpu.js";const w=()=>{const{setFiltersContext:c}=s.useContext(h),{get:i}=v(),{userContext:p}=s.useContext(C),[a,x]=s.useState(i("chargesFilters")?JSON.parse(decodeURIComponent(i("chargesFilters"))):{byOwners:p?.context.adminBusinessId?[p?.context.adminBusinessId]:[],sortBy:{field:A.Date,asc:!1},toAnyDate:null,fromAnyDate:null}),[{data:r,fetching:u}]=F({query:y,variables:{filters:a,page:1,limit:999999}}),t=r?.allCharges?.nodes.length??0;let o=0,l=0,n=0;r?.allCharges?.nodes.map(f=>{switch(f.accountantApproval){case"APPROVED":o+=1;break;case"PENDING":l+=1;break;case"UNAPPROVED":n+=1;break}});const d=100*o/t,g=100*l/t,m=100*n/t;return s.useEffect(()=>{c(e.jsx("div",{className:"flex flex-row gap-x-5",children:e.jsx(j,{filter:a,setFilter:x,activePage:1,setPage:()=>{},totalPages:1})}))},[r,u,a,c,x]),e.jsx(P,{title:"Accountant Approvals Status",children:u?e.jsx(b,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsxs("div",{className:"mx-10 mt-5 flex flex-col gap-5",children:[`Total charges: ${t}`,e.jsx(D,{color:"green",radius:"xl",size:"xl",sections:[{value:d,color:"green",label:`${d.toFixed(1)}% (${o})`},{value:g,color:"orange",label:`${g.toFixed(1)}% (${l})`},{value:m,color:"red",label:`${m.toFixed(1)}% (${n})`}]})]})})};export{w as AccountantApprovals};
@@ -1 +1 @@
1
- import{r as s,F as D,u as E,a as N,j as e,T as b,B as w,P as z,b as O,c as T,L,C as R,E as q,I as B,M as U,A as k}from"./index-CN7VPpiB.js";import{e as Q,C as $}from"./charges-filters-C-H07qp1.js";import{M as H}from"./index-Csqyxwgx.js";import"./sub-LLu8afpC.js";import"./subMonths-C1UIPrOU.js";import"./Checkbox-lfqFDKZM.js";function Y(l,n){const a=new URLSearchParams;n&&a.append("page",String(n));const o=Q(l);return o&&a.append("chargesFilters",o),`/charges${a.size>0?`?${a}`:""}`}const Z=()=>{const{setFiltersContext:l}=s.useContext(D),[n,a]=s.useState(void 0),[o,g]=s.useState(void 0),[d,x]=s.useState(void 0),[u,j]=s.useState(!1),[r,h]=s.useState([]),{get:m}=E(),[p,M]=s.useState(m("page")?Number(m("page")):1),C=m("chargesFilters"),S=s.useMemo(()=>{if(C)try{return JSON.parse(decodeURIComponent(C))}catch{return}},[C]),[i,v]=s.useState(S),I=s.useCallback((t,A)=>{r.map(f=>f.id).includes(t)?h(r.filter(f=>f.id!==t)):h([...r,{id:t,onChange:A}])},[r]),[{data:c,fetching:P},F]=N({query:k,variables:{filters:i,page:p,limit:100},pause:!0});s.useEffect(()=>{i&&F()},[i,F]);function y(){h([])}return s.useEffect(()=>{l(e.jsxs("div",{className:"flex flex-row gap-x-5",children:[e.jsx($,{filter:i,setFilter:v,activePage:p,setPage:M,totalPages:c?.allCharges?.pageInfo.totalPages,initiallyOpened:!i}),e.jsx(b,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>j(t=>!t),children:u?e.jsx(z,{className:"size-5"}):e.jsx(O,{className:"size-5"})})}),e.jsx(H,{selected:r,resetMerge:y})]}))},[c,P,i,p,u,l,M,v,j,r,S]),e.jsxs(T,{title:"All Charges",description:"Manage charges",children:[P?e.jsx(L,{className:"h-10 w-10 animate-spin mr-2 self-center"}):c?.allCharges.nodes?e.jsx(R,{setEditChargeId:a,setInsertDocument:g,setMatchDocuments:x,toggleMergeCharge:I,mergeSelectedCharges:new Set(r.map(t=>t.id)),data:c?.allCharges?.nodes,isAllOpened:u}):e.jsx("span",{children:"Please apply filters"}),n&&e.jsx(q,{chargeId:n?.id,close:()=>a(void 0),onChange:n.onChange}),o&&e.jsx(B,{chargeId:o.id,onChange:o.onChange,close:()=>g(void 0)}),d&&e.jsx(U,{chargeId:d.id,ownerId:d.ownerId,setMatchDocuments:()=>x(void 0)})]})};export{Z as AllCharges,Y as getAllChargesHref};
1
+ import{r as s,F as D,u as E,a as N,j as e,T as b,B as w,P as z,b as O,c as T,L,C as R,E as q,I as B,M as U,A as k}from"./index-iLt1WIM9.js";import{e as Q,C as $}from"./charges-filters-DaVBQ_jS.js";import{M as H}from"./index-DfYVR_1G.js";import"./sub-3l-gAINS.js";import"./subMonths-LVothVpu.js";import"./Checkbox-iZ--iyJF.js";function Y(l,n){const a=new URLSearchParams;n&&a.append("page",String(n));const o=Q(l);return o&&a.append("chargesFilters",o),`/charges${a.size>0?`?${a}`:""}`}const Z=()=>{const{setFiltersContext:l}=s.useContext(D),[n,a]=s.useState(void 0),[o,g]=s.useState(void 0),[d,x]=s.useState(void 0),[u,j]=s.useState(!1),[r,h]=s.useState([]),{get:m}=E(),[p,M]=s.useState(m("page")?Number(m("page")):1),C=m("chargesFilters"),S=s.useMemo(()=>{if(C)try{return JSON.parse(decodeURIComponent(C))}catch{return}},[C]),[i,v]=s.useState(S),I=s.useCallback((t,A)=>{r.map(f=>f.id).includes(t)?h(r.filter(f=>f.id!==t)):h([...r,{id:t,onChange:A}])},[r]),[{data:c,fetching:P},F]=N({query:k,variables:{filters:i,page:p,limit:100},pause:!0});s.useEffect(()=>{i&&F()},[i,F]);function y(){h([])}return s.useEffect(()=>{l(e.jsxs("div",{className:"flex flex-row gap-x-5",children:[e.jsx($,{filter:i,setFilter:v,activePage:p,setPage:M,totalPages:c?.allCharges?.pageInfo.totalPages,initiallyOpened:!i}),e.jsx(b,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>j(t=>!t),children:u?e.jsx(z,{className:"size-5"}):e.jsx(O,{className:"size-5"})})}),e.jsx(H,{selected:r,resetMerge:y})]}))},[c,P,i,p,u,l,M,v,j,r,S]),e.jsxs(T,{title:"All Charges",description:"Manage charges",children:[P?e.jsx(L,{className:"h-10 w-10 animate-spin mr-2 self-center"}):c?.allCharges.nodes?e.jsx(R,{setEditChargeId:a,setInsertDocument:g,setMatchDocuments:x,toggleMergeCharge:I,mergeSelectedCharges:new Set(r.map(t=>t.id)),data:c?.allCharges?.nodes,isAllOpened:u}):e.jsx("span",{children:"Please apply filters"}),n&&e.jsx(q,{chargeId:n?.id,close:()=>a(void 0),onChange:n.onChange}),o&&e.jsx(B,{chargeId:o.id,onChange:o.onChange,close:()=>g(void 0)}),d&&e.jsx(U,{chargeId:d.id,ownerId:d.ownerId,setMatchDocuments:()=>x(void 0)})]})};export{Z as AllCharges,Y as getAllChargesHref};
@@ -1,4 +1,4 @@
1
- import{z as o}from"./index-CN7VPpiB.js";/**
1
+ import{V as o}from"./index-iLt1WIM9.js";/**
2
2
  * @license lucide-react v0.546.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,42 @@
1
+ import{V as ee,W as Ce,X as Se,Y as ie,p as be,r as N,t as B,s as we,Z as Ms,k as Ie,_ as Ee,D as je,j as e,$ as W,a0 as K,a1 as H,a2 as X,l as De,a3 as Q,a4 as j,a5 as g,a6 as f,a7 as y,Q as T,a8 as I,a9 as C,aa as Qe,B as E,ab as Us,ac as Pe,o as Ye,ad as V,ae as Cs,af as q,ag as zs,U as Ze,a as Oe,ah as qs,O as Gs,C as Ws,ai as Ks,aj as L,ak as ds,al as Hs,am as Xs,an as ue,ao as Je,ap as es,aq as G,ar as ss,as as ns,at as ts,au as as,av as he,aw as le,ax as ce,ay as oe,az as de,aA as me,aB as rs,aC as is,aD as Re,aE as re,aF as Me,aG as Ue,aH as Le,aI as Qs,aJ as se,aK as J,aL as Ys,aM as Zs,aN as Js,aO as ze,aP as en,aQ as sn,aR as nn,aS as tn,aT as an,aU as qe,aV as rn,aW as Ge,aX as ln,aY as bs,aZ as ws,a_ as cn,a$ as on,b0 as Is,b1 as ls,b2 as dn,b3 as ms,b4 as mn,b5 as un,b6 as hn,b7 as xn,b8 as pn,b9 as jn,ba as gn,bb as D,bc as fn,bd as cs,be as vn,bf as yn,bg as Nn,bh as Cn,bi as bn,bj as wn,bk as Z,bl as In,bm as Dn,bn as z,bo as An,bp as kn,bq as Sn,w as Tn,br as En}from"./index-iLt1WIM9.js";import{S as os,B as Ds}from"./save-CMGkGXCM.js";import{i as Pn,D as On,f as Bn,E as Ln,L as Ve,a as Ae,C as Vn,A as _n,b as ve,c as Fn,d as We,h as $n,e as Rn,g as As,u as Mn,G as Un,j as us,k as zn,X as ks,Y as Ss,l as qn,m as Gn,R as Wn,n as Kn,o as Hn,p as Xn}from"./chart-BgPuhGqj.js";import{u as Ts,S as Qn}from"./similar-charges-by-business-modal-Dj7iCQhJ.js";import{P as Yn}from"./pencil-1-tPx_Bq.js";import{A as Zn,a as _e,b as Fe,c as hs}from"./accordion-CcwG2M8I.js";import"./sequential-CAnleQny.js";/**
2
+ * @license lucide-react v0.546.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Jn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xs=ee("circle-check",Jn);/**
7
+ * @license lucide-react v0.546.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const et=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],ke=ee("dollar-sign",et);/**
12
+ * @license lucide-react v0.546.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const st=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],nt=ee("file-check",st);/**
17
+ * @license lucide-react v0.546.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const tt=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ke=ee("map-pin",tt);/**
22
+ * @license lucide-react v0.546.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const at=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Es=ee("phone",at);/**
27
+ * @license lucide-react v0.546.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const rt=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],it=ee("plug",rt);/**
32
+ * @license lucide-react v0.546.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const lt=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ps=ee("shield",lt);/**
37
+ * @license lucide-react v0.546.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const ct=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],$e=ee("trending-up",ct);function Os(s){switch(s){case Ce.Annual:return"Annual";case Ce.Monthly:return"Monthly";default:throw new Error(`Unsupported Billing Cycle: ${s}`)}}function Bs(s){switch(s){case Se.Enterprise:return"Enterprise";case Se.Pro:return"Pro";default:throw new Error(`Unsupported Subscription plan: ${s}`)}}function ot(s){return ie(s,"yyyy-MM-dd")}const dt="updateAdminBusiness",mt=()=>{const[{fetching:s},n]=be(Ms),t=N.useCallback(async a=>{const i=`Error updating admin business ID [${a.adminBusinessId}]`,l=`${dt}-${a.adminBusinessId}`;B.loading("Updating admin business",{id:l});try{const c=await n(a),r=we(c,i,l,"updateAdminBusiness");if(r)return B.success("Success",{id:l,description:"Admin Business Updated"}),r.updateAdminBusiness}catch(c){console.error(`${i}: ${c}`),B.error("Error",{id:l,description:i,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateAdminBusiness:t}},ut=Pe({employerWithholdingTaxAccountNumber:V().min(1,{message:"Employer Withholding Tax Account Number is required"}),taxPrepaymentId:V().min(1,{message:"Tax Prepayment ID is required"}),nationalInsuranceEmployerId:V().min(1,{message:"National Insurance Employer ID is required"}),advanceTaxRate:Cs().min(0,{message:"Advance Tax Rate must be at least 0"}).max(100,{message:"Advance Tax Rate must be at most 100"}),registrationDate:V().min(1,{message:"Registration Date is required"})});function ps(s){return!s||s.__typename!=="LtdFinancialEntity"||!s.adminInfo?{}:{employerWithholdingTaxAccountNumber:s.adminInfo.employerWithholdingTaxAccountNumber??"",taxPrepaymentId:s.adminInfo.taxPrepaymentId??"",nationalInsuranceEmployerId:s.adminInfo.nationalInsuranceEmployerId??"",advanceTaxRate:s.adminInfo.advanceTaxRate??0,registrationDate:s.adminInfo.registrationDate??""}}function ht(s){return{employerWithholdingTaxAccountNumber:s.employerWithholdingTaxAccountNumber,taxPrepaymentId:s.taxPrepaymentId,nationalInsuranceEmployerId:s.nationalInsuranceEmployerId,advanceTaxRate:s.advanceTaxRate,registrationDate:s.registrationDate?ot(new Date(s.registrationDate)):void 0}}function xt({data:s,refetchBusiness:n}){const t=je(Us,s),[a,i]=N.useState(ps(t)),{updateAdminBusiness:l,fetching:c}=mt(),r=Ie({resolver:Ee(ut),defaultValues:a}),o=async d=>{if(!t)return;const x=Ye(d,r.formState.dirtyFields);if(!x)return;const u=ht(x);await l({adminBusinessId:t.id,fields:u}),n?.()};return N.useEffect(()=>{if(t){const d=ps(t);i(d),r.reset(d)}},[t,r]),e.jsxs(W,{children:[e.jsxs(K,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ps,{className:"h-5 w-5 text-primary"}),e.jsx(H,{children:"Admin Business Configuration"})]}),e.jsx(X,{children:"Tax and registration information for the business operating this application"})]}),e.jsx(De,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(o),className:"space-y-6",children:[e.jsx(Q,{children:e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsx(j,{control:r.control,name:"employerWithholdingTaxAccountNumber",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Employer Withholding Tax Account Number"}),e.jsx(y,{children:e.jsx(T,{placeholder:"Enter account number",...d,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"taxPrepaymentId",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tax Prepayment ID"}),e.jsx(y,{children:e.jsx(T,{placeholder:"Enter prepayment ID",...d,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"nationalInsuranceEmployerId",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"National Insurance Employer ID"}),e.jsx(y,{children:e.jsx(T,{placeholder:"Enter employer ID",...d,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"advanceTaxRate",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Advance Tax Rate (%)"}),e.jsx(y,{children:e.jsx(T,{type:"number",step:"0.01",min:"0",max:"100",placeholder:"Enter tax rate",...d,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"registrationDate",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Registration Date"}),e.jsx(y,{children:e.jsx(T,{type:"date",...d,className:I(x)})}),e.jsx(C,{})]})})]})}),e.jsx(Qe,{className:"flex justify-end border-t mt-4 pt-6",children:e.jsxs(E,{type:"submit",disabled:c||Object.keys(r.formState.dirtyFields).length===0||!r.formState.isValid,children:[e.jsx(os,{className:"h-4 w-4"}),"Save Changes"]})})]})})]})}function pt({data:s}){const n=je(zs,s);return!n||n.__typename!=="LtdFinancialEntity"?e.jsx("div",{}):e.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-border bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/60",children:e.jsx("div",{className:"container mx-auto px-4 md:px-6 lg:px-8 max-w-7xl",children:e.jsxs("div",{className:"flex h-16 items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent",children:e.jsx(Ds,{className:"h-5 w-5 text-accent-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:n.name}),e.jsx(q,{variant:"secondary",children:"Active"})]}),e.jsxs("p",{className:"text-sm text-muted-foreground truncate",children:["Business ID: ",n.id]})]})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-6 text-sm",children:[n.governmentId&&e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-muted-foreground",children:"Tax ID"}),e.jsx("p",{className:"font-medium text-foreground",children:n.governmentId})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-muted-foreground",children:"Since"}),e.jsx("p",{className:"font-medium text-foreground",children:ie(n.createdAt,"MMM yyyy")})]})]})]})})})}function jt({businessId:s}){const{userContext:n}=N.useContext(Ze),[t,a]=N.useState(1),[{data:i,fetching:l}]=Oe({query:qs,variables:{filters:{byOwners:n?.context.adminBusinessId?[n.context.adminBusinessId]:void 0,sortBy:{field:Ks.Date,asc:!1},byBusinesses:[s]},page:t,limit:100}}),c=i?.allCharges?.pageInfo.totalPages??1,r=i?.allCharges?.nodes??[];return l?e.jsx("div",{children:"Loading charges..."}):e.jsxs(W,{children:[e.jsxs(K,{className:"flex w-full justify-between items-center",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx(H,{children:"Charges"}),e.jsx(X,{children:"Recurring and one-time charges for this business"})]})}),c>1&&e.jsx(Gs,{className:"flex-fit",value:t,onChange:a,total:c})]}),e.jsx(Q,{children:e.jsx("div",{className:"rounded-md border",children:e.jsx(Ws,{data:r,isAllOpened:!1})})})]})}var gt=["type","layout","connectNulls","ref"],ft=["key"];function xe(s){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xe(s)}function js(s,n){if(s==null)return{};var t=vt(s,n),a,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);for(i=0;i<l.length;i++)a=l[i],!(n.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(s,a)&&(t[a]=s[a])}return t}function vt(s,n){if(s==null)return{};var t={};for(var a in s)if(Object.prototype.hasOwnProperty.call(s,a)){if(n.indexOf(a)>=0)continue;t[a]=s[a]}return t}function Ne(){return Ne=Object.assign?Object.assign.bind():function(s){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(s[a]=t[a])}return s},Ne.apply(this,arguments)}function gs(s,n){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(s);n&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,a)}return t}function F(s){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?gs(Object(t),!0).forEach(function(a){M(s,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):gs(Object(t)).forEach(function(a){Object.defineProperty(s,a,Object.getOwnPropertyDescriptor(t,a))})}return s}function ae(s){return bt(s)||Ct(s)||Nt(s)||yt()}function yt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(s,n){if(s){if(typeof s=="string")return He(s,n);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return He(s,n)}}function Ct(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function bt(s){if(Array.isArray(s))return He(s)}function He(s,n){(n==null||n>s.length)&&(n=s.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=s[t];return a}function wt(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")}function fs(s,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,Vs(a.key),a)}}function It(s,n,t){return n&&fs(s.prototype,n),t&&fs(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function Dt(s,n,t){return n=Te(n),At(s,Ls()?Reflect.construct(n,t||[],Te(s).constructor):n.apply(s,t))}function At(s,n){if(n&&(xe(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kt(s)}function kt(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Ls(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ls=function(){return!!s})()}function Te(s){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Te(s)}function St(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),n&&Xe(s,n)}function Xe(s,n){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},Xe(s,n)}function M(s,n,t){return n=Vs(n),n in s?Object.defineProperty(s,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[n]=t,s}function Vs(s){var n=Tt(s,"string");return xe(n)=="symbol"?n:n+""}function Tt(s,n){if(xe(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var a=t.call(s,n);if(xe(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}var pe=(function(s){function n(){var t;wt(this,n);for(var a=arguments.length,i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];return t=Dt(this,n,[].concat(i)),M(t,"state",{isAnimationFinished:!0,totalLength:0}),M(t,"generateSimpleStrokeDasharray",function(c,r){return"".concat(r,"px ").concat(c-r,"px")}),M(t,"getStrokeDasharray",function(c,r,o){var d=o.reduce(function(b,S){return b+S});if(!d)return t.generateSimpleStrokeDasharray(r,c);for(var x=Math.floor(c/d),u=c%d,h=r-c,A=[],m=0,p=0;m<o.length;p+=o[m],++m)if(p+o[m]>u){A=[].concat(ae(o.slice(0,m)),[u-p]);break}var k=A.length%2===0?[0,h]:[h];return[].concat(ae(n.repeat(o,x)),ae(A),k).map(function(b){return"".concat(b,"px")}).join(", ")}),M(t,"id",Mn("recharts-line-")),M(t,"pathRef",function(c){t.mainCurve=c}),M(t,"handleAnimationEnd",function(){t.setState({isAnimationFinished:!0}),t.props.onAnimationEnd&&t.props.onAnimationEnd()}),M(t,"handleAnimationStart",function(){t.setState({isAnimationFinished:!1}),t.props.onAnimationStart&&t.props.onAnimationStart()}),t}return St(n,s),It(n,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var a=this.getTotalLength();this.setState({totalLength:a})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var a=this.getTotalLength();a!==this.state.totalLength&&this.setState({totalLength:a})}}},{key:"getTotalLength",value:function(){var a=this.mainCurve;try{return a&&a.getTotalLength&&a.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(a,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.points,r=l.xAxis,o=l.yAxis,d=l.layout,x=l.children,u=Bn(x,Ln);if(!u)return null;var h=function(p,k){return{x:p.x,y:p.y,value:p.value,errorVal:As(p.payload,k)}},A={clipPath:a?"url(#clipPath-".concat(i,")"):null};return L.createElement(Ve,A,u.map(function(m){return L.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:c,xAxis:r,yAxis:o,layout:d,dataPointFormatter:h})}))}},{key:"renderDots",value:function(a,i,l){var c=this.props.isAnimationActive;if(c&&!this.state.isAnimationFinished)return null;var r=this.props,o=r.dot,d=r.points,x=r.dataKey,u=Ae(this.props,!1),h=Ae(o,!0),A=d.map(function(p,k){var b=F(F(F({key:"dot-".concat(k),r:3},u),h),{},{index:k,cx:p.x,cy:p.y,value:p.value,dataKey:x,payload:p.payload,points:d});return n.renderDotItem(o,b)}),m={clipPath:a?"url(#clipPath-".concat(i?"":"dots-").concat(l,")"):null};return L.createElement(Ve,Ne({className:"recharts-line-dots",key:"dots"},m),A)}},{key:"renderCurveStatically",value:function(a,i,l,c){var r=this.props,o=r.type,d=r.layout,x=r.connectNulls;r.ref;var u=js(r,gt),h=F(F(F({},Ae(u,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(l,")"):null,points:a},c),{},{type:o,layout:d,connectNulls:x});return L.createElement(Vn,Ne({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(a,i){var l=this,c=this.props,r=c.points,o=c.strokeDasharray,d=c.isAnimationActive,x=c.animationBegin,u=c.animationDuration,h=c.animationEasing,A=c.animationId,m=c.animateNewValues,p=c.width,k=c.height,b=this.state,S=b.prevPoints,_=b.totalLength;return L.createElement(_n,{begin:x,duration:u,isActive:d,easing:h,from:{t:0},to:{t:1},key:"line-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(R){var $=R.t;if(S){var Y=S.length/r.length,U=r.map(function(O,Be){var ge=Math.floor(Be*Y);if(S[ge]){var fe=S[ge],te=ve(fe.x,O.x),Fs=ve(fe.y,O.y);return F(F({},O),{},{x:te($),y:Fs($)})}if(m){var $s=ve(p*2,O.x),Rs=ve(k/2,O.y);return F(F({},O),{},{x:$s($),y:Rs($)})}return F(F({},O),{},{x:O.x,y:O.y})});return l.renderCurveStatically(U,a,i)}var ne=ve(0,_),v=ne($),w;if(o){var P="".concat(o).split(/[,\s]+/gim).map(function(O){return parseFloat(O)});w=l.getStrokeDasharray(v,_,P)}else w=l.generateSimpleStrokeDasharray(_,v);return l.renderCurveStatically(r,a,i,{strokeDasharray:w})})}},{key:"renderCurve",value:function(a,i){var l=this.props,c=l.points,r=l.isAnimationActive,o=this.state,d=o.prevPoints,x=o.totalLength;return r&&c&&c.length&&(!d&&x>0||!Fn(d,c))?this.renderCurveWithAnimation(a,i):this.renderCurveStatically(c,a,i)}},{key:"render",value:function(){var a,i=this.props,l=i.hide,c=i.dot,r=i.points,o=i.className,d=i.xAxis,x=i.yAxis,u=i.top,h=i.left,A=i.width,m=i.height,p=i.isAnimationActive,k=i.id;if(l||!r||!r.length)return null;var b=this.state.isAnimationFinished,S=r.length===1,_=ds("recharts-line",o),R=d&&d.allowDataOverflow,$=x&&x.allowDataOverflow,Y=R||$,U=We(k)?this.id:k,ne=(a=Ae(c,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},v=ne.r,w=v===void 0?3:v,P=ne.strokeWidth,O=P===void 0?2:P,Be=$n(c)?c:{},ge=Be.clipDot,fe=ge===void 0?!0:ge,te=w*2+O;return L.createElement(Ve,{className:_},R||$?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(U)},L.createElement("rect",{x:R?h:h-A/2,y:$?u:u-m/2,width:R?A:A*2,height:$?m:m*2})),!fe&&L.createElement("clipPath",{id:"clipPath-dots-".concat(U)},L.createElement("rect",{x:h-te/2,y:u-te/2,width:A+te,height:m+te}))):null,!S&&this.renderCurve(Y,U),this.renderErrorBar(Y,U),(S||c)&&this.renderDots(Y,fe,U),(!p||b)&&Rn.renderCallByParent(this.props,r))}}],[{key:"getDerivedStateFromProps",value:function(a,i){return a.animationId!==i.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,prevPoints:i.curPoints}:a.points!==i.curPoints?{curPoints:a.points}:null}},{key:"repeat",value:function(a,i){for(var l=a.length%2!==0?[].concat(ae(a),[0]):a,c=[],r=0;r<i;++r)c=[].concat(ae(c),ae(l));return c}},{key:"renderDotItem",value:function(a,i){var l;if(L.isValidElement(a))l=L.cloneElement(a,i);else if(Pn(a))l=a(i);else{var c=i.key,r=js(i,ft),o=ds("recharts-line-dot",typeof a!="boolean"?a.className:"");l=L.createElement(On,Ne({key:c},r,{className:o}))}return l}}])})(N.PureComponent);M(pe,"displayName","Line");M(pe,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Un.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});M(pe,"getComposedData",function(s){var n=s.props,t=s.xAxis,a=s.yAxis,i=s.xAxisTicks,l=s.yAxisTicks,c=s.dataKey,r=s.bandSize,o=s.displayedData,d=s.offset,x=n.layout,u=o.map(function(h,A){var m=As(h,c);return x==="horizontal"?{x:us({axis:t,ticks:i,bandSize:r,entry:h,index:A}),y:We(m)?null:a.scale(m),value:m,payload:h}:{x:We(m)?null:t.scale(m),y:us({axis:a,ticks:l,bandSize:r,entry:h,index:A}),value:m,payload:h}});return F({points:u,layout:x},d)});var Et=zn({chartName:"LineChart",GraphicalChild:pe,axisComponents:[{axisType:"xAxis",AxisComp:ks},{axisType:"yAxis",AxisComp:Ss}],formatAxisMap:qn});const ye=[{month:"Jan",revenue:12500,expenses:8200},{month:"Feb",revenue:15800,expenses:9100},{month:"Mar",revenue:18200,expenses:10500},{month:"Apr",revenue:16900,expenses:9800},{month:"May",revenue:21300,expenses:11200},{month:"Jun",revenue:24500,expenses:12800},{month:"Jul",revenue:22800,expenses:11900},{month:"Aug",revenue:26100,expenses:13500},{month:"Sep",revenue:28900,expenses:14200},{month:"Oct",revenue:31200,expenses:15100}];function Pt(){const s=ye.reduce((t,a)=>t+a.revenue,0),n=s/ye.length;return e.jsxs(W,{children:[e.jsxs(K,{children:[e.jsx(H,{children:"Revenue Analytics"}),e.jsx(X,{children:"Revenue and expenses over time"})]}),e.jsxs(Q,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-3 mb-6",children:[e.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ke,{className:"h-4 w-4"}),"Total Revenue"]}),e.jsxs("p",{className:"text-2xl font-bold",children:["$",s.toLocaleString()]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-green-600",children:[e.jsx($e,{className:"h-3 w-3"}),e.jsx("span",{children:"+24.5% from last period"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ke,{className:"h-4 w-4"}),"Average Monthly"]}),e.jsxs("p",{className:"text-2xl font-bold",children:["$",n.toLocaleString(void 0,{maximumFractionDigits:0})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-green-600",children:[e.jsx($e,{className:"h-3 w-3"}),e.jsx("span",{children:"+18.2% growth rate"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ke,{className:"h-4 w-4"}),"Current Month"]}),e.jsxs("p",{className:"text-2xl font-bold",children:["$",ye[ye.length-1].revenue.toLocaleString()]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-green-600",children:[e.jsx($e,{className:"h-3 w-3"}),e.jsx("span",{children:"+8.0% from last month"})]})]})]}),e.jsx(Gn,{config:{revenue:{label:"Revenue",color:"hsl(var(--chart-1))"},expenses:{label:"Expenses",color:"hsl(var(--chart-2))"}},className:"h-[400px]",children:e.jsx(Wn,{width:"100%",height:"100%",children:e.jsxs(Et,{data:ye,margin:{top:5,right:10,left:10,bottom:5},children:[e.jsx(Kn,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ks,{dataKey:"month",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ss,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Hn,{content:e.jsx(Xn,{})}),e.jsx(pe,{type:"monotone",dataKey:"revenue",stroke:"var(--color-revenue)",strokeWidth:2,dot:{fill:"var(--color-revenue)",r:4}}),e.jsx(pe,{type:"monotone",dataKey:"expenses",stroke:"var(--color-expenses)",strokeWidth:2,dot:{fill:"var(--color-expenses)",r:4}})]})})})]})]})}const Ot="insertClient",Bt=()=>{const[{fetching:s},n]=be(Hs),t=N.useCallback(async a=>{const i=`Error creating client [${a.fields.businessId}]`,l=`${Ot}-${a.fields.businessId}`;B.loading("Creating Client...",{id:l});try{const c=await n(a),r=we(c,i,l,"insertClient");if(r)return B.success("Success",{id:l,description:`Client [${a.fields.businessId}] was created`}),r.insertClient}catch(c){console.error(`${i}: ${c}`),B.error("Error",{id:l,description:i,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,insertClient:t}},Lt="updateClient",_s=()=>{const[{fetching:s},n]=be(Xs),t=N.useCallback(async a=>{const i=`Error updating client ID [${a.businessId}]`,l=`${Lt}-${a.businessId}`;B.loading("Updating client",{id:l});try{const c=await n(a),r=we(c,i,l,"updateClient");if(r)return B.success("Success",{id:l,description:"Client updated"}),r.updateClient}catch(c){console.error(`${i}: ${c}`),B.error("Error",{id:l,description:i,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateClient:t}},Vt=Pe({id:Re().optional(),emails:Me(Ue()).optional(),generatedDocumentType:re(Object.values(ue)),greenInvoiceId:Re().optional(),hiveId:V().optional()});function _t({client:s,businessId:n,onDone:t}){const[a,i]=N.useState(!1),[l,c]=N.useState(null),{updateClient:r}=_s(),{insertClient:o}=Bt(),[d,x]=N.useState(""),u={id:n,generatedDocumentType:ue.Proforma,emails:[]},h=Ie({resolver:Ee(Vt),defaultValues:s||u});N.useEffect(()=>{s&&(c(s),h.reset({emails:s.emails,greenInvoiceId:s.greenInvoiceId,hiveId:s.hiveId,generatedDocumentType:s.generatedDocumentType,id:s.id}),i(!0))},[s,h]);const A=()=>{c(null),h.reset(u),i(!0)},m=()=>{if(d.trim()){const b=h.getValues("emails");h.setValue("emails",[...b??[],d.trim()],{shouldDirty:!0}),x("")}},p=b=>{const S=h.getValues("emails");h.setValue("emails",(S??[]).filter((_,R)=>R!==b),{shouldDirty:!0})},k=N.useCallback(async b=>{if(l)r({businessId:n,fields:b});else{if(!b.greenInvoiceId){h.setError("greenInvoiceId",{message:"Green Invoice ID is required"});return}o({fields:{...b,greenInvoiceId:b.greenInvoiceId,businessId:n}})}i(!1),c(null),t?.()},[l,t,r,n,o,h]);return e.jsxs(Je,{open:a,onOpenChange:i,children:[e.jsx(es,{asChild:!0,children:e.jsxs(E,{size:"sm",onClick:A,children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"New Client"]})}),e.jsxs(ss,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ns,{children:[e.jsx(ts,{children:l?"Edit Client":"Create New Client"}),e.jsx(as,{children:l?"Update client details":"Add a new client with all required details"})]}),e.jsx(De,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(k),children:[e.jsx("div",{className:"grid gap-4 py-4",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(j,{control:h.control,name:"emails",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Emails"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{placeholder:"Add email...",value:d,onChange:S=>x(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),m())}}),e.jsx(E,{type:"button",size:"sm",onClick:m,children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:b.value?.map((S,_)=>e.jsxs(q,{variant:"secondary",className:"gap-1",children:[S,e.jsx(E,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>p(_),children:e.jsx(he,{className:"size-3 cursor-pointer"})})]},_))}),e.jsx(C,{})]})}),e.jsx(j,{control:h.control,name:"generatedDocumentType",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Default Document Type"}),e.jsxs(le,{onValueChange:b.onChange,defaultValue:b.value,children:[e.jsx(y,{children:e.jsx(ce,{children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.values(ue).map(S=>e.jsx(me,{value:S,children:rs(S)},S))})]}),e.jsx(C,{})]})}),e.jsx(j,{control:h.control,name:"greenInvoiceId",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Green Invoice ID"}),e.jsx(y,{children:e.jsx(T,{type:"text",placeholder:"Enter Green Invoice ID",...b,required:!l})}),e.jsx(C,{})]})}),e.jsx(j,{control:h.control,name:"hiveId",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Hive ID"}),e.jsx(y,{children:e.jsx(T,{type:"text",placeholder:"Enter Hive ID",...b,required:!l})}),e.jsx(C,{})]})})]})}),e.jsxs(is,{children:[e.jsx(E,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(E,{type:"submit",children:l?"Update Client":"Create Client"})]})]})})]})]})}const Ft=Object.values(tn);function vs(s){return!s||s.__typename!=="LtdFinancialEntity"?{}:{isClient:!!s.clientInfo?.id,isActive:s.isActive,isReceiptEnough:s.isReceiptEnough??void 0,isDocumentsOptional:s.isDocumentsOptional??void 0,isVatOptional:s.optionalVAT??void 0,isExemptDealer:s.exemptDealer??void 0,sortCode:s.sortCode?.key?.toString()??void 0,taxCategory:s.taxCategory?.id??void 0,pcn874RecordType:s?.pcn874RecordType??void 0,irsCode:s?.irsCode??void 0,description:s.suggestions?.description??void 0,tags:s.suggestions?.tags?.map(n=>n.id)??[],phrases:s.suggestions?.phrases??[],emails:s.suggestions?.emails??[],internalLinks:s.suggestions?.emailListener?.internalEmailLinks??[],attachmentTypes:s.suggestions?.emailListener?.attachments??[],useMessageBody:s.suggestions?.emailListener?.emailBody??void 0}}function $t(s){const t=s.internalLinks||s.useMessageBody||s.attachmentTypes?{internalEmailLinks:s.internalLinks,emailBody:s.useMessageBody,attachments:s.attachmentTypes}:void 0,i=s.description||s.tags||s.phrases||s.emails||t?{description:s.description,tags:s.tags?.map(l=>({id:l})),phrases:s.phrases,emails:s.emails,emailListener:t}:void 0;return{optionalVAT:s.isVatOptional,exemptDealer:s.isExemptDealer,sortCode:s.sortCode?parseInt(s.sortCode):void 0,taxCategory:s.taxCategory,pcn874RecordType:s.pcn874RecordType,irsCode:s.irsCode,isActive:s.isActive,isReceiptEnough:s.isReceiptEnough,isDocumentsOptional:s.isDocumentsOptional,suggestions:i}}function Rt({data:s,refetchBusiness:n}){const t=je(Qs,s),[a,i]=N.useState(vs(t)),{userContext:l}=N.useContext(Ze),{updateBusiness:c,fetching:r}=Ts(),[o,d]=N.useState(!1),[x,u]=N.useState(void 0),h=Ie({defaultValues:a}),A=async p=>{if(!t||!l?.context.adminBusinessId)return;const k=Ye(p,h.formState.dirtyFields);if(!k)return;const b=$t(k);await c({businessId:t.id,ownerId:l.context.adminBusinessId,fields:b}),k.tags?.length||k.description?(u({tagIds:k.tags?.map(S=>({id:S})),description:k.description}),d(!0)):n?.()};if(N.useEffect(()=>{if(t){const p=vs(t);i(p),h.reset(p)}},[t,h]),!t)return e.jsx("div",{});const m=h.watch("isClient");return e.jsxs(W,{children:[e.jsx(K,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(H,{children:"Configurations"}),e.jsx(X,{children:"Business status, tax settings, automation rules, and integration preferences"})]}),!m&&e.jsx(_t,{businessId:t.id,onDone:n})]})}),e.jsx(De,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(A),children:[e.jsxs(Q,{className:"space-y-6",children:[e.jsx(Mt,{form:h}),e.jsx(Le,{}),e.jsx(Ut,{form:h}),e.jsx(Le,{}),e.jsx(zt,{form:h}),e.jsx(Le,{}),e.jsx(qt,{form:h})]}),e.jsx(Qe,{className:"flex justify-end border-t pt-6",children:e.jsxs(E,{type:"submit",disabled:r||Object.keys(h.formState.dirtyFields).length===0,children:[e.jsx(os,{className:"h-4 w-4 mr-2"}),"Save Changes"]})})]})}),e.jsx(Qn,{businessId:t.id,tagIds:x?.tagIds,description:x?.description,open:o,onOpenChange:d,onClose:n})]})}function Mt({form:s}){return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Business Status & Behavior"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{control:s.control,name:"isClient",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Is Client"}),e.jsx(se,{children:"Mark this business as a client"})]}),e.jsx(y,{children:e.jsx(J,{disabled:!0,checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})}),e.jsx(j,{control:s.control,name:"isActive",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Is Active"}),e.jsx(se,{children:"Business is currently active"})]}),e.jsx(y,{children:e.jsx(J,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})}),e.jsx(j,{control:s.control,name:"isReceiptEnough",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Is Receipt Enough"}),e.jsx(se,{children:"Generate ledger for receipt documents if no invoice available"})]}),e.jsx(y,{children:e.jsx(J,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})}),e.jsx(j,{control:s.control,name:"isDocumentsOptional",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"No Docs Required"}),e.jsx(se,{children:"Skip document validation for common charges"})]}),e.jsx(y,{children:e.jsx(J,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})}),e.jsx(j,{control:s.control,name:"isVatOptional",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Is VAT Optional"}),e.jsx(se,{children:"Mute missing VAT indicator"})]}),e.jsx(y,{children:e.jsx(J,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})}),e.jsx(j,{control:s.control,name:"isExemptDealer",render:({field:n,fieldState:t})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Is Exempt Dealer"}),e.jsx(se,{children:"Business is exempt from VAT requirements"})]}),e.jsx(y,{children:e.jsx(J,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})})]})]})}function Ut({form:s}){const{selectableTaxCategories:n,fetching:t}=Ys(),{selectableSortCodes:a,fetching:i,sortCodes:l}=Zs(),{selectableTags:c,fetching:r}=Js(),o=N.useCallback(d=>{if(d){const x=l.find(u=>Number(u.key)===Number(d));x&&(x.defaultIrsCode?s.setValue("irsCode",x.defaultIrsCode,{shouldDirty:!0}):s.setValue("irsCode",null,{shouldDirty:!0}))}},[s,l]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Default Settings"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(j,{control:s.control,name:"sortCode",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Sort Code"}),e.jsx(y,{children:e.jsx(ze,{onChange:u=>{o(u),d.onChange(u)},data:a,value:d.value,disabled:i,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(x)}})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"taxCategory",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tax Category"}),e.jsx(y,{children:e.jsx(ze,{data:n,disabled:t,value:d.value,onChange:d.onChange,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(x)}})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"pcn874RecordType",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"PCN874 Record Type"}),e.jsxs(le,{onValueChange:d.onChange,value:d.value,children:[e.jsx(y,{children:e.jsx(ce,{className:I(x),children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.entries(en).map(([u,h])=>e.jsx(me,{value:u,children:`${h} (${u})`},u))})]}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"irsCode",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"IRS Code"}),e.jsx(y,{children:e.jsx(sn,{value:d.value??void 0,onValueChange:u=>d.onChange(u??null),hideControls:!0,decimalScale:0,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"description",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Charge Description"}),e.jsx(y,{children:e.jsx(T,{placeholder:"Enter default charge description",...d,className:I(x)})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"tags",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tags"}),e.jsx(y,{children:e.jsx(nn,{options:Object.values(c).map(({value:u,label:h})=>({label:h,value:u})),onValueChange:d.onChange,defaultValue:d.value,value:d.value,placeholder:"Select Default Tags",variant:"default",disabled:r,className:I(x)})}),e.jsx(C,{})]})})]})]})}function zt({form:s}){const[n,t]=N.useState(""),[a,i]=N.useState(""),l=()=>{if(n.trim()){const d=s.getValues("phrases");s.setValue("phrases",[...d,n.trim()],{shouldDirty:!0}),t("")}},c=()=>{if(a.trim()){const d=s.getValues("emails");s.setValue("emails",[...d,a.trim()],{shouldDirty:!0}),i("")}},r=d=>{const x=s.getValues("phrases");s.setValue("phrases",x.filter((u,h)=>h!==d),{shouldDirty:!0})},o=d=>{const x=s.getValues("emails");s.setValue("emails",x.filter((u,h)=>h!==d),{shouldDirty:!0})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Auto-matching Configuration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure patterns for automatic matching of bank transactions and documents"}),e.jsx(j,{control:s.control,name:"phrases",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Phrases"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{placeholder:"Add phrase...",value:n,onChange:u=>t(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),l())},className:I(x)}),e.jsx(E,{type:"button",size:"sm",onClick:l,children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.value?.map((u,h)=>e.jsxs(q,{variant:"secondary",className:"gap-1",children:[u,e.jsx(E,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>r(h),children:e.jsx(he,{className:"size-3 cursor-pointer",onClick:()=>r(h)})})]},h))}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"emails",render:({field:d,fieldState:x})=>e.jsxs(g,{children:[e.jsx(f,{children:"Email Addresses"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{type:"email",placeholder:"Add email...",value:a,onChange:u=>i(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),c())},className:I(x)}),e.jsx(E,{type:"button",size:"sm",onClick:c,children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.value?.map((u,h)=>e.jsxs(q,{variant:"secondary",className:"gap-1",children:[u,e.jsx(E,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>o(h),children:e.jsx(he,{className:"size-3 cursor-pointer"})})]},h))}),e.jsx(C,{})]})})]})}function qt({form:s}){const[n,t]=N.useState(""),a=()=>{if(n.trim()){const c=s.getValues("internalLinks");s.setValue("internalLinks",[...c,n.trim()],{shouldDirty:!0}),t("")}},i=c=>{const r=s.getValues("attachmentTypes");s.setValue("attachmentTypes",r?.includes(c)?r.filter(o=>o!==c):[...r,c],{shouldDirty:!0})},l=c=>{const r=s.getValues("internalLinks");s.setValue("internalLinks",r.filter((o,d)=>d!==c),{shouldDirty:!0})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Gmail Feature Configuration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure Gmail integration settings for document processing"}),e.jsx(j,{control:s.control,name:"attachmentTypes",render:({field:c,fieldState:r})=>e.jsxs(g,{children:[e.jsx(f,{children:"Attachment Types"}),e.jsx("div",{className:I(r)+" rounded-md flex flex-wrap gap-2",children:Ft.map(o=>e.jsx(q,{variant:c.value?.includes(o)?"default":"outline",className:"cursor-pointer",onClick:()=>i(o),children:o},o))}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"internalLinks",render:({field:c,fieldState:r})=>e.jsxs(g,{children:[e.jsx(f,{children:"Internal Links"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{type:"url",placeholder:"Add internal link...",value:n,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),a())}}),e.jsx(E,{type:"button",size:"sm",onClick:a,children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("div",{className:I(r)+" flex flex-wrap gap-2 rounded-md",children:c.value?.map((o,d)=>e.jsxs(q,{variant:"secondary",className:"gap-1 max-w-xs truncate",children:[o,e.jsx(E,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>l(d),children:e.jsx(he,{className:"size-3 cursor-pointer flex-shrink-0"})})]},d))}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"useMessageBody",render:({field:c,fieldState:r})=>e.jsxs(g,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(f,{children:"Should Use Message Body"}),e.jsx(se,{children:"Extract information from email message body"})]}),e.jsx(y,{children:e.jsx(J,{checked:c.value,onCheckedChange:c.onChange,className:I(r)})})]})})]})}const Gt=Pe({businessName:V().min(1,"Business name is required"),locality:V().min(1,"Locality is required"),localName:V().optional(),govId:V().optional(),address:V().optional(),localAddress:V().optional(),phone:V().optional(),website:bs("Invalid URL").optional().or(ws("")),generalContacts:Me(Ue()).optional(),billingEmails:Me(Ue()).optional()});function ys(s){return!s||s.__typename!=="LtdFinancialEntity"?{}:{businessName:s.name,locality:s.country,localName:s.hebrewName??void 0,govId:s.governmentId??void 0,address:s.address??void 0,phone:s.phoneNumber??void 0,website:s.website??void 0,generalContacts:s.email?.split(",").map(n=>n.trim()),billingEmails:s.clientInfo?.emails}}function Wt(s){return{name:s.businessName,country:s.locality,hebrewName:s.localName,governmentId:s.govId,address:s.address,phoneNumber:s.phone,website:s.website,email:s.generalContacts?.join(", ")}}function Kt({data:s,refetchBusiness:n}){const t=je(ln,s),[a,i]=N.useState(ys(t)),{userContext:l}=N.useContext(Ze),{updateBusiness:c,fetching:r}=Ts(),o=Ie({resolver:Ee(Gt),defaultValues:a}),{countries:d,fetching:x}=an(),[u,h]=N.useState(""),[A,m]=N.useState(""),p=o.watch("locality"),k=o.watch("address"),b=o.watch("localAddress");N.useEffect(()=>{k!==a.address&&o.setValue("address",k,{shouldDirty:!0})},[k,a.address,o]),N.useEffect(()=>{b!==a.localAddress&&o.setValue("localAddress",b,{shouldDirty:!0})},[b,a.localAddress,o]);const S=t&&"clientInfo"in t&&!!t.clientInfo,_=p===l?.context.locality,R=v=>{u.trim()&&(o.setValue("generalContacts",[...v,u.trim()],{shouldDirty:!0}),h(""))},$=(v,w)=>{o.setValue("generalContacts",v.filter((P,O)=>O!==w),{shouldDirty:!0})},Y=v=>{A.trim()&&(o.setValue("billingEmails",[...v,A.trim()],{shouldDirty:!0}),m(""))},U=(v,w)=>{o.setValue("billingEmails",v.filter((P,O)=>O!==w),{shouldDirty:!0})},ne=async v=>{if(!t||!l?.context.adminBusinessId)return;const w=Ye(v,o.formState.dirtyFields);if(!w)return;const P=Wt(w);await c({businessId:t.id,ownerId:l.context.adminBusinessId,fields:P}),n?.()};return N.useEffect(()=>{if(t){const v=ys(t);i(v),o.reset(v)}},[t,o]),e.jsxs(W,{children:[e.jsxs(K,{children:[e.jsx(H,{children:"Contact Information"}),e.jsx(X,{children:"Business contact details and address information"})]}),e.jsx(De,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(ne),children:[e.jsx(Q,{children:e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsx(j,{control:o.control,name:"businessName",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsx(f,{children:"Business Name"}),e.jsx(y,{children:e.jsx(T,{...v,className:I(w)})}),e.jsx(C,{})]})}),e.jsx(j,{control:o.control,name:"locality",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsx(f,{children:"Locality / Country"}),e.jsx(ze,{onChange:v.onChange,data:d.map(P=>({value:P.code,label:P.name})),value:v.value,disabled:x,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(w)}}),e.jsx(C,{})]})}),_&&e.jsx(j,{control:o.control,name:"localName",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsx(f,{children:"Local Name"}),e.jsx(y,{children:e.jsx(T,{...v,placeholder:"Business name in local language",className:I(w)})}),e.jsx(C,{})]})}),_&&e.jsx(j,{control:o.control,name:"govId",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsx(f,{children:"Government ID"}),e.jsx(y,{children:e.jsx(T,{...v,placeholder:"Enter Government ID",className:I(w)})}),e.jsx(C,{})]})}),e.jsx(j,{control:o.control,name:"address",render:({field:v,fieldState:w})=>e.jsxs(g,{className:"md:col-span-2",children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4"}),"Address"]}),e.jsx(y,{children:e.jsx(qe,{...v,rows:3,placeholder:"Enter business address",className:I(w)})}),e.jsx(C,{})]})}),_&&e.jsx(j,{control:o.control,name:"localAddress",render:({field:v,fieldState:w})=>e.jsxs(g,{className:"md:col-span-2",children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4"}),"Local Address"]}),e.jsx(y,{children:e.jsx(qe,{...v,rows:3,placeholder:"Enter address in local language",className:I(w)})}),e.jsx(C,{})]})}),e.jsx(j,{control:o.control,name:"phone",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),"Phone"]}),e.jsx(y,{children:e.jsx(T,{...v,type:"tel",placeholder:"+1 (555) 123-4567",className:I(w)})}),e.jsx(C,{})]})}),e.jsx(j,{control:o.control,name:"website",render:({field:v,fieldState:w})=>e.jsxs(g,{children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(rn,{className:"h-4 w-4"}),"Website"]}),e.jsx(y,{children:e.jsx(T,{...v,type:"url",placeholder:"https://example.com",className:I(w)})}),e.jsx(C,{})]})}),e.jsx(j,{control:o.control,name:"generalContacts",render:({field:v,fieldState:w})=>e.jsxs(g,{className:"md:col-span-2",children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),"General Contacts"]}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:I(w)+" flex flex-wrap gap-2 mb-2 rounded-md",children:v.value?.map((P,O)=>e.jsxs(q,{variant:"secondary",className:"gap-1 pr-1",children:[P,e.jsx("button",{type:"button",onClick:()=>$(v.value??[],O),className:"ml-1 hover:bg-muted rounded-sm p-0.5",children:e.jsx(he,{className:"h-3 w-3"})})]},O))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{value:u,onChange:P=>h(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),R(v.value??[]))},placeholder:"Add contact email",type:"email"}),e.jsx(E,{type:"button",variant:"outline",size:"icon",disabled:!u.trim(),onClick:()=>R(v.value??[]),children:e.jsx(G,{className:"h-4 w-4"})})]})]})}),e.jsx(C,{})]})}),S&&e.jsx(j,{control:o.control,name:"billingEmails",render:({field:v,fieldState:w})=>e.jsxs(g,{className:"md:col-span-2",children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),"Billing Emails"]}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:I(w)+" flex flex-wrap gap-2 mb-2 rounded-md",children:v.value?.map((P,O)=>e.jsxs(q,{variant:"secondary",className:"gap-1 pr-1",children:[P,e.jsx("button",{type:"button",onClick:()=>U(v.value??[],O),className:"ml-1 hover:bg-muted rounded-sm p-0.5",children:e.jsx(he,{className:"h-3 w-3"})})]},O))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{value:A,onChange:P=>m(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),Y(v.value??[]))},placeholder:"Add billing email",type:"email"}),e.jsx(E,{type:"button",variant:"outline",size:"icon",disabled:!A.trim(),onClick:()=>Y(v.value??[]),children:e.jsx(G,{className:"h-4 w-4"})})]})]})}),e.jsx(C,{})]})})]})}),e.jsx(Qe,{className:"flex justify-end border-t mt-4 pt-6",children:e.jsxs(E,{type:"submit",disabled:r||Object.keys(o.formState.dirtyFields).length===0,children:[e.jsx(os,{className:"h-4 w-4 mr-2"}),"Save Changes"]})})]})})]})}const Ht="createContract",Xt=()=>{const[{fetching:s},n]=be(cn),t=N.useCallback(async a=>{const i=`Error creating new contract for client[${a.input.clientId}]`,l=`${Ht}-${a.input.clientId}`;B.loading("Creating contract",{id:l});try{const c=await n(a);we(c,i,l)&&B.success("Success",{id:l,description:`Contract for client ${a.input.clientId} was successfully created`})}catch(c){console.error(`${i}: ${c}`),B.error("Error",{id:l,description:i,duration:1e5,closeButton:!0})}},[n]);return{creating:s,createContract:t}},Qt="updateContract",Yt=()=>{const[{fetching:s},n]=be(on),t=N.useCallback(async a=>{const i=`Error updating contract ID [${a.contractId}]`,l=`${Qt}-${a.contractId}`;B.loading("Updating contract",{id:l});try{const c=await n(a),r=we(c,i,l,"updateContract");if(r)return B.success("Success",{id:l,description:"Contract updated"}),r.updateContract}catch(c){console.error(`${i}: ${c}`),B.error("Error",{id:l,description:i,duration:1e5,closeButton:!0})}},[n]);return{updating:s,updateContract:t}},Zt=Pe({id:Re().optional(),startDate:ms("Start date is required"),endDate:ms("End date is required"),po:V().optional(),paymentAmount:Cs().min(0,"Payment amount must be non-negative"),paymentCurrency:re(Object.values(ls),"Currency is required"),productType:re(Object.values(Is)).optional(),msCloudLink:bs().optional().or(ws("")),billingCycle:re(Object.values(Ce)).optional(),subscriptionPlan:re(Object.values(Se)).optional(),isActive:dn(),defaultRemark:V().optional(),defaultDocumentType:re(Object.values(ue))}),Ns={startDate:"",endDate:"",po:void 0,paymentAmount:0,paymentCurrency:ls.Usd,productType:Is.Hive,msCloudLink:void 0,billingCycle:Ce.Monthly,subscriptionPlan:void 0,isActive:!0,defaultRemark:void 0,defaultDocumentType:ue.Proforma};function Jt({clientId:s,contract:n,onDone:t}){const[a,i]=N.useState(!1),[l,c]=N.useState(null),{updateContract:r,updating:o}=Yt(),{createContract:d,creating:x}=Xt(),u=Ie({resolver:Ee(Zt),defaultValues:n||Ns});N.useEffect(()=>{n&&(c(n),u.reset({startDate:n.startDate,endDate:n.endDate,po:n.po,paymentAmount:n.paymentAmount,paymentCurrency:n.paymentCurrency,productType:n.productType,msCloudLink:n.msCloudLink,billingCycle:n.billingCycle,subscriptionPlan:n.subscriptionPlan,isActive:n.isActive,defaultRemark:n.defaultRemark,defaultDocumentType:n.defaultDocumentType}),i(!0))},[n,u]);const h=()=>{c(null),u.reset(Ns),i(!0)},A=N.useCallback(async m=>{if(l)await r({contractId:l.id,input:{amount:{raw:m.paymentAmount,currency:m.paymentCurrency},billingCycle:m.billingCycle,documentType:m.defaultDocumentType,endDate:ie(new Date(m.endDate),"yyyy-MM-dd"),isActive:m.isActive,msCloud:m.msCloudLink,plan:m.subscriptionPlan,product:m.productType,purchaseOrder:m.po,remarks:m.defaultRemark,startDate:ie(new Date(m.startDate),"yyyy-MM-dd")}});else{if(!m.billingCycle){u.setError("billingCycle",{message:"Billing cycle is required"});return}await d({input:{clientId:s,amount:{raw:m.paymentAmount,currency:m.paymentCurrency},billingCycle:m.billingCycle,documentType:m.defaultDocumentType,endDate:ie(new Date(m.endDate),"yyyy-MM-dd"),isActive:m.isActive,msCloud:m.msCloudLink,plan:m.subscriptionPlan,product:m.productType,purchaseOrder:m.po,remarks:m.defaultRemark,startDate:ie(new Date(m.startDate),"yyyy-MM-dd")}})}i(!1),c(null),t?.()},[l,t,d,r,s,u]);return e.jsxs(Je,{open:a,onOpenChange:i,children:[e.jsx(es,{asChild:!0,children:e.jsxs(E,{size:"sm",onClick:h,children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"New Contract"]})}),e.jsxs(ss,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ns,{children:[e.jsx(ts,{children:l?"Edit Contract":"Create New Contract"}),e.jsx(as,{children:l?"Update contract details":"Add a new contract with all required details"})]}),e.jsx(De,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(A),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.jsx(j,{control:u.control,name:"po",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"PO Number"}),e.jsx(y,{children:e.jsx(T,{placeholder:"PO-2024-001",...m})}),e.jsx(C,{})]})})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(j,{control:u.control,name:"startDate",render:({field:{onChange:m,...p}})=>e.jsxs(g,{children:[e.jsx(f,{children:"Start Date"}),e.jsx(y,{children:e.jsx(T,{type:"date",...p,onInput:k=>m(k)})}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"endDate",render:({field:{onChange:m,...p}})=>e.jsxs(g,{children:[e.jsx(f,{children:"End Date"}),e.jsx(y,{children:e.jsx(T,{type:"date",...p,onInput:k=>m(k)})}),e.jsx(C,{})]})})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsx(j,{control:u.control,name:"paymentAmount",render:({field:m})=>e.jsxs(g,{className:"md:col-span-2",children:[e.jsx(f,{children:"Payment Amount"}),e.jsx(y,{children:e.jsx(T,{type:"number",placeholder:"24000",...m,onChange:p=>{m.onChange(p?.target.value?Number(p?.target.value):void 0)}})}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"paymentCurrency",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Currency"}),e.jsxs(le,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(y,{children:e.jsx(ce,{children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.values(ls).map(p=>e.jsx(me,{value:p,children:p},p))})]}),e.jsx(C,{})]})})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(j,{control:u.control,name:"productType",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Product Type"}),e.jsx(y,{children:e.jsx(T,{placeholder:"Cloud Services",...m})}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"billingCycle",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Billing Cycle"}),e.jsxs(le,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(y,{children:e.jsx(ce,{children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.values(Ce).map(p=>e.jsx(me,{value:p,children:Os(p)},p))})]}),e.jsx(C,{})]})})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(j,{control:u.control,name:"subscriptionPlan",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Subscription Plan"}),e.jsx(y,{children:e.jsxs(le,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(y,{children:e.jsx(ce,{children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.values(Se).map(p=>e.jsx(me,{value:p,children:Bs(p)},p))})]})}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"isActive",render:({field:m})=>e.jsxs(g,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(f,{className:"text-base",children:"Active Status"})}),e.jsx(y,{children:e.jsx(J,{checked:m.value,onCheckedChange:m.onChange})})]})})]}),e.jsx(j,{control:u.control,name:"msCloudLink",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"MS Cloud Link"}),e.jsx(y,{children:e.jsx(T,{type:"url",placeholder:"https://portal.azure.com/contract-id",...m})}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"defaultDocumentType",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Default Document Type"}),e.jsxs(le,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(y,{children:e.jsx(ce,{children:e.jsx(oe,{})})}),e.jsx(de,{children:Object.values(ue).map(p=>e.jsx(me,{value:p,children:rs(p)},p))})]}),e.jsx(C,{})]})}),e.jsx(j,{control:u.control,name:"defaultRemark",render:({field:m})=>e.jsxs(g,{children:[e.jsx(f,{children:"Default Remark"}),e.jsx(y,{children:e.jsx(qe,{placeholder:"Enter default remark for this contract...",rows:3,...m})}),e.jsx(C,{})]})})]}),e.jsxs(is,{children:[e.jsx(E,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(E,{type:"submit",disabled:x||o,children:l?"Update Contract":"Create Contract"})]})]})})]})]})}function ea(s){return{id:s.id,po:s.purchaseOrder??void 0,startDate:s.startDate,endDate:s.endDate,paymentAmount:s.amount.raw,paymentCurrency:s.amount.currency,productType:s.product??void 0,billingCycle:s.billingCycle,msCloudLink:s.msCloud?.toString(),isActive:s.isActive,subscriptionPlan:s.plan??void 0,defaultRemark:s.remarks??void 0,defaultDocumentType:s.documentType??void 0}}function sa({clientId:s}){const[n,t]=N.useState(null),[{data:a,fetching:i},l]=Oe({query:mn,variables:{clientId:s}}),c=a?.contractsByClient??[];return i?e.jsx("div",{children:"Loading contracts..."}):e.jsxs(W,{children:[e.jsx(K,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(H,{children:"Contracts"}),e.jsx(X,{children:"Current and past contracts sorted by start date"})]}),e.jsx(Jt,{clientId:s,contract:n,onDone:l})]})}),e.jsx(Q,{className:"space-y-4",children:c.map(r=>{const o=!!r.isActive;return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-semibold",children:r.product}),e.jsx(q,{variant:o?"default":"secondary",children:r.isActive?"Active":"Inactive"})]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:r.id})]}),e.jsx(E,{variant:"ghost",size:"sm",onClick:()=>t(ea(r)),children:e.jsx(Yn,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(un,{className:"h-3 w-3"}),"Contract Period"]}),e.jsxs("p",{className:"text-sm font-medium",children:[new Date(r.startDate).toLocaleDateString()," →"," ",new Date(r.endDate).toLocaleDateString()]})]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"PO Number"}),e.jsx("p",{className:"text-sm font-medium font-mono",children:r.purchaseOrder})]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Payment"}),e.jsx("p",{className:"text-sm font-medium",children:hn(r.amount.raw,r.amount.currency)})]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Billing Cycle"}),e.jsx("p",{className:"text-sm font-medium",children:Os(r.billingCycle)})]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Subscription Plan"}),e.jsx("p",{className:"text-sm font-medium",children:r.plan?Bs(r.plan):"N/A"})]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Document Type"}),e.jsx("p",{className:"text-sm font-medium",children:rs(r.documentType)})]})]}),r.remarks&&e.jsxs("div",{className:"space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remark"}),e.jsx("p",{className:"text-sm",children:r.remarks})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.msCloud&&e.jsx(E,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:r.msCloud.toString(),target:"_blank",rel:"noopener noreferrer",children:[e.jsx(xn,{className:"h-4 w-4 mr-2"}),"MS Cloud",e.jsx(pn,{className:"h-3 w-3 ml-1"})]})})})]},r.id)})})]})}function na({businessId:s}){return e.jsxs(W,{children:[e.jsx(K,{children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx(H,{children:"Documents"}),e.jsx(X,{children:"Invoices, proformas, receipts, and other accounting documents"})]})})}),e.jsx(Q,{children:e.jsx(jn,{businessId:s,linkedDocumentIds:[],limit:1e3})})]})}const ta=[{id:"hive",name:"Hive",description:"Schema registry, analytics, metrics and gateway for GraphQL federation and other GraphQL APIs",status:"disconnected",lastSync:"Never"},{id:"slack",name:"Slack",description:"Team communication and notifications",status:"disconnected",lastSync:"Never"},{id:"retool",name:"Retool",description:"Internal tools and dashboards",status:"disconnected",lastSync:"Never"},{id:"linear",name:"Linear",description:"Issue tracking and project management",status:"disconnected",lastSync:"Never"},{id:"workflowy",name:"Workflowy",description:"Task management and note taking",status:"disconnected",lastSync:"Never"}];function aa({data:s}){const n=je(vn,s),[{data:t,fetching:a},i]=Oe({query:gn,variables:{clientId:n?.id??""},pause:!n?.clientInfo?.greenInvoiceId||!n?.id}),{updateClient:l}=_s(),c=N.useCallback((o,d)=>{if(!n?.id)return;const x={};x[d]=o,l({businessId:n?.id,fields:x})},[n?.id,l]);N.useEffect(()=>{n?.clientInfo?.greenInvoiceId&&n?.id&&i()},[n?.clientInfo?.greenInvoiceId,n?.id,i]);const r=t?.greenInvoiceClient;return e.jsxs(W,{children:[e.jsx(K,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(H,{children:"Integrations"}),e.jsx(X,{children:"Connected external services and providers"})]}),e.jsxs(E,{size:"sm",children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"Add Integration"]})]})}),e.jsx(Q,{className:"space-y-6",children:e.jsxs(Zn,{type:"multiple",defaultValue:["green-invoice"],className:"space-y-4",children:[a?e.jsxs(_e,{value:"green-invoice",className:"rounded-lg border-2 border-green-600/20 bg-green-600/5",children:[e.jsx("div",{className:"px-4 py-3 bg-green-600/10 rounded-t-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx(D,{className:"h-10 w-10 rounded-lg"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-32"}),e.jsx(D,{className:"h-5 w-5 rounded-full"})]}),e.jsx(D,{className:"h-4 w-64"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-8 w-24"}),e.jsx(D,{className:"h-8 w-8"})]})]})}),e.jsx(Fe,{children:e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(D,{className:"h-4 w-40"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(D,{className:"h-4 w-40"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-32"}),e.jsx(D,{className:"h-6 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(D,{className:"h-4 w-40"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-3 w-24"}),e.jsx(D,{className:"h-4 w-full"})]})]})]})]})})]}):e.jsxs(_e,{value:"green-invoice",className:"rounded-lg border-2 border-green-600/20 bg-green-600/5",children:[e.jsx("div",{className:"px-4 py-3 bg-green-600/10 rounded-t-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-green-600 flex items-center justify-center text-white font-bold",children:"GI"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold text-lg",children:"Green Invoice"}),e.jsx(xs,{className:"h-5 w-5 text-green-600"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Israeli invoicing system integration"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ra,{id:n?.clientInfo?.greenInvoiceId,provider:"Green Invoice",updateClient:async o=>c(o,"greenInvoiceId")}),e.jsx(hs,{className:"hover:no-underline p-2"})]})]})}),e.jsx(Fe,{children:r&&e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase tracking-wide",children:"Business Information"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Integration ID"}),e.jsx("p",{className:"text-sm font-mono",children:n?.clientInfo?.greenInvoiceId})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Business Name"}),e.jsx("p",{className:"text-sm",children:r.name})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Country"}),e.jsx("p",{className:"text-sm",children:r.country})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Tax ID"}),e.jsx("p",{className:"text-sm font-mono",children:r.taxId})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase tracking-wide",children:"Contact Information"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(Ge,{className:"h-3.5 w-3.5"}),"Email Addresses"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.emails?.map((o,d)=>e.jsx("span",{className:"text-sm px-2 py-1 bg-muted rounded",children:o},d))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(Es,{className:"h-3.5 w-3.5"}),"Phone"]}),e.jsx("p",{className:"text-sm font-mono",children:r.phone})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Mobile"}),e.jsx("p",{className:"text-sm font-mono",children:r.mobile})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Fax"}),e.jsx("p",{className:"text-sm font-mono",children:r.fax})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h4",{className:"font-semibold text-sm text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:[e.jsx(Ke,{className:"h-3.5 w-3.5"}),"Address"]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Street Address"}),e.jsx("p",{className:"text-sm",children:r.address})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"City"}),e.jsx("p",{className:"text-sm",children:r.city})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Zip Code"}),e.jsx("p",{className:"text-sm font-mono",children:r.zip})]})]})]})]})})]}),ta.map(o=>e.jsxs(_e,{value:o.id,className:"rounded-lg border",children:[e.jsx("div",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-3 flex-1",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-semibold",children:o.name}),o.status==="connected"?e.jsx(xs,{className:"h-4 w-4 text-green-600"}):e.jsx(fn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.description})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{variant:"ghost",size:"sm",onClick:d=>d.stopPropagation(),children:e.jsx(cs,{className:"h-4 w-4"})}),e.jsx(hs,{className:"hover:no-underline p-2"})]})]})}),e.jsx(Fe,{children:e.jsx("div",{className:"px-4 pb-4 pt-2 border-t",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Last sync: "}),e.jsx("span",{className:"font-medium",children:o.lastSync})]})})})]},o.id))]})})]})}function ra({id:s,provider:n,updateClient:t}){const[a,i]=N.useState(!1),[l,c]=N.useState(s),r=N.useCallback(async()=>{await t(l),i(!1)},[l,t]);return e.jsxs(Je,{open:a,onOpenChange:i,children:[e.jsx(es,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",onClick:o=>o.stopPropagation(),children:[e.jsx(cs,{className:"h-4 w-4 mr-2"}),"Configure"]})}),e.jsxs(ss,{onClick:o=>o.stopPropagation(),children:[e.jsxs(ns,{children:[e.jsxs(ts,{children:["Configure ",n]}),e.jsxs(as,{children:["Update your ",n," integration settings"]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs(yn,{htmlFor:"id",children:[n," ID"]}),e.jsx(T,{id:"id",value:l,onChange:o=>c(o.target.value),placeholder:`Enter ${n} ID`})]})}),e.jsxs(is,{children:[e.jsx(E,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(E,{onClick:r,disabled:!l,children:"Save Changes"})]})]})]})}function ia({businessId:s}){return e.jsxs(W,{children:[e.jsx(K,{className:"flex w-full justify-between items-center",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx(H,{children:"Transactions"}),e.jsx(X,{children:"Complete transaction history for this business"})]})})}),e.jsx(Q,{children:e.jsx("div",{className:"rounded-md border",children:e.jsx(Nn,{businessID:s,filter:{}})})})]})}function la({data:s,refetchBusiness:n}){const t=je(An,s),[a,i]=Cn(),l=a.get("tab")||"contact",c=d=>{i({tab:d})};if(!t)return e.jsx("div",{children:"Business not found"});const r="clientInfo"in t&&!!t.clientInfo,o="adminInfo"in t&&!!t.adminInfo;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(pt,{data:t}),e.jsx("main",{className:"container mx-auto px-4 py-6 md:px-6 lg:px-8 max-w-7xl",children:e.jsxs(bn,{value:l,onValueChange:c,className:"w-full",children:[e.jsxs(wn,{className:"grid w-full lg:grid-cols-8 sm:grid-cols-4 grid-cols-8 mb-6 h-auto gap-1 bg-muted/50 p-1",children:[e.jsxs(Z,{value:"contact",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(Ds,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Contact"})]}),e.jsxs(Z,{value:"config",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(cs,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Config"})]}),e.jsxs(Z,{value:"charges",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(ke,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Charges"})]}),e.jsxs(Z,{value:"transactions",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(In,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Transactions"})]}),e.jsxs(Z,{value:"documents",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(Dn,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Documents"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(Z,{value:"contracts",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Contracts"})]}),e.jsxs(Z,{value:"integrations",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(it,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Integrations"})]})]}),o&&e.jsxs(Z,{value:"admin",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(Ps,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Admin"})]})]}),e.jsx(z,{value:"contact",className:"mt-0",children:e.jsx(Kt,{data:t,refetchBusiness:n})}),e.jsx(z,{value:"config",className:"mt-0",children:e.jsx(Rt,{data:t,refetchBusiness:n})}),e.jsx(z,{value:"charges",className:"mt-0",children:e.jsx(jt,{businessId:t.id})}),e.jsx(z,{value:"transactions",className:"mt-0",children:e.jsx(ia,{businessId:t.id})}),e.jsx(z,{value:"documents",className:"mt-0",children:e.jsx(na,{businessId:t.id})}),r&&e.jsxs(e.Fragment,{children:[e.jsx(z,{value:"contracts",className:"mt-0",children:e.jsx(sa,{clientId:t.id})}),e.jsx(z,{value:"integrations",className:"mt-0",children:e.jsx(aa,{data:t})}),e.jsx(z,{value:"charts",className:"mt-0",children:e.jsx(Pt,{})})]}),o&&e.jsx(z,{value:"admin",className:"mt-0",children:e.jsx(xt,{data:t})})]})})]})}function pa(s){return`/businesses/${s}`}const ja=()=>{const{businessId:s}=kn();let n;try{n=Sn()}catch{}const[{data:t,fetching:a},i]=Oe({query:En,pause:!s||!!n,variables:{businessId:s??""}}),l=n||t;return!n&&a&&!l?.business?e.jsx(Tn,{}):!s||!l?.business?e.jsx("div",{children:"Business not found"}):e.jsx(la,{data:l.business,refetchBusiness:async()=>i()})};export{ja as BusinessScreen,pa as getBusinessHref};
@@ -1 +1 @@
1
- import{bm as w,u as g,r as m,F as C,a as x,j as o,bq as y,n as T,br as h,bs as b,a_ as n,bd as F,bt as v}from"./index-CN7VPpiB.js";const I=({businessId:t})=>{const{businessId:r}=w(),{get:s}=g(),{setFiltersContext:u}=m.useContext(C),l=t||r,[c,d]=m.useState(s("transactionsFilters")?{...JSON.parse(decodeURIComponent(s("transactionsFilters"))),businessIDs:l?[l]:[]}:{businessIDs:l?[l]:[]}),[{data:i,fetching:f}]=x({query:v,variables:{filters:c}});m.useEffect(()=>{u(o.jsx(y,{filter:c,setFilter:d}))},[i,c,u,d]);const p=m.useMemo(()=>i?.businessTransactionsSumFromLedgerRecords.__typename==="CommonError"?[]:i?.businessTransactionsSumFromLedgerRecords.businessTransactionsSum?i.businessTransactionsSumFromLedgerRecords.businessTransactionsSum.sort((e,S)=>e.business.name.localeCompare(S.business.name)):[],[i?.businessTransactionsSumFromLedgerRecords]);return f?o.jsx(T,{}):o.jsx(h,{moreInfo:e=>o.jsx(F,{businessID:e.business.id,filter:c}),striped:!0,highlightOnHover:!0,stickyHeader:!0,items:p,columns:[{title:"Business Name",value:e=>e.business.name},{title:"Debit",value:e=>e.debit.formatted,style:{whiteSpace:"nowrap"}},{title:"Credit",value:e=>e.credit.formatted,style:{whiteSpace:"nowrap"}},{title:"Total",value:e=>e.total.raw&&(e.total.raw<-1e-4||e.total.raw>1e-4)?o.jsx(b,{color:e.total.raw>0?"green":"red",children:e.total.formatted}):e.total.formatted,style:{whiteSpace:"nowrap"}},...a(n.Eur),...a(n.Usd),...a(n.Gbp),...a(n.Cad),...a(n.Jpy),...a(n.Aud),...a(n.Sek)]})};function a(t){return[{title:`${t} Debit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.debit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Credit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.credit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Total`,value:r=>{const s=r.foreignCurrenciesSum.find(u=>u.currency===t);return s?.total?.raw&&(s.total.raw<-1e-4||s.total.raw>1e-4)?o.jsx(b,{color:s.total.raw>0?"green":"red",children:s.total.formatted}):s?.total?.formatted},style:{whiteSpace:"nowrap"}}]}export{I as BusinessTransactionsSingle};
1
+ import{bp as S,u as g,r as m,F as x,a as y,j as o,bw as C,w as T,bx as h,by as b,b1 as n,bg as F,bz as v}from"./index-iLt1WIM9.js";const I=({businessId:t})=>{const{businessId:r}=S(),{get:s}=g(),{setFiltersContext:u}=m.useContext(x),l=t||r,[c,d]=m.useState(s("transactionsFilters")?{...JSON.parse(decodeURIComponent(s("transactionsFilters"))),businessIDs:l?[l]:[]}:{businessIDs:l?[l]:[]}),[{data:i,fetching:f}]=y({query:v,variables:{filters:c}});m.useEffect(()=>{u(o.jsx(C,{filter:c,setFilter:d}))},[i,c,u,d]);const p=m.useMemo(()=>i?.businessTransactionsSumFromLedgerRecords.__typename==="CommonError"?[]:i?.businessTransactionsSumFromLedgerRecords.businessTransactionsSum?i.businessTransactionsSumFromLedgerRecords.businessTransactionsSum.sort((e,w)=>e.business.name.localeCompare(w.business.name)):[],[i?.businessTransactionsSumFromLedgerRecords]);return f?o.jsx(T,{}):o.jsx(h,{moreInfo:e=>o.jsx(F,{businessID:e.business.id,filter:c}),striped:!0,highlightOnHover:!0,stickyHeader:!0,items:p,columns:[{title:"Business Name",value:e=>e.business.name},{title:"Debit",value:e=>e.debit.formatted,style:{whiteSpace:"nowrap"}},{title:"Credit",value:e=>e.credit.formatted,style:{whiteSpace:"nowrap"}},{title:"Total",value:e=>e.total.raw&&(e.total.raw<-1e-4||e.total.raw>1e-4)?o.jsx(b,{color:e.total.raw>0?"green":"red",children:e.total.formatted}):e.total.formatted,style:{whiteSpace:"nowrap"}},...a(n.Eur),...a(n.Usd),...a(n.Gbp),...a(n.Cad),...a(n.Jpy),...a(n.Aud),...a(n.Sek)]})};function a(t){return[{title:`${t} Debit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.debit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Credit`,value:r=>r.foreignCurrenciesSum.find(s=>s.currency===t)?.credit?.formatted,style:{whiteSpace:"nowrap"}},{title:`${t} Total`,value:r=>{const s=r.foreignCurrenciesSum.find(u=>u.currency===t);return s?.total?.raw&&(s.total.raw<-1e-4||s.total.raw>1e-4)?o.jsx(b,{color:s.total.raw>0?"green":"red",children:s.total.formatted}):s?.total?.formatted},style:{whiteSpace:"nowrap"}}]}export{I as BusinessTransactionsSingle};
@@ -1 +1 @@
1
- import{bm as u,r as n,F as p,a as c,j as s,n as x,c as d,bA as l}from"./index-CN7VPpiB.js";import{P as m,C as b,E as T}from"./editable-business-trip-CjJg13b0.js";const E=({businessTripId:a})=>{const{businessTripId:o}=u(),{setFiltersContext:i}=n.useContext(p),e=a??o??"",[{data:r,fetching:t}]=c({query:l,variables:{businessTripId:e}});return n.useEffect(()=>{i(s.jsx("div",{className:"flex flex-row gap-x-5",children:s.jsx(m,{filename:"business_trip_report"})}))},[r,t,i]),t||!r?.businessTrip?s.jsx(x,{}):s.jsx(d,{title:`Business Trip: ${r.businessTrip.name}`,description:"Manage business trip",children:s.jsx(b,{className:"mt-5",children:e&&s.jsx(T,{tripId:e,isExtended:!0})})})};export{E as BusinessTrip};
1
+ import{bp as u,r as n,F as p,a as c,j as s,w as x,c as d,bG as l}from"./index-iLt1WIM9.js";import{P as m,C as b,E as T}from"./editable-business-trip-80Bf0nf4.js";const E=({businessTripId:a})=>{const{businessTripId:o}=u(),{setFiltersContext:i}=n.useContext(p),e=a??o??"",[{data:r,fetching:t}]=c({query:l,variables:{businessTripId:e}});return n.useEffect(()=>{i(s.jsx("div",{className:"flex flex-row gap-x-5",children:s.jsx(m,{filename:"business_trip_report"})}))},[r,t,i]),t||!r?.businessTrip?s.jsx(x,{}):s.jsx(d,{title:`Business Trip: ${r.businessTrip.name}`,description:"Manage business trip",children:s.jsx(b,{className:"mt-5",children:e&&s.jsx(T,{tripId:e,isExtended:!0})})})};export{E as BusinessTrip};
@@ -0,0 +1 @@
1
+ import{d0 as B,r as i,u as W,d3 as H,j as e,d1 as U,O as z,bC as G,B as _,d2 as X,U as q,k as J,Y as N,ai as D,dk as K,aN as Q,l as Y,dl as Z,bR as h,cj as k,fs as $,bW as M,bX as L,bS as P,eA as A,aK as x,ft as ee,bf as se,a4 as m,a5 as j,a6 as g,a7 as p,dM as ae,dN as te,dO as ne}from"./index-iLt1WIM9.js";import{s as oe}from"./sub-3l-gAINS.js";function le(a){return!a||B(a)?null:encodeURIComponent(JSON.stringify(a))}const re=[{value:D.AbsAmount,label:"Abs Amount"},{value:D.Amount,label:"Amount"},{value:D.Date,label:"Date"}],ce=[{label:"All",value:A.All},{label:"Income",value:A.Income},{label:"Expense",value:A.Expense}];function ie({filter:a,setFilter:w,closeModal:d}){const{userContext:y}=i.useContext(q),o=J({defaultValues:{byOwners:y?.context.adminBusinessId?[y.context.adminBusinessId]:void 0,sortBy:{field:D.Date,asc:!1},toAnyDate:N(new Date,"yyyy-MM-dd"),fromAnyDate:N(oe(new Date,{years:1}),"yyyy-MM-dd"),...a}}),{control:r,handleSubmit:T,watch:C}=o,[b,F]=i.useState(a.sortBy?.asc??!1),[c,u]=i.useState(!!a.sortBy?.field),{selectableFinancialEntities:S,fetching:t}=K(),{selectableTags:v,fetching:I}=Q(),E=C("sortBy.field");i.useEffect(()=>{E&&!c?u(!0):!E&&c&&u(!1)},[E,c]);const V=s=>{b!=null&&s.sortBy?.field&&(s.sortBy.asc=b),w(s),d()};function R(){w({}),F(!1),d()}return e.jsxs(e.Fragment,{children:[t?e.jsx("div",{children:"Loading..."}):e.jsx("div",{}),e.jsx(Y,{...o,children:e.jsxs("form",{onSubmit:T(V),children:[e.jsxs(Z,{cols:2,children:[e.jsx(h,{name:"byOwners",control:r,defaultValue:a.byOwners,render:({field:s,fieldState:n})=>e.jsx(k,{...s,data:S,value:s.value??[],disabled:t,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byBusinesses",control:r,defaultValue:a.byBusinesses,render:({field:s,fieldState:n})=>e.jsx(k,{...s,data:S,value:s.value??[],disabled:t,label:"Financial Entities",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"byTags",control:r,defaultValue:a.byTags,render:({field:s,fieldState:n})=>e.jsx(k,{...s,data:v,itemComponent:$,value:s.value??[],disabled:I,label:"Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,withinPortal:!0,filter:(l,f,O)=>O.label?.toLowerCase().includes(l.toLowerCase().trim())||O.description?.toLowerCase().includes(l.toLowerCase().trim())})}),e.jsx(h,{name:"fromAnyDate",control:r,defaultValue:a.fromAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(L,{...s,onChange:l=>{const f=l?typeof l=="string"?l:N(l,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"toAnyDate",control:r,defaultValue:a.toAnyDate,rules:{pattern:{value:M,message:"Date must be im format yyyy-mm-dd"}},render:({field:s,fieldState:n})=>e.jsx(L,{...s,onChange:l=>{const f=l?typeof l=="string"?l:N(l,"yyyy-MM-dd"):void 0;f!==s.value&&s.onChange(f)},value:s.value?new Date(s.value):void 0,error:n.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),e.jsx(h,{name:"chargesType",control:r,defaultValue:a.chargesType,render:({field:s,fieldState:n})=>e.jsx(P,{...s,data:ce,value:s.value??A.All,disabled:t,label:"Charge Type",placeholder:"Filter income/expense",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsx(h,{name:"sortBy.field",control:r,defaultValue:a.sortBy?.field??D.Date,render:({field:s,fieldState:n})=>e.jsx(P,{...s,data:re,label:"Field to sort by",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:n.error?.message,rightSectionProps:{style:{width:"5rem"}},withinPortal:!0,rightSection:e.jsxs("div",{className:"flex flex-row items-center gap-1",children:[e.jsx(x,{defaultChecked:a.sortBy?.asc??!1,checked:b??!1,disabled:!c,onCheckedChange:F}),e.jsx("span",{className:"text-xs",children:b?"ASC":"DESC"})]})})}),e.jsx(h,{name:"accountantStatus",control:r,defaultValue:a.accountantStatus,render:({field:s,fieldState:n})=>e.jsx(k,{...s,value:s.value??[],data:ee,disabled:t,label:"Accountant Status",placeholder:"All",maxDropdownHeight:160,error:n.error?.message,withinPortal:!0})}),e.jsxs("div",{className:"flex flex-col gap-2 mt-4 rounded-lg border p-3 shadow-sm space-y-2",children:[e.jsx(se,{children:"Missing Information:"}),e.jsx(m,{control:o.control,name:"withoutInvoice",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Without Invoice"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.withoutInvoice??!1,onCheckedChange:s.onChange})})]})}),e.jsx(m,{control:o.control,name:"withoutReceipt",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Without Receipts"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.withoutReceipt??!1,onCheckedChange:s.onChange})})]})}),e.jsx(m,{control:o.control,name:"withoutDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Without Documents"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.withoutDocuments??!1,onCheckedChange:s.onChange})})]})}),e.jsx(m,{control:o.control,name:"withOpenDocuments",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"With Open Documents"})}),e.jsx(p,{children:e.jsxs(ae,{children:[e.jsx(te,{children:e.jsx(x,{defaultChecked:a.withOpenDocuments??!1,onCheckedChange:s.onChange})}),e.jsx(ne,{children:e.jsx("p",{children:"Show only charges with documents that are currently open"})})]})})]})}),e.jsx(m,{control:o.control,name:"withoutTransactions",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Without Transactions"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.withoutTransactions??!1,onCheckedChange:s.onChange})})]})}),e.jsx(m,{control:o.control,name:"unbalanced",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Unbalanced businesses"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.unbalanced??!1,onCheckedChange:s.onChange})})]})}),e.jsx(m,{control:o.control,name:"withoutLedger",render:({field:s})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(g,{children:"Without ledger"})}),e.jsx(p,{children:e.jsx(x,{defaultChecked:a.withoutLedger??!1,onCheckedChange:s.onChange})})]})})]})]}),e.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[e.jsx("button",{type:"submit",disabled:t||I,className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),e.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:R,children:"Clear"}),e.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:d,children:"Cancel"})]})]})})]})}function he({filter:a={},setFilter:w,activePage:d,setPage:y,totalPages:o=1,initiallyOpened:r=!1}){const[T,C]=i.useState(r),[b,F]=i.useState(!B(a)),{get:c,set:u}=W();i.useEffect(()=>{const t=d>1?d.toFixed(0):null,v=c("page");t!==v&&u("page",t)},[d,c,u]),i.useEffect(()=>{const t=le(a),v=c("chargesFilters");t!==v&&(u("chargesFilters",t),u("page"),y(1))},[a,c,u,y]);const S=i.useCallback(t=>{H(t,a)||(w(t),F(!B(t)))},[a,w]);return e.jsxs("div",{className:"flex flex-row gap-5 items-center",children:[e.jsx(U,{opened:T,onClose:()=>C(!1),content:e.jsx(ie,{filter:a,setFilter:S,closeModal:()=>C(!1)}),modalSize:"xl"}),o>1&&e.jsx(z,{className:"flex-auto",value:d,onChange:y,total:o}),e.jsx(G,{inline:!0,size:16,disabled:!b,children:e.jsx(_,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>C(!0),children:e.jsx(X,{className:"size-5"})})})]})}export{he as C,ce as c,le as e};
@@ -1 +1 @@
1
- import{r as t,F as E,u as N,a as P,j as e,T as b,B as w,P as z,b as T,c as W,L as O,C as k,e as B,f as R,g as V,E as A,I as Q,M as U,h as q}from"./index-CN7VPpiB.js";import{C as J}from"./charges-filters-C-H07qp1.js";import{M as $}from"./index-Csqyxwgx.js";import{P as G}from"./Progress-DvGsu87E.js";import"./sub-LLu8afpC.js";import"./subMonths-C1UIPrOU.js";import"./Checkbox-lfqFDKZM.js";const se=()=>{const{setFiltersContext:m}=t.useContext(E),[o,x]=t.useState(void 0),[l,C]=t.useState(void 0),[c,p]=t.useState(void 0),[g,f]=t.useState(!1),[a,d]=t.useState([]),{get:F}=N(),h=F("chargesFilters"),I=t.useMemo(()=>{if(h)try{return JSON.parse(decodeURIComponent(h))}catch{return}},[h]),[n,j]=t.useState(I),S=t.useCallback((s,D)=>{a.map(u=>u.id).includes(s)?d(a.filter(u=>u.id!==s)):d([...a,{id:s,onChange:D}])},[a]),[{data:r,fetching:M},v]=P({query:q,variables:{filters:n},pause:!0});function y(){d([])}const i=t.useMemo(()=>r?.chargesWithLedgerChanges?.length?r.chargesWithLedgerChanges[r.chargesWithLedgerChanges.length-1].progress:0,[r?.chargesWithLedgerChanges]),L=t.useCallback(s=>{j(s)},[j]);return t.useEffect(()=>{n&&v()},[n,v]),t.useEffect(()=>{m(e.jsxs("div",{className:"flex flex-row gap-x-5 items-center",children:[e.jsx(G,{value:i,label:`${i?.toFixed(2)}%`,size:"xl",animate:i<100,className:"min-w-52"}),e.jsx(J,{filter:n,setFilter:L,activePage:1,setPage:()=>{},initiallyOpened:!0}),e.jsx(b,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>f(s=>!s),children:g?e.jsx(z,{className:"size-5"}):e.jsx(T,{className:"size-5"})})}),e.jsx($,{selected:a,resetMerge:y})]}))},[r,M,n,g,m,f,a,i,L]),e.jsxs(W,{title:"Charges Ledger Validation",description:"Manage charges",children:[M?e.jsx(O,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsxs(e.Fragment,{children:[e.jsx(k,{setEditChargeId:x,setInsertDocument:C,setMatchDocuments:p,toggleMergeCharge:S,mergeSelectedCharges:new Set(a.map(s=>s.id)),data:r?.chargesWithLedgerChanges.filter(s=>!!s.charge).map(s=>s.charge)??[],isAllOpened:g}),e.jsxs("div",{className:"flex flex-row justify-center my-2",children:[i>0&&i<100&&e.jsx(B,{}),i===100&&!r?.chargesWithLedgerChanges.filter(s=>!!s.charge).length&&e.jsx(R,{radius:"xl",size:"xl",color:"green",children:e.jsx(V,{})})]})]}),o&&e.jsx(A,{chargeId:o?.id,close:()=>x(void 0),onChange:o.onChange}),l&&e.jsx(Q,{chargeId:l.id,onChange:l.onChange,close:()=>C(void 0)}),c&&e.jsx(U,{chargeId:c.id,ownerId:c.ownerId,setMatchDocuments:()=>p(void 0)})]})};export{se as ChargesLedgerValidation};
1
+ import{r as t,F as E,u as N,a as P,j as e,T as b,B as w,P as z,b as T,c as W,L as O,C as k,e as B,f as R,g as V,E as A,I as Q,M as U,h as q}from"./index-iLt1WIM9.js";import{C as J}from"./charges-filters-DaVBQ_jS.js";import{M as $}from"./index-DfYVR_1G.js";import{P as G}from"./Progress-CSjfE5bV.js";import"./sub-3l-gAINS.js";import"./subMonths-LVothVpu.js";import"./Checkbox-iZ--iyJF.js";const se=()=>{const{setFiltersContext:m}=t.useContext(E),[o,x]=t.useState(void 0),[l,C]=t.useState(void 0),[c,p]=t.useState(void 0),[g,f]=t.useState(!1),[a,d]=t.useState([]),{get:F}=N(),h=F("chargesFilters"),I=t.useMemo(()=>{if(h)try{return JSON.parse(decodeURIComponent(h))}catch{return}},[h]),[n,j]=t.useState(I),S=t.useCallback((s,D)=>{a.map(u=>u.id).includes(s)?d(a.filter(u=>u.id!==s)):d([...a,{id:s,onChange:D}])},[a]),[{data:r,fetching:M},v]=P({query:q,variables:{filters:n},pause:!0});function y(){d([])}const i=t.useMemo(()=>r?.chargesWithLedgerChanges?.length?r.chargesWithLedgerChanges[r.chargesWithLedgerChanges.length-1].progress:0,[r?.chargesWithLedgerChanges]),L=t.useCallback(s=>{j(s)},[j]);return t.useEffect(()=>{n&&v()},[n,v]),t.useEffect(()=>{m(e.jsxs("div",{className:"flex flex-row gap-x-5 items-center",children:[e.jsx(G,{value:i,label:`${i?.toFixed(2)}%`,size:"xl",animate:i<100,className:"min-w-52"}),e.jsx(J,{filter:n,setFilter:L,activePage:1,setPage:()=>{},initiallyOpened:!0}),e.jsx(b,{label:"Expand all accounts",children:e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>f(s=>!s),children:g?e.jsx(z,{className:"size-5"}):e.jsx(T,{className:"size-5"})})}),e.jsx($,{selected:a,resetMerge:y})]}))},[r,M,n,g,m,f,a,i,L]),e.jsxs(W,{title:"Charges Ledger Validation",description:"Manage charges",children:[M?e.jsx(O,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsxs(e.Fragment,{children:[e.jsx(k,{setEditChargeId:x,setInsertDocument:C,setMatchDocuments:p,toggleMergeCharge:S,mergeSelectedCharges:new Set(a.map(s=>s.id)),data:r?.chargesWithLedgerChanges.filter(s=>!!s.charge).map(s=>s.charge)??[],isAllOpened:g}),e.jsxs("div",{className:"flex flex-row justify-center my-2",children:[i>0&&i<100&&e.jsx(B,{}),i===100&&!r?.chargesWithLedgerChanges.filter(s=>!!s.charge).length&&e.jsx(R,{radius:"xl",size:"xl",color:"green",children:e.jsx(V,{})})]})]}),o&&e.jsx(A,{chargeId:o?.id,close:()=>x(void 0),onChange:o.onChange}),l&&e.jsx(Q,{chargeId:l.id,onChange:l.onChange,close:()=>C(void 0)}),c&&e.jsx(U,{chargeId:c.id,ownerId:c.ownerId,setMatchDocuments:()=>p(void 0)})]})};export{se as ChargesLedgerValidation};
@@ -1,4 +1,4 @@
1
- import{f8 as on,dZ as te,r as N,ah as V,ag as A,f9 as Y,j as ie,p as We}from"./index-CN7VPpiB.js";import{c as ae,a as _y,x as Ne,t as ri,y as _s,z as mn,A as wy,B as gn,C as lb,D as fb,E as Sy,F as ws,G as ni,H as pb,I as Rc,J as qc,K as Nc,L as Zr,M as ii,N as db,O as hb,P as vb,Q as yb,n as Ss,R as mb,l as Ps,m as gb,o as bb,q as mr,p as Ob,s as xb,S as _b,T as wb,U as Sb,V as Pb,k as Ab,W as Eb,i as jb,j as Tb,u as Cb,X as $b,h as Ib,d as Mb,e as Rb,f as qb,b as Nb,g as kb}from"./sequential-CAnleQny.js";var Ii,xl;function Oe(){if(xl)return Ii;xl=1;var t=Array.isArray;return Ii=t,Ii}var Mi,_l;function Py(){if(_l)return Mi;_l=1;var t=typeof on=="object"&&on&&on.Object===Object&&on;return Mi=t,Mi}var Ri,wl;function Fe(){if(wl)return Ri;wl=1;var t=Py(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Ri=r,Ri}var qi,Sl;function Jr(){if(Sl)return qi;Sl=1;var t=Fe(),e=t.Symbol;return qi=e,qi}var Ni,Pl;function Db(){if(Pl)return Ni;Pl=1;var t=Jr(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var u=r.call(o,i),s=o[i];try{o[i]=void 0;var c=!0}catch{}var l=n.call(o);return c&&(u?o[i]=s:delete o[i]),l}return Ni=a,Ni}var ki,Al;function Bb(){if(Al)return ki;Al=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return ki=r,ki}var Di,El;function Xe(){if(El)return Di;El=1;var t=Jr(),e=Db(),r=Bb(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?e(u):r(u)}return Di=o,Di}var Bi,jl;function Ve(){if(jl)return Bi;jl=1;function t(e){return e!=null&&typeof e=="object"}return Bi=t,Bi}var Li,Tl;function Zt(){if(Tl)return Li;Tl=1;var t=Xe(),e=Ve(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Li=n,Li}var Fi,Cl;function kc(){if(Cl)return Fi;Cl=1;var t=Oe(),e=Zt(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Fi=i,Fi}var zi,$l;function et(){if($l)return zi;$l=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return zi=t,zi}var Wi,Il;function Dc(){if(Il)return Wi;Il=1;var t=Xe(),e=et(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!e(u))return!1;var s=t(u);return s==n||s==i||s==r||s==a}return Wi=o,Wi}var Gi,Ml;function Lb(){if(Ml)return Gi;Ml=1;var t=Fe(),e=t["__core-js_shared__"];return Gi=e,Gi}var Ki,Rl;function Fb(){if(Rl)return Ki;Rl=1;var t=Lb(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return Ki=r,Ki}var Hi,ql;function Ay(){if(ql)return Hi;ql=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Hi=r,Hi}var Ui,Nl;function zb(){if(Nl)return Ui;Nl=1;var t=Dc(),e=Fb(),r=et(),n=Ay(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,s=o.toString,c=u.hasOwnProperty,l=RegExp("^"+s.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(p){if(!r(p)||e(p))return!1;var h=t(p)?l:a;return h.test(n(p))}return Ui=f,Ui}var Xi,kl;function Wb(){if(kl)return Xi;kl=1;function t(e,r){return e?.[r]}return Xi=t,Xi}var Vi,Dl;function Ot(){if(Dl)return Vi;Dl=1;var t=zb(),e=Wb();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Vi=r,Vi}var Yi,Bl;function ai(){if(Bl)return Yi;Bl=1;var t=Ot(),e=t(Object,"create");return Yi=e,Yi}var Zi,Ll;function Gb(){if(Ll)return Zi;Ll=1;var t=ai();function e(){this.__data__=t?t(null):{},this.size=0}return Zi=e,Zi}var Ji,Fl;function Kb(){if(Fl)return Ji;Fl=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Ji=t,Ji}var Qi,zl;function Hb(){if(zl)return Qi;zl=1;var t=ai(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var u=o[a];return u===e?void 0:u}return n.call(o,a)?o[a]:void 0}return Qi=i,Qi}var ea,Wl;function Ub(){if(Wl)return ea;Wl=1;var t=ai(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return ea=n,ea}var ta,Gl;function Xb(){if(Gl)return ta;Gl=1;var t=ai(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return ta=r,ta}var ra,Kl;function Vb(){if(Kl)return ra;Kl=1;var t=Gb(),e=Kb(),r=Hb(),n=Ub(),i=Xb();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ra=a,ra}var na,Hl;function Yb(){if(Hl)return na;Hl=1;function t(){this.__data__=[],this.size=0}return na=t,na}var ia,Ul;function Bc(){if(Ul)return ia;Ul=1;function t(e,r){return e===r||e!==e&&r!==r}return ia=t,ia}var aa,Xl;function oi(){if(Xl)return aa;Xl=1;var t=Bc();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return aa=e,aa}var oa,Vl;function Zb(){if(Vl)return oa;Vl=1;var t=oi(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return oa=n,oa}var ua,Yl;function Jb(){if(Yl)return ua;Yl=1;var t=oi();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return ua=e,ua}var sa,Zl;function Qb(){if(Zl)return sa;Zl=1;var t=oi();function e(r){return t(this.__data__,r)>-1}return sa=e,sa}var ca,Jl;function e0(){if(Jl)return ca;Jl=1;var t=oi();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ca=e,ca}var la,Ql;function ui(){if(Ql)return la;Ql=1;var t=Yb(),e=Zb(),r=Jb(),n=Qb(),i=e0();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,la=a,la}var fa,ef;function Lc(){if(ef)return fa;ef=1;var t=Ot(),e=Fe(),r=t(e,"Map");return fa=r,fa}var pa,tf;function t0(){if(tf)return pa;tf=1;var t=Vb(),e=ui(),r=Lc();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return pa=n,pa}var da,rf;function r0(){if(rf)return da;rf=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return da=t,da}var ha,nf;function si(){if(nf)return ha;nf=1;var t=r0();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return ha=e,ha}var va,af;function n0(){if(af)return va;af=1;var t=si();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return va=e,va}var ya,of;function i0(){if(of)return ya;of=1;var t=si();function e(r){return t(this,r).get(r)}return ya=e,ya}var ma,uf;function a0(){if(uf)return ma;uf=1;var t=si();function e(r){return t(this,r).has(r)}return ma=e,ma}var ga,sf;function o0(){if(sf)return ga;sf=1;var t=si();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return ga=e,ga}var ba,cf;function Fc(){if(cf)return ba;cf=1;var t=t0(),e=n0(),r=i0(),n=a0(),i=o0();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ba=a,ba}var Oa,lf;function Ey(){if(lf)return Oa;lf=1;var t=Fc(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],s=a.cache;if(s.has(u))return s.get(u);var c=n.apply(this,o);return a.cache=s.set(u,c)||s,c};return a.cache=new(r.Cache||t),a}return r.Cache=t,Oa=r,Oa}var xa,ff;function u0(){if(ff)return xa;ff=1;var t=Ey(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return xa=r,xa}var _a,pf;function s0(){if(pf)return _a;pf=1;var t=u0(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,u,s,c){a.push(s?c.replace(r,"$1"):u||o)}),a});return _a=n,_a}var wa,df;function zc(){if(df)return wa;df=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return wa=t,wa}var Sa,hf;function c0(){if(hf)return Sa;hf=1;var t=Jr(),e=zc(),r=Oe(),n=Zt(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return e(u,o)+"";if(n(u))return a?a.call(u):"";var s=u+"";return s=="0"&&1/u==-1/0?"-0":s}return Sa=o,Sa}var Pa,vf;function jy(){if(vf)return Pa;vf=1;var t=c0();function e(r){return r==null?"":t(r)}return Pa=e,Pa}var Aa,yf;function Ty(){if(yf)return Aa;yf=1;var t=Oe(),e=kc(),r=s0(),n=jy();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Aa=i,Aa}var Ea,mf;function ci(){if(mf)return Ea;mf=1;var t=Zt();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ea=e,Ea}var ja,gf;function Wc(){if(gf)return ja;gf=1;var t=Ty(),e=ci();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return ja=r,ja}var Ta,bf;function Cy(){if(bf)return Ta;bf=1;var t=Wc();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Ta=e,Ta}var l0=Cy();const je=te(l0);var Ca,Of;function f0(){if(Of)return Ca;Of=1;function t(e){return e==null}return Ca=t,Ca}var p0=f0();const U=te(p0);var $a,xf;function d0(){if(xf)return $a;xf=1;var t=Xe(),e=Oe(),r=Ve(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return $a=i,$a}var h0=d0();const vt=te(h0);var v0=Dc();const H=te(v0);var y0=et();const Jt=te(y0);var Ia={exports:{}},Z={};/**
1
+ import{fb as on,e2 as te,r as N,ak as V,aj as A,fc as Y,j as ie,y as We}from"./index-iLt1WIM9.js";import{c as ae,a as _y,x as Ne,t as ri,y as _s,z as mn,A as wy,B as gn,C as lb,D as fb,E as Sy,F as ws,G as ni,H as pb,I as Rc,J as qc,K as Nc,L as Zr,M as ii,N as db,O as hb,P as vb,Q as yb,n as Ss,R as mb,l as Ps,m as gb,o as bb,q as mr,p as Ob,s as xb,S as _b,T as wb,U as Sb,V as Pb,k as Ab,W as Eb,i as jb,j as Tb,u as Cb,X as $b,h as Ib,d as Mb,e as Rb,f as qb,b as Nb,g as kb}from"./sequential-CAnleQny.js";var Ii,xl;function Oe(){if(xl)return Ii;xl=1;var t=Array.isArray;return Ii=t,Ii}var Mi,_l;function Py(){if(_l)return Mi;_l=1;var t=typeof on=="object"&&on&&on.Object===Object&&on;return Mi=t,Mi}var Ri,wl;function Fe(){if(wl)return Ri;wl=1;var t=Py(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Ri=r,Ri}var qi,Sl;function Jr(){if(Sl)return qi;Sl=1;var t=Fe(),e=t.Symbol;return qi=e,qi}var Ni,Pl;function Db(){if(Pl)return Ni;Pl=1;var t=Jr(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var u=r.call(o,i),s=o[i];try{o[i]=void 0;var c=!0}catch{}var l=n.call(o);return c&&(u?o[i]=s:delete o[i]),l}return Ni=a,Ni}var ki,Al;function Bb(){if(Al)return ki;Al=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return ki=r,ki}var Di,El;function Xe(){if(El)return Di;El=1;var t=Jr(),e=Db(),r=Bb(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?e(u):r(u)}return Di=o,Di}var Bi,jl;function Ve(){if(jl)return Bi;jl=1;function t(e){return e!=null&&typeof e=="object"}return Bi=t,Bi}var Li,Tl;function Zt(){if(Tl)return Li;Tl=1;var t=Xe(),e=Ve(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Li=n,Li}var Fi,Cl;function kc(){if(Cl)return Fi;Cl=1;var t=Oe(),e=Zt(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Fi=i,Fi}var zi,$l;function et(){if($l)return zi;$l=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return zi=t,zi}var Wi,Il;function Dc(){if(Il)return Wi;Il=1;var t=Xe(),e=et(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!e(u))return!1;var s=t(u);return s==n||s==i||s==r||s==a}return Wi=o,Wi}var Gi,Ml;function Lb(){if(Ml)return Gi;Ml=1;var t=Fe(),e=t["__core-js_shared__"];return Gi=e,Gi}var Ki,Rl;function Fb(){if(Rl)return Ki;Rl=1;var t=Lb(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return Ki=r,Ki}var Hi,ql;function Ay(){if(ql)return Hi;ql=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Hi=r,Hi}var Ui,Nl;function zb(){if(Nl)return Ui;Nl=1;var t=Dc(),e=Fb(),r=et(),n=Ay(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,s=o.toString,c=u.hasOwnProperty,l=RegExp("^"+s.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(p){if(!r(p)||e(p))return!1;var h=t(p)?l:a;return h.test(n(p))}return Ui=f,Ui}var Xi,kl;function Wb(){if(kl)return Xi;kl=1;function t(e,r){return e?.[r]}return Xi=t,Xi}var Vi,Dl;function Ot(){if(Dl)return Vi;Dl=1;var t=zb(),e=Wb();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Vi=r,Vi}var Yi,Bl;function ai(){if(Bl)return Yi;Bl=1;var t=Ot(),e=t(Object,"create");return Yi=e,Yi}var Zi,Ll;function Gb(){if(Ll)return Zi;Ll=1;var t=ai();function e(){this.__data__=t?t(null):{},this.size=0}return Zi=e,Zi}var Ji,Fl;function Kb(){if(Fl)return Ji;Fl=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Ji=t,Ji}var Qi,zl;function Hb(){if(zl)return Qi;zl=1;var t=ai(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var u=o[a];return u===e?void 0:u}return n.call(o,a)?o[a]:void 0}return Qi=i,Qi}var ea,Wl;function Ub(){if(Wl)return ea;Wl=1;var t=ai(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return ea=n,ea}var ta,Gl;function Xb(){if(Gl)return ta;Gl=1;var t=ai(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return ta=r,ta}var ra,Kl;function Vb(){if(Kl)return ra;Kl=1;var t=Gb(),e=Kb(),r=Hb(),n=Ub(),i=Xb();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ra=a,ra}var na,Hl;function Yb(){if(Hl)return na;Hl=1;function t(){this.__data__=[],this.size=0}return na=t,na}var ia,Ul;function Bc(){if(Ul)return ia;Ul=1;function t(e,r){return e===r||e!==e&&r!==r}return ia=t,ia}var aa,Xl;function oi(){if(Xl)return aa;Xl=1;var t=Bc();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return aa=e,aa}var oa,Vl;function Zb(){if(Vl)return oa;Vl=1;var t=oi(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return oa=n,oa}var ua,Yl;function Jb(){if(Yl)return ua;Yl=1;var t=oi();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return ua=e,ua}var sa,Zl;function Qb(){if(Zl)return sa;Zl=1;var t=oi();function e(r){return t(this.__data__,r)>-1}return sa=e,sa}var ca,Jl;function e0(){if(Jl)return ca;Jl=1;var t=oi();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ca=e,ca}var la,Ql;function ui(){if(Ql)return la;Ql=1;var t=Yb(),e=Zb(),r=Jb(),n=Qb(),i=e0();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,la=a,la}var fa,ef;function Lc(){if(ef)return fa;ef=1;var t=Ot(),e=Fe(),r=t(e,"Map");return fa=r,fa}var pa,tf;function t0(){if(tf)return pa;tf=1;var t=Vb(),e=ui(),r=Lc();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return pa=n,pa}var da,rf;function r0(){if(rf)return da;rf=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return da=t,da}var ha,nf;function si(){if(nf)return ha;nf=1;var t=r0();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return ha=e,ha}var va,af;function n0(){if(af)return va;af=1;var t=si();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return va=e,va}var ya,of;function i0(){if(of)return ya;of=1;var t=si();function e(r){return t(this,r).get(r)}return ya=e,ya}var ma,uf;function a0(){if(uf)return ma;uf=1;var t=si();function e(r){return t(this,r).has(r)}return ma=e,ma}var ga,sf;function o0(){if(sf)return ga;sf=1;var t=si();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return ga=e,ga}var ba,cf;function Fc(){if(cf)return ba;cf=1;var t=t0(),e=n0(),r=i0(),n=a0(),i=o0();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ba=a,ba}var Oa,lf;function Ey(){if(lf)return Oa;lf=1;var t=Fc(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],s=a.cache;if(s.has(u))return s.get(u);var c=n.apply(this,o);return a.cache=s.set(u,c)||s,c};return a.cache=new(r.Cache||t),a}return r.Cache=t,Oa=r,Oa}var xa,ff;function u0(){if(ff)return xa;ff=1;var t=Ey(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return xa=r,xa}var _a,pf;function s0(){if(pf)return _a;pf=1;var t=u0(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,u,s,c){a.push(s?c.replace(r,"$1"):u||o)}),a});return _a=n,_a}var wa,df;function zc(){if(df)return wa;df=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return wa=t,wa}var Sa,hf;function c0(){if(hf)return Sa;hf=1;var t=Jr(),e=zc(),r=Oe(),n=Zt(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return e(u,o)+"";if(n(u))return a?a.call(u):"";var s=u+"";return s=="0"&&1/u==-1/0?"-0":s}return Sa=o,Sa}var Pa,vf;function jy(){if(vf)return Pa;vf=1;var t=c0();function e(r){return r==null?"":t(r)}return Pa=e,Pa}var Aa,yf;function Ty(){if(yf)return Aa;yf=1;var t=Oe(),e=kc(),r=s0(),n=jy();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Aa=i,Aa}var Ea,mf;function ci(){if(mf)return Ea;mf=1;var t=Zt();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ea=e,Ea}var ja,gf;function Wc(){if(gf)return ja;gf=1;var t=Ty(),e=ci();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return ja=r,ja}var Ta,bf;function Cy(){if(bf)return Ta;bf=1;var t=Wc();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Ta=e,Ta}var l0=Cy();const je=te(l0);var Ca,Of;function f0(){if(Of)return Ca;Of=1;function t(e){return e==null}return Ca=t,Ca}var p0=f0();const U=te(p0);var $a,xf;function d0(){if(xf)return $a;xf=1;var t=Xe(),e=Oe(),r=Ve(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return $a=i,$a}var h0=d0();const vt=te(h0);var v0=Dc();const H=te(v0);var y0=et();const Jt=te(y0);var Ia={exports:{}},Z={};/**
2
2
  * @license React
3
3
  * react-is.production.min.js
4
4
  *
@@ -1,4 +1,4 @@
1
- import{z as t,j as e,at as i,au as c,av as o,aw as l,ax as r,B as n,g1 as x,g2 as d}from"./index-CN7VPpiB.js";/**
1
+ import{V as t,j as e,aw as i,ax as c,ay as o,az as l,aA as r,B as n,g4 as x,g5 as d}from"./index-iLt1WIM9.js";/**
2
2
  * @license lucide-react v0.546.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.