@accounter/client 0.0.8-alpha-20251028123001-a8ce4e53bbde9f6eeded7bfeea650700f6a63130 → 0.0.8-alpha-20251028124234-328844c99a42b68aa9e2f32fd86da80b4832f631

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 (148) hide show
  1. package/CHANGELOG.md +13 -27
  2. package/dist/assets/{Checkbox-sjgv9dlI.js → Checkbox-BR6kGuhg.js} +2 -2
  3. package/dist/assets/MultiSelect-BqcJrWnD.js +1 -0
  4. package/dist/assets/Pagination-6Sv5LXxl.js +1 -0
  5. package/dist/assets/{Progress-DKypjBbn.js → Progress-7xtiFwK3.js} +1 -1
  6. package/dist/assets/Table-C5zxD95i.js +1 -0
  7. package/dist/assets/Typography-CMzSQZKD.js +1 -0
  8. package/dist/assets/YearPickerInput-CllwSjcn.js +1 -0
  9. package/dist/assets/{accordion-Cfc9ae4H.js → accordion-CMR2fANH.js} +1 -1
  10. package/dist/assets/accountant-approvals-BHFXpHHc.js +1 -0
  11. package/dist/assets/accounter-table-CpeQD4PG.js +1 -0
  12. package/dist/assets/addDays-DvwuJbUs.js +1 -0
  13. package/dist/assets/all-charges-At7WJXuW.js +1 -0
  14. package/dist/assets/{arrow-up-down-DapQ791y.js → arrow-up-down-DPG1l9S1.js} +1 -1
  15. package/dist/assets/{building-2-B5JpJWrx.js → building-2-BgvPBt2Z.js} +1 -1
  16. package/dist/assets/business-DKvbSnga.js +32 -0
  17. package/dist/assets/business-extended-info-7CM8px2e.js +13 -0
  18. package/dist/assets/{business-header-BK89Rfvy.js → business-header-u2sfE_d8.js} +1 -1
  19. package/dist/assets/business-transactions-filters-DmpO9Bwo.js +1 -0
  20. package/dist/assets/business-transactions-single-rF6JbAL7.js +1 -0
  21. package/dist/assets/business-trip-BGrp09N7.js +1 -0
  22. package/dist/assets/charge-C-EaA1Xc.js +1 -0
  23. package/dist/assets/charges-filters-Dq-8QHH-.js +1 -0
  24. package/dist/assets/charges-ledger-validation-DlkzVow7.js +1 -0
  25. package/dist/assets/charges-table-Cncs1HLi.js +62 -0
  26. package/dist/assets/{chart-0bAgDGey.js → chart-ByngRufj.js} +6 -6
  27. package/dist/assets/create-event-handler-BiA-1lGu.js +1 -0
  28. package/dist/assets/{data-table-pagination-BgCuddCb.js → data-table-pagination-D4OEFmX_.js} +1 -1
  29. package/dist/assets/download-csv-button-Df5rDeDc.js +1 -0
  30. package/dist/assets/editable-business-trip-Bav24z0u.js +16 -0
  31. package/dist/assets/funnel-BJ71hzoq.js +6 -0
  32. package/dist/assets/index-BRv0JZw4.js +1 -0
  33. package/dist/assets/index-BXlS8oD_.js +1 -0
  34. package/dist/assets/{index-DaSgVGNd.js → index-BetG0HVN.js} +3 -3
  35. package/dist/assets/index-BplSRMAq.css +1 -0
  36. package/dist/assets/{index-Dnafld8G.js → index-Bsl7tJp_.js} +16 -16
  37. package/dist/assets/{index-DLRffFbF.js → index-CLUhAJ3t.js} +7 -7
  38. package/dist/assets/index-Cix5qjA-.js +2 -0
  39. package/dist/assets/index-CizLtiES.js +1 -0
  40. package/dist/assets/index-DKBzv0gc.js +1 -0
  41. package/dist/assets/index-DR_5jpS4.js +6 -0
  42. package/dist/assets/index-DTmtILfq.js +1 -0
  43. package/dist/assets/index-DU0G7FZm.js +1 -0
  44. package/dist/assets/index-DUWRgLfu.js +9 -0
  45. package/dist/assets/index-DYZPWG4k.js +2 -0
  46. package/dist/assets/index-DdUE2_44.js +1 -0
  47. package/dist/assets/index-De5dvO0S.js +1 -0
  48. package/dist/assets/index-Des3eR4f.js +1 -0
  49. package/dist/assets/index-DpYwi5kf.js +6 -0
  50. package/dist/assets/index-GzyQZkbY.js +1 -0
  51. package/dist/assets/index-HzLXi-qB.js +1 -0
  52. package/dist/assets/index-Ji28AZwq.js +1 -0
  53. package/dist/assets/{index-D92U_VYB.js → index-UMFH47hN.js} +2 -2
  54. package/dist/assets/index-fuT9duEO.js +1 -0
  55. package/dist/assets/{index-BBpGo89I.js → index-vChLJwSt.js} +2 -2
  56. package/dist/assets/index-wck8Xuay.js +1 -0
  57. package/dist/assets/index-wyU9I4Kz.js +768 -0
  58. package/dist/assets/{index.es-JpTIgXoh.js → index.es-NphQjU3m.js} +1 -1
  59. package/dist/assets/insert-business-trip-modal-vS1QrUJz.js +6 -0
  60. package/dist/assets/issue-document-pIswc_8i.js +1 -0
  61. package/dist/assets/list-plus-Dy3vzJVy.js +6 -0
  62. package/dist/assets/login-page-YXRfklK1.js +1 -0
  63. package/dist/assets/match-document-modal-BPG_hljb.js +16 -0
  64. package/dist/assets/missing-info-charges-D8dUfChs.js +1 -0
  65. package/dist/assets/modal-D47umnak.js +1 -0
  66. package/dist/assets/page-layout-BG0XvWfD.js +1 -0
  67. package/dist/assets/page-not-found-Cy6oIIb1.js +1 -0
  68. package/dist/assets/panel-top-open-B1rhJYjQ.js +11 -0
  69. package/dist/assets/{pencil-CEfu8zQ4.js → pencil-tV0FsM6V.js} +1 -1
  70. package/dist/assets/report-commentary-row-BL2RkIHq.js +1 -0
  71. package/dist/assets/{save-Drpbh6u3.js → save-Czmh3tvC.js} +1 -1
  72. package/dist/assets/similar-transactions-modal-MQeC2gtu.js +1 -0
  73. package/dist/assets/sub-B4_VmmF9.js +1 -0
  74. package/dist/assets/subMonths-DG7w6bCY.js +1 -0
  75. package/dist/assets/summary-DvHtnArZ.js +1 -0
  76. package/dist/assets/switch-GSloW_Ey.js +1 -0
  77. package/dist/assets/toggle-expansion-button-lwJYTklN.js +1 -0
  78. package/dist/assets/tooltip-BbKSwLCX.js +1 -0
  79. package/dist/assets/use-url-query-CUVSXgm0.js +1 -0
  80. package/dist/index.html +2 -2
  81. package/package.json +1 -1
  82. package/src/components/business/contracts-section.tsx +4 -18
  83. package/src/components/business-transactions/business-extended-info.tsx +5 -5
  84. package/src/components/business-transactions/index.tsx +1 -28
  85. package/src/components/businesses/index.tsx +6 -2
  86. package/src/components/charges/cells/business-trip.tsx +6 -1
  87. package/src/components/charges/cells/counterparty.tsx +4 -28
  88. package/src/components/clients/contracts/modify-contract-dialog.tsx +11 -64
  89. package/src/components/common/business-trip-report/parts/core-expense-row.tsx +2 -2
  90. package/src/components/common/business-trip-report/parts/report-header.tsx +2 -1
  91. package/src/components/common/business-trip-report/parts/uncategorized-transactions.tsx +2 -2
  92. package/src/components/common/buttons/charge-navigate-button.tsx +12 -11
  93. package/src/components/common/modals/edit-charge-modal.tsx +2 -2
  94. package/src/components/common/modals/insert-document-modal.tsx +2 -2
  95. package/src/components/common/modals/match-document-modal.tsx +2 -2
  96. package/src/components/common/new-documents-list.tsx +2 -2
  97. package/src/components/documents-table/cells/creditor.tsx +2 -11
  98. package/src/components/documents-table/cells/debtor.tsx +2 -11
  99. package/src/components/ledger-table/counterparty-cell.tsx +4 -33
  100. package/src/components/reports/conto/index.tsx +1 -18
  101. package/src/components/reports/trial-balance-report/index.tsx +1 -17
  102. package/src/components/screens/businesses/business.tsx +0 -4
  103. package/src/components/screens/charges/all-charges.tsx +1 -17
  104. package/src/components/screens/charges/charge.tsx +0 -4
  105. package/src/components/screens/reports/balance-report/index.tsx +0 -14
  106. package/src/components/screens/reports/depreciation-report/index.tsx +0 -14
  107. package/src/components/transactions-table/cells/counterparty.tsx +2 -23
  108. package/src/components/transactions-table/cells-legacy/counterparty.tsx +3 -26
  109. package/src/gql/gql.ts +6 -6
  110. package/src/gql/graphql.ts +7 -7
  111. package/src/hooks/use-get-all-contracts.ts +1 -1
  112. package/src/providers/urql.tsx +2 -2
  113. package/dist/assets/Typography-CJfovWMc.js +0 -1
  114. package/dist/assets/accountant-approvals-DhCtddzR.js +0 -1
  115. package/dist/assets/all-charges-H_xH1cUe.js +0 -1
  116. package/dist/assets/business-BtKmlUZR.js +0 -32
  117. package/dist/assets/business-transactions-single-Dv6-AKgI.js +0 -1
  118. package/dist/assets/business-trip-DIBdq8Jq.js +0 -1
  119. package/dist/assets/charges-filters-CTMCRKNm.js +0 -1
  120. package/dist/assets/charges-ledger-validation-c6jklgQz.js +0 -1
  121. package/dist/assets/editable-business-trip-Cr87pQT-.js +0 -16
  122. package/dist/assets/index-B8QopG0Z.js +0 -1
  123. package/dist/assets/index-BVZuWqUd.js +0 -1
  124. package/dist/assets/index-Bt7NK9UB.js +0 -1
  125. package/dist/assets/index-CBPTpZHL.css +0 -1
  126. package/dist/assets/index-CKfzp5hU.js +0 -1
  127. package/dist/assets/index-CTzkpoqF.js +0 -2
  128. package/dist/assets/index-CaSs1tPq.js +0 -1
  129. package/dist/assets/index-Cgl63fgb.js +0 -1
  130. package/dist/assets/index-ChwFk-6u.js +0 -1
  131. package/dist/assets/index-CnHbGv9H.js +0 -1
  132. package/dist/assets/index-CnKUadG6.js +0 -886
  133. package/dist/assets/index-CpqDv0tU.js +0 -1
  134. package/dist/assets/index-CtfXFlRt.js +0 -1
  135. package/dist/assets/index-Cyg6_G-8.js +0 -9
  136. package/dist/assets/index-b4v6_EXH.js +0 -6
  137. package/dist/assets/index-f6-rwrBW.js +0 -1
  138. package/dist/assets/index-mXqFMX5P.js +0 -1
  139. package/dist/assets/index-sUDYfUlt.js +0 -1
  140. package/dist/assets/index-tgi4TEs-.js +0 -2
  141. package/dist/assets/issue-document-CejQASYM.js +0 -1
  142. package/dist/assets/login-page-ByDrdoxH.js +0 -1
  143. package/dist/assets/missing-info-charges-DHt03bdz.js +0 -1
  144. package/dist/assets/page-not-found-Bhi5OU5Q.js +0 -1
  145. package/dist/assets/report-commentary-row-CmDH8P-d.js +0 -1
  146. package/dist/assets/sub-DBgZtyi3.js +0 -1
  147. package/dist/assets/subMonths-J6RX2Vo3.js +0 -1
  148. package/src/components/charges/helpers.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @accounter/client
2
2
 
3
- ## 0.0.8-alpha-20251028123001-a8ce4e53bbde9f6eeded7bfeea650700f6a63130
3
+ ## 0.0.8-alpha-20251028124234-328844c99a42b68aa9e2f32fd86da80b4832f631
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -110,13 +110,6 @@
110
110
  [`@radix-ui/react-progress@^1.1.7` ↗︎](https://www.npmjs.com/package/@radix-ui/react-progress/v/1.1.7)
111
111
  (to `dependencies`)
112
112
 
113
- - [#2629](https://github.com/Urigo/accounter-fullstack/pull/2629)
114
- [`2db50bd`](https://github.com/Urigo/accounter-fullstack/commit/2db50bdb84e08f0a1a6d1841292a81b80324809e)
115
- Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates:
116
- - Updated dependency
117
- [`lucide-react@0.548.0` ↗︎](https://www.npmjs.com/package/lucide-react/v/0.548.0) (from
118
- `0.546.0`, in `dependencies`)
119
-
120
113
  - [#2584](https://github.com/Urigo/accounter-fullstack/pull/2584)
121
114
  [`549a2a6`](https://github.com/Urigo/accounter-fullstack/commit/549a2a6fed7959795d7ca130b0ad567c5f4f62c8)
122
115
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Update**: Introduced a
@@ -181,25 +174,6 @@
181
174
  (e.g., `FORBIDDEN`) continue to trigger navigation to the login page, with these errors
182
175
  explicitly skipped by the new toast notification system to avoid redundant alerts.
183
176
 
184
- - [#2629](https://github.com/Urigo/accounter-fullstack/pull/2629)
185
- [`f462a4a`](https://github.com/Urigo/accounter-fullstack/commit/f462a4ac404edc7ffd646e0dc7b686d756010791)
186
- Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Update**: The
187
- `clients_contracts` table in the database has been updated to replace the single `purchase_order`
188
- column (string) with a new `purchase_orders` column, which is an array of text (`text[]`),
189
- allowing multiple POs per contract.
190
- - **GraphQL API Evolution**: The GraphQL schema has been modified to reflect this change, updating
191
- `purchaseOrder: String` to `purchaseOrders: [String!]!` across the `Contract` type,
192
- `CreateContractInput`, and `UpdateContractInput`.
193
- - **Frontend User Interface**: The client-side application now supports displaying and managing
194
- multiple Purchase Orders. Users can add new POs, view all associated POs (with the latest one
195
- highlighted), and remove POs directly from the contract modification dialog.
196
- - **Backend Logic Adaptation**: Server-side resolvers and database providers have been updated to
197
- correctly handle the new `purchase_orders` array when creating, updating, and querying
198
- contracts.
199
- - **Green Invoice Integration**: The integration with Green Invoice has been adjusted to use the
200
- first Purchase Order from the `purchase_orders` array when generating document remarks, ensuring
201
- compatibility with external systems that might expect a single PO reference.
202
-
203
177
  - [#2582](https://github.com/Urigo/accounter-fullstack/pull/2582)
204
178
  [`32276b4`](https://github.com/Urigo/accounter-fullstack/commit/32276b47e164f0976fcdd5523fa5e26f0704014f)
205
179
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Business/Client Page**: Introduced
@@ -221,6 +195,18 @@
221
195
  - **UI Library Integration**: Integrated the `@radix-ui/react-progress` component and refactored
222
196
  the `pcn874RecordType` enum definition into a shared helper for better code organization.
223
197
 
198
+ - [#2634](https://github.com/Urigo/accounter-fullstack/pull/2634)
199
+ [`328844c`](https://github.com/Urigo/accounter-fullstack/commit/328844c99a42b68aa9e2f32fd86da80b4832f631)
200
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Centralized Routing**: Introduced a new
201
+ `ROUTES` object to centralize and standardize all application routing, replacing numerous ad-hoc
202
+ URL construction functions and hardcoded paths.
203
+ - **Removed Redundant Functions**: Eliminated several `getHref` and `encodeFilters` utility
204
+ functions across various components, simplifying the codebase and reducing duplication.
205
+ - **Improved Navigation Consistency**: Updated `Link` components and navigation calls to
206
+ consistently use the new `ROUTES` object, ensuring a uniform approach to client-side routing.
207
+ - **Enhanced UX for Table Rows**: Modified table rows in `BusinessExtendedInfo` to make the entire
208
+ row clickable for navigation to charge detail pages, improving user experience.
209
+
224
210
  - [#2605](https://github.com/Urigo/accounter-fullstack/pull/2605)
225
211
  [`863a592`](https://github.com/Urigo/accounter-fullstack/commit/863a592f83b480a82156c829914b7e7a270a3f96)
226
212
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Admin Business Configuration Tab**:
@@ -1,6 +1,6 @@
1
- import{D as fr,r as w,bG as Q,eE as ur,ah as t,eF as R,bE as X,bF as D,bH as n,eG as I,bI as z,eH as _r,eI as vr,eJ as br}from"./index-CnKUadG6.js";/**
1
+ import{v as fr,r as w,bx as Q,ef as ur,a9 as t,eg as R,bv as X,bw as D,by as n,eh as z,bz as I,ei as vr,ej as _r,ek as br}from"./index-wyU9I4Kz.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"}]],Br=fr("merge",yr),Z=w.createContext(null),mr=Z.Provider,gr=()=>w.useContext(Z);var Pr=Object.defineProperty,x=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(x)for(var a of x(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&&x)for(var o of x(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,hr=Object.defineProperties,xr=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Sr=Object.prototype.propertyIsEnumerable,Y=(r,e,a)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,B=(r,e)=>{for(var a in e||(e={}))kr.call(e,a)&&Y(r,a,e[a]);if(W)for(var a of W(e))Sr.call(e,a)&&Y(r,a,e[a]);return r},J=(r,e)=>hr(r,xr(e));const Er={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Cr=X((r,{radius:e,color:a,transitionDuration:o,labelPosition:f,error:u,indeterminate:i},{size:c})=>{const s=D({size:c,sizes:Er}),d=r.fn.variant({variant:"filled",color:a});return{icon:J(B({},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:J(B({},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,U=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable,q=(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)&&q(r,a,e[a]);if(U)for(var a of U(e))Rr.call(e,a)&&q(r,a,e[a]);return r},Gr=(r,e)=>Ir(r,zr(e));const j={xs:n(16),sm:n(20),md:n(24),lg:n(30),xl:n(36)};var Vr=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:Gr(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,A=(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)&&A(r,a,e[a]);if(k)for(var a of k(e))tr.call(e,a)&&A(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:E}=a,C=Lr(a,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","bodyElement","labelElement","variant"]);const{classes:p,cx:O}=Vr({labelPosition:$},{name:o,styles:i,classNames:u,unstyled:c,variant:E,size:v});return t.createElement(z,Fr({className:O(p.root,f),ref:e},C),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,K=(r,e,a)=>e in r?Hr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,h=(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},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:E,icon:C,unstyled:p,labelPosition:O,description:cr,error:G,variant:V}=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:F}=br(dr),{classes:N}=Cr({radius:_,color:s,transitionDuration:E,labelPosition:O,error:!!G,indeterminate:l},{name:"Checkbox",classNames:g,styles:P,unstyled:p,variant:V,size:b?.size||m}),L=b?{checked:b.value.includes(F.value),onChange:b.onChange}:{};return t.createElement(nr,h(h({className:o,sx:u,style:f,id:T,size:b?.size||m,labelPosition:O,label:d,description:cr,error:G,disabled:c,__staticSelector:"Checkbox",classNames:g,styles:P,unstyled:p,"data-checked":L.checked||void 0,variant:V},pr),v),t.createElement("div",{className:N.inner},t.createElement("input",h(h({id:T,ref:e,type:"checkbox",className:N.input,checked:i,disabled:c},F),L)),t.createElement(C,{indeterminate:l,className:N.icon})))});ir.displayName="@mantine/core/Checkbox";ir.Group=ar;export{ir as C,Br 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"}]],Br=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,W=(r,e,a)=>e in r?Pr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,F=(r,e)=>{for(var a in e||(e={}))rr.call(e,a)&&W(r,a,e[a]);if(h)for(var a of h(e))er.call(e,a)&&W(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=v=>{const _=v.currentTarget.value;y(l.includes(_)?l.filter($=>$!==_):[...l,_])};return t.createElement(mr,{value:{value:l,onChange:m,size:c}},t.createElement(R.Wrapper,F(F({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,Y=(r,e,a)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,B=(r,e)=>{for(var a in e||(e={}))kr.call(e,a)&&Y(r,a,e[a]);if(H)for(var a of H(e))Sr.call(e,a)&&Y(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(B({},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(B({},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,Lr=(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},Mr=(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:v,size:_,labelPosition:$,bodyElement:g="div",labelElement:P="label",variant:C}=a,E=Mr(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:_});return t.createElement(I,Lr({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),v&&v!=="boolean"&&t.createElement(R.Error,{className:p.error},v))))});nr.displayName="@mantine/core/InlineInput";var Wr=Object.defineProperty,S=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,K=(r,e,a)=>e in r?Wr(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},Fr=(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:vr,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:v,wrapperProps:_,children:$,classNames:g,styles:P,transitionDuration:C,icon:E,unstyled:p,labelPosition:O,description:cr,error:V,variant:G}=a,dr=Fr(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=_r(y),{systemStyles:pr,rest:L}=br(dr),{classes:N}=Er({radius:v,color:s,transitionDuration:C,labelPosition:O,error:!!V,indeterminate:l},{name:"Checkbox",classNames:g,styles:P,unstyled:p,variant:G,size:b?.size||m}),M=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:V,disabled:c,__staticSelector:"Checkbox",classNames:g,styles:P,unstyled:p,"data-checked":M.checked||void 0,variant:G},pr),_),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),M)),t.createElement(E,{indeterminate:l,className:N.icon})))});ir.displayName="@mantine/core/Checkbox";ir.Group=ar;export{ir as C,Br as M};
@@ -0,0 +1 @@
1
+ import{bv as Ee,by as f,bw as _,a9 as p,es as Br,hi as Se,r as E,bx as Lr,et as Fr,hj as Hr,ek as Wr,ej as Ar,ef as _e,hk as Kr,hl as Ur,fE as ae,eg as Oe,hm as te,hn as qr,eq as Tr,ho as Zr,hp as Gr}from"./index-wyU9I4Kz.js";const Ve={xs:f(16),sm:f(22),md:f(26),lg:f(30),xl:f(36)},Jr={xs:f(10),sm:f(12),md:f(14),lg:f(16),xl:f(18)};var Qr=Ee((e,{disabled:r,radius:a,readOnly:n},{size:v,variant:w})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:r?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:w==="filled"?e.white:e.colors.gray[1],color:r?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:_({size:v,sizes:Ve}),paddingLeft:`calc(${_({size:v,sizes:e.spacing})} / 1.5)`,paddingRight:r||n?_({size:v,sizes:e.spacing}):0,fontWeight:500,fontSize:_({size:v,sizes:Jr}),borderRadius:_({size:a,sizes:e.radius}),cursor:r?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${f(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${_({size:v,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),Xr=Object.defineProperty,G=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,Re=Object.prototype.propertyIsEnumerable,Pe=(e,r,a)=>r in e?Xr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,Yr=(e,r)=>{for(var a in r||(r={}))$e.call(r,a)&&Pe(e,a,r[a]);if(G)for(var a of G(r))Re.call(r,a)&&Pe(e,a,r[a]);return e},ea=(e,r)=>{var a={};for(var n in e)$e.call(e,n)&&r.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&G)for(var n of G(e))r.indexOf(n)<0&&Re.call(e,n)&&(a[n]=e[n]);return a};const ra={xs:16,sm:22,md:24,lg:26,xl:30};function Ne(e){var r=e,{label:a,classNames:n,styles:v,className:w,onRemove:z,disabled:I,readOnly:s,size:u,radius:h="sm",variant:O,unstyled:K}=r,Q=ea(r,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:H,cx:M}=Qr({disabled:I,readOnly:s,radius:h},{name:"MultiSelect",classNames:n,styles:v,unstyled:K,size:u,variant:O});return p.createElement("div",Yr({className:M(H.defaultValue,w)},Q),p.createElement("span",{className:H.defaultValueLabel},a),!I&&!s&&p.createElement(Br,{"aria-hidden":!0,onMouseDown:z,size:ra[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:H.defaultValueRemove,tabIndex:-1,unstyled:K}))}Ne.displayName="@mantine/core/MultiSelect/DefaultValue";function aa({data:e,searchable:r,limit:a,searchValue:n,filter:v,value:w,disableSelectedItemFiltering:z}){if(!r&&w.length===0)return e;if(!r){const s=[];for(let u=0;u<e.length;u+=1)(z||!w.some(h=>h===e[u].value&&!e[u].disabled))&&s.push(e[u]);return s}const I=[];for(let s=0;s<e.length&&(v(n,!z&&w.some(u=>u===e[s].value&&!e[s].disabled),e[s])&&I.push(e[s]),!(I.length>=a));s+=1);return I}var ta=Object.defineProperty,na=Object.defineProperties,la=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Ie=(e,r,a)=>r in e?ta(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,ia=(e,r)=>{for(var a in r||(r={}))oa.call(r,a)&&Ie(e,a,r[a]);if(xe)for(var a of xe(r))sa.call(r,a)&&Ie(e,a,r[a]);return e},ca=(e,r)=>na(e,la(r)),ua=Ee((e,{invalid:r},{size:a})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${_({size:a,sizes:Se})} - ${f(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:_({size:a,sizes:Se})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${f(2)}) calc(${e.spacing.xs} / 2)`},searchInput:ca(ia({},e.fn.fontStyles()),{flex:1,minWidth:f(60),backgroundColor:"transparent",border:0,outline:0,fontSize:_({size:a,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:_({size:a,sizes:Ve}),"&::placeholder":{opacity:1,color:r?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}})),da=Object.defineProperty,pa=Object.defineProperties,fa=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,Ce=(e,r,a)=>r in e?da(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,F=(e,r)=>{for(var a in r||(r={}))ze.call(r,a)&&Ce(e,a,r[a]);if(J)for(var a of J(r))Me.call(r,a)&&Ce(e,a,r[a]);return e},De=(e,r)=>pa(e,fa(r)),ha=(e,r)=>{var a={};for(var n in e)ze.call(e,n)&&r.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&J)for(var n of J(e))r.indexOf(n)<0&&Me.call(e,n)&&(a[n]=e[n]);return a};function ga(e,r,a){return r?!1:a.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function ma(e,r){return!!e&&!r.some(a=>a.value.toLowerCase()===e.toLowerCase())}function ke(e,r){if(!Array.isArray(e))return;if(r.length===0)return[];const a=r.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>a.includes(n))}const va={size:"sm",valueComponent:Ne,itemComponent:Hr,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:ga,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:ma,switchDirectionOnFlip:!1,zIndex:Fr("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},ba=E.forwardRef((e,r)=>{const a=Lr("MultiSelect",va,e),{className:n,style:v,required:w,label:z,description:I,size:s,error:u,classNames:h,styles:O,wrapperProps:K,value:Q,defaultValue:H,data:M,onChange:je,valueComponent:Be,itemComponent:Le,id:Fe,transitionProps:He,maxDropdownHeight:We,shadow:wa,nothingFound:ne,onFocus:le,onBlur:oe,searchable:y,placeholder:Ae,filter:Ke,limit:Ue,clearSearchOnChange:qe,clearable:se,clearSearchOnBlur:Te,variant:j,onSearchChange:Ze,searchValue:Ge,disabled:P,initiallyOpened:Je,radius:ie,icon:Qe,rightSection:Xe,rightSectionWidth:Ye,creatable:ce,getCreateLabel:ue,shouldCreate:er,onCreate:de,sx:rr,dropdownComponent:ar,onDropdownClose:tr,onDropdownOpen:nr,maxSelectedValues:g,withinPortal:lr,portalProps:or,switchDirectionOnFlip:sr,zIndex:ir,selectOnBlur:cr,name:ur,dropdownPosition:dr,errorProps:pr,labelProps:fr,descriptionProps:hr,form:gr,positionDependencies:mr,onKeyDown:pe,unstyled:W,inputContainer:vr,inputWrapperOrder:br,readOnly:V,withAsterisk:wr,clearButtonProps:yr,hoverOnSearchChange:fe,disableSelectedItemFiltering:Sr}=a,_r=ha(a,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:C,cx:he,theme:Or}=ua({invalid:!!u},{name:"MultiSelect",classNames:h,styles:O,unstyled:W,size:s,variant:j}),{systemStyles:Pr,rest:xr}=Wr(_r),X=E.useRef(),Y=E.useRef({}),B=Ar(Fe),[d,c]=E.useState(Je),[Ir,D]=E.useState(-1),[ge,Cr]=E.useState("column"),[S,U]=_e({value:Ge,defaultValue:"",finalValue:void 0,onChange:Ze}),[Dr,me]=E.useState(!1),{scrollIntoView:q,targetRef:ve,scrollableRef:kr}=Kr({duration:0,offset:5,cancelable:!1,isList:!0}),be=ce&&typeof ue=="function";let ee=null;const Er=M.map(t=>typeof t=="string"?{label:t,value:t}:t),re=Ur({data:Er}),[o,L]=_e({value:ke(Q,M),defaultValue:ke(H,M),finalValue:[],onChange:je}),b=E.useRef(!!g&&g<o.length),we=t=>{if(!V){const l=o.filter(m=>m!==t);L(l),g&&l.length<g&&(b.current=!1)}},Vr=t=>{U(t.currentTarget.value),!P&&!b.current&&y&&c(!0)},$r=t=>{typeof le=="function"&&le(t),!P&&!b.current&&y&&c(!0)},i=aa({data:re,searchable:y,searchValue:S,limit:Ue,filter:Ke,value:o,disableSelectedItemFiltering:Sr});be&&er(S,re)&&(ee=ue(S),i.push({label:S,value:S,creatable:!0}));const $=Math.min(Ir,i.length-1),ye=(t,l,m)=>{let k=t;for(;m(k);)if(k=l(k),!i[k].disabled)return k;return t};ae(()=>{D(fe&&S?0:-1)},[S,fe]),ae(()=>{!P&&o.length>M.length&&c(!1),g&&o.length<g&&(b.current=!1),g&&o.length>=g&&(b.current=!0,c(!1))},[o]);const T=t=>{if(!V)if(qe&&U(""),o.includes(t.value))we(t.value);else{if(t.creatable&&typeof de=="function"){const l=de(t.value);typeof l<"u"&&l!==null&&L(typeof l=="string"?[...o,l]:[...o,l.value])}else L([...o,t.value]);o.length===g-1&&(b.current=!0,c(!1)),i.length===1&&c(!1)}},Rr=t=>{typeof oe=="function"&&oe(t),cr&&i[$]&&d&&T(i[$]),Te&&U(""),c(!1)},Nr=t=>{if(Dr||(pe?.(t),V)||t.key!=="Backspace"&&g&&b.current)return;const l=ge==="column",m=()=>{D(R=>{var x;const A=ye(R,N=>N+1,N=>N<i.length-1);return d&&(ve.current=Y.current[(x=i[A])==null?void 0:x.value],q({alignment:l?"end":"start"})),A})},k=()=>{D(R=>{var x;const A=ye(R,N=>N-1,N=>N>0);return d&&(ve.current=Y.current[(x=i[A])==null?void 0:x.value],q({alignment:l?"start":"end"})),A})};switch(t.key){case"ArrowUp":{t.preventDefault(),c(!0),l?k():m();break}case"ArrowDown":{t.preventDefault(),c(!0),l?m():k();break}case"Enter":{t.preventDefault(),i[$]&&d?T(i[$]):c(!0);break}case" ":{y||(t.preventDefault(),i[$]&&d?T(i[$]):c(!0));break}case"Backspace":{o.length>0&&S.length===0&&(L(o.slice(0,-1)),c(!0),g&&(b.current=!1));break}case"Home":{if(!y){t.preventDefault(),d||c(!0);const R=i.findIndex(x=>!x.disabled);D(R),q({alignment:l?"end":"start"})}break}case"End":{if(!y){t.preventDefault(),d||c(!0);const R=i.map(x=>!!x.disabled).lastIndexOf(!1);D(R),q({alignment:l?"end":"start"})}break}case"Escape":c(!1)}},zr=o.map(t=>{let l=re.find(m=>m.value===t&&!m.disabled);return!l&&be&&(l={value:t,label:t}),l}).filter(t=>!!t).map((t,l)=>p.createElement(Be,De(F({},t),{variant:j,disabled:P,className:C.value,readOnly:V,onRemove:m=>{m.preventDefault(),m.stopPropagation(),we(t.value)},key:t.value,size:s,styles:O,classNames:h,radius:ie,index:l}))),Mr=t=>o.includes(t),jr=()=>{var t;U(""),L([]),(t=X.current)==null||t.focus(),g&&(b.current=!1)},Z=!V&&(i.length>0?d:d&&!!ne);return ae(()=>{const t=Z?nr:tr;typeof t=="function"&&t()},[Z]),p.createElement(Oe.Wrapper,F(F({required:w,id:B,label:z,error:u,description:I,size:s,className:n,style:v,classNames:h,styles:O,__staticSelector:"MultiSelect",sx:rr,errorProps:pr,descriptionProps:hr,labelProps:fr,inputContainer:vr,inputWrapperOrder:br,unstyled:W,withAsterisk:wr,variant:j},Pr),K),p.createElement(te,{opened:Z,transitionProps:He,shadow:"sm",withinPortal:lr,portalProps:or,__staticSelector:"MultiSelect",onDirectionChange:Cr,switchDirectionOnFlip:sr,zIndex:ir,dropdownPosition:dr,positionDependencies:[...mr,S],classNames:h,styles:O,unstyled:W,variant:j},p.createElement(te.Target,null,p.createElement("div",{className:C.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":d&&Z?`${B}-items`:null,"aria-controls":B,"aria-expanded":d,onMouseLeave:()=>D(-1),tabIndex:-1},p.createElement("input",{type:"hidden",name:ur,value:o.join(","),form:gr,disabled:P}),p.createElement(Oe,F({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:s,variant:j,disabled:P,error:u,required:w,radius:ie,icon:Qe,unstyled:W,onMouseDown:t=>{var l;t.preventDefault(),!P&&!b.current&&c(!d),(l=X.current)==null||l.focus()},classNames:De(F({},h),{input:he({[C.input]:!y},h?.input)})},qr({theme:Or,rightSection:Xe,rightSectionWidth:Ye,styles:O,size:s,shouldClear:se&&o.length>0,onClear:jr,error:u,disabled:P,clearButtonProps:yr,readOnly:V})),p.createElement("div",{className:C.values,"data-clearable":se||void 0},zr,p.createElement("input",F({ref:Tr(r,X),type:"search",id:B,className:he(C.searchInput,{[C.searchInputPointer]:!y,[C.searchInputInputHidden]:!d&&o.length>0||!y&&o.length>0,[C.searchInputEmpty]:o.length===0}),onKeyDown:Nr,value:S,onChange:Vr,onFocus:$r,onBlur:Rr,readOnly:!y||b.current||V,placeholder:o.length===0?Ae:void 0,disabled:P,"data-mantine-stop-propagation":d,autoComplete:"off",onCompositionStart:()=>me(!0),onCompositionEnd:()=>me(!1)},xr)))))),p.createElement(te.Dropdown,{component:ar||Zr,maxHeight:We,direction:ge,id:B,innerRef:kr,__staticSelector:"MultiSelect",classNames:h,styles:O},p.createElement(Gr,{data:i,hovered:$,classNames:h,styles:O,uuid:B,__staticSelector:"MultiSelect",onItemHover:D,onItemSelect:T,itemsRefs:Y,itemComponent:Le,size:s,nothingFound:ne,isItemSelected:Mr,creatable:ce&&!!ee,createLabel:ee,unstyled:W,variant:j}))))});ba.displayName="@mantine/core/MultiSelect";export{ba as M};
@@ -0,0 +1 @@
1
+ import{ef as xt,r as Z,eG as It,bx as S,a9 as o,bv as tt,by as x,bw as m,fc as Et,bz as St,eo as Nt,fG as Lt,eY as jt}from"./index-wyU9I4Kz.js";import{c as R}from"./create-event-handler-BiA-1lGu.js";function u(t,e){const a=e-t+1;return Array.from({length:a},(n,i)=>i+t)}const M="dots";function zt({total:t,siblings:e=1,boundaries:a=1,page:n,initialPage:i=1,onChange:s}){const r=Math.max(Math.trunc(t),0),[c,l]=xt({value:n,onChange:s,defaultValue:i,finalValue:i}),f=P=>{P<=0?l(1):P>r?l(r):l(P)},g=()=>f(c+1),_=()=>f(c-1),d=()=>f(1),y=()=>f(r);return{range:Z.useMemo(()=>{if(e*2+3+a*2>=r)return u(1,r);const w=Math.max(c-e,a),C=Math.min(c+e,r-a),b=w>a+2,$=C<r-(a+1);if(!b&&$){const O=e*2+a+2;return[...u(1,O),M,...u(r-(a-1),r)]}if(b&&!$){const O=a+1+2*e;return[...u(1,a),M,...u(r-O,r)]}return[...u(1,a),M,...u(w,C),M,...u(r-a+1,r)]},[r,e,c]),active:c,setPage:f,next:g,previous:_,first:d,last:y}}const[Rt,B]=It("Pagination.Root component was not found in tree"),Mt={siblings:1,boundaries:1};function ft(t){const{total:e,value:a,defaultValue:n,onChange:i,disabled:s,children:r,siblings:c,boundaries:l,color:f,radius:g,onNextPage:_,onPreviousPage:d,onFirstPage:y,onLastPage:j,getItemProps:P,classNames:w,styles:C,unstyled:b,variant:$,size:O}=S("PaginationRoot",Mt,t),{range:T,setPage:U,next:p,previous:z,active:W,first:Y,last:q}=zt({page:a,initialPage:n,onChange:i,total:e,siblings:c,boundaries:l}),J=R(_,p),K=R(d,z),Q=R(y,Y),X=R(j,q);return o.createElement(Rt,{value:{total:e,range:T,active:W,disabled:s,color:f,radius:g,getItemProps:P,onChange:U,onNext:J,onPrevious:K,onFirst:Q,onLast:X,stylesApi:{name:"Pagination",classNames:w,styles:C,unstyled:b,variant:$,size:O}}},r)}const E={xs:x(22),sm:x(26),md:x(32),lg:x(38),xl:x(44)};var Dt=tt((t,{color:e,radius:a,withPadding:n},{size:i})=>{const s=t.fn.variant({color:e,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${x(1)} solid ${t.colorScheme==="dark"?t.colors.dark[4]:t.colors.gray[4]}`,color:t.colorScheme==="dark"?t.colors.dark[0]:t.black,height:m({size:i,sizes:E}),minWidth:m({size:i,sizes:E}),padding:n?`0 calc(${m({size:i,sizes:t.spacing})} / 2)`:void 0,fontSize:m({size:i,sizes:t.fontSizes}),borderRadius:t.fn.radius(a),lineHeight:1,backgroundColor:t.colorScheme==="dark"?t.colors.dark[6]:t.white,"&:not([data-disabled])":t.fn.hover({backgroundColor:t.colorScheme==="dark"?t.colors.dark[5]:t.colors.gray[0]}),"&:active:not([data-disabled])":t.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:s.color,backgroundColor:s.background,"&:not([data-disabled])":t.fn.hover({backgroundColor:s.hover})}}}}),Ft=Object.defineProperty,Vt=Object.defineProperties,At=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,nt=(t,e,a)=>e in t?Ft(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,kt=(t,e)=>{for(var a in e||(e={}))dt.call(e,a)&&nt(t,a,e[a]);if(D)for(var a of D(e))pt.call(e,a)&&nt(t,a,e[a]);return t},Zt=(t,e)=>Vt(t,At(e)),Bt=(t,e)=>{var a={};for(var n in t)dt.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&D)for(var n of D(t))e.indexOf(n)<0&&pt.call(t,n)&&(a[n]=t[n]);return a};const Gt={withPadding:!0},G=Z.forwardRef((t,e)=>{const a=S("PaginationControl",Gt,t),{active:n,className:i,disabled:s,withPadding:r}=a,c=Bt(a,["active","className","disabled","withPadding"]),l=B(),{classes:f,cx:g}=Dt({color:l.color,radius:l.radius,withPadding:r},l.stylesApi);return o.createElement(Et,Zt(kt({},c),{disabled:s,"data-active":n||void 0,"data-disabled":s||void 0,ref:e,className:g(f.control,i)}))});G.displayName="@mantine/core/PaginationControl";var Ht=Object.defineProperty,Tt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,rt=(t,e,a)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,h=(t,e)=>{for(var a in e||(e={}))gt.call(e,a)&&rt(t,a,e[a]);if(F)for(var a of F(e))vt.call(e,a)&&rt(t,a,e[a]);return t},N=(t,e)=>Tt(t,Ut(e)),Wt=(t,e)=>{var a={};for(var n in t)gt.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&F)for(var n of F(t))e.indexOf(n)<0&&vt.call(t,n)&&(a[n]=t[n]);return a};function Pt(t){return`calc(${m({size:t,sizes:E})} / 2)`}function L(t){var e=t,{size:a,style:n,children:i,path:s}=e,r=Wt(e,["size","style","children","path"]);return o.createElement("svg",h({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:h({width:a,height:a},n)},r),o.createElement("path",{d:s,fill:"currentColor"}))}const Yt=t=>o.createElement(L,N(h({},t),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),qt=t=>o.createElement(L,N(h({},t),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),Jt=t=>o.createElement(L,N(h({},t),{path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"})),Kt=t=>o.createElement(L,N(h({},t),{path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"})),Qt=t=>o.createElement(L,N(h({},t),{path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}));var Xt=tt((t,e,{size:a})=>({dots:{height:m({size:a,sizes:E}),minWidth:m({size:a,sizes:E}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}})),te=Object.defineProperty,V=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,ot=(t,e,a)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,ee=(t,e)=>{for(var a in e||(e={}))ut.call(e,a)&&ot(t,a,e[a]);if(V)for(var a of V(e))mt.call(e,a)&&ot(t,a,e[a]);return t},ae=(t,e)=>{var a={};for(var n in t)ut.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&V)for(var n of V(t))e.indexOf(n)<0&&mt.call(t,n)&&(a[n]=t[n]);return a};const ne={icon:Qt},et=Z.forwardRef((t,e)=>{const a=S("PaginationDots",ne,t),{className:n,icon:i}=a,s=ae(a,["className","icon"]),r=B(),{classes:c,cx:l}=Xt(null,r.stylesApi);return o.createElement(St,ee({ref:e,className:l(c.dots,n)},s),o.createElement(i,{size:Pt(r.stylesApi.size)}))});et.displayName="@mantine/core/PaginationDots";var re=Object.defineProperty,it=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,st=(t,e,a)=>e in t?re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,se=(t,e)=>{for(var a in e||(e={}))oe.call(e,a)&&st(t,a,e[a]);if(it)for(var a of it(e))ie.call(e,a)&&st(t,a,e[a]);return t};function at({dotsIcon:t}){const e=B(),a=e.range.map((n,i)=>{var s;return n==="dots"?o.createElement(et,{icon:t,key:i}):o.createElement(G,se({key:i,active:n===e.active,"aria-current":n===e.active?"page":void 0,onClick:()=>e.onChange(n),disabled:e.disabled},(s=e.getItemProps)==null?void 0:s.call(e,n)),n)});return o.createElement(o.Fragment,null,a)}at.displayName="@mantine/core/PaginationItems";var le=tt(t=>({icon:{transform:t.dir==="rtl"?"rotate(180deg)":"unset"}})),ce=Object.defineProperty,A=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,lt=(t,e,a)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,fe=(t,e)=>{for(var a in e||(e={}))_t.call(e,a)&&lt(t,a,e[a]);if(A)for(var a of A(e))yt.call(e,a)&&lt(t,a,e[a]);return t},de=(t,e)=>{var a={};for(var n in t)_t.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&A)for(var n of A(t))e.indexOf(n)<0&&yt.call(t,n)&&(a[n]=t[n]);return a};function H({icon:t,name:e,action:a,type:n}){const i={icon:t},s=Z.forwardRef((r,c)=>{const l=S(e,i,r),{icon:f}=l,g=de(l,["icon"]),{classes:_}=le(),d=B(),y=n==="next"?d.active===d.total:d.active===1;return o.createElement(G,fe({disabled:d.disabled||y,ref:c,onClick:d[a],withPadding:!1},g),o.createElement(f,{className:_.icon,size:Pt(d.stylesApi.size)}))});return s.displayName=`@mantine/core/${e}`,Nt(s)}const Ot=H({icon:Yt,name:"PaginationNext",action:"onNext",type:"next"}),ht=H({icon:qt,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),wt=H({icon:Jt,name:"PaginationFirst",action:"onFirst",type:"previous"}),Ct=H({icon:Kt,name:"PaginationLast",action:"onLast",type:"next"});var pe=Object.defineProperty,k=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,ct=(t,e,a)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,I=(t,e)=>{for(var a in e||(e={}))bt.call(e,a)&&ct(t,a,e[a]);if(k)for(var a of k(e))$t.call(e,a)&&ct(t,a,e[a]);return t},ge=(t,e)=>{var a={};for(var n in t)bt.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&k)for(var n of k(t))e.indexOf(n)<0&&$t.call(t,n)&&(a[n]=t[n]);return a};const ve={withControls:!0,siblings:1,boundaries:1};function v(t){const e=S("Pagination",ve,t),{withEdges:a,withControls:n,classNames:i,styles:s,unstyled:r,variant:c,size:l,total:f,value:g,defaultValue:_,onChange:d,disabled:y,siblings:j,boundaries:P,color:w,radius:C,onNextPage:b,onPreviousPage:$,onFirstPage:O,onLastPage:T,getItemProps:U,getControlProps:p,spacing:z,nextIcon:W,previousIcon:Y,lastIcon:q,firstIcon:J,dotsIcon:K}=e,Q=ge(e,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),X=Lt();return f<=0?null:o.createElement(ft,{classNames:i,styles:s,unstyled:r,variant:c,size:l,total:f,value:g,defaultValue:_,onChange:d,disabled:y,siblings:j,boundaries:P,color:w,radius:C,onNextPage:b,onPreviousPage:$,onFirstPage:O,onLastPage:T,getItemProps:U},o.createElement(jt,I({spacing:z??`calc(${m({size:l,sizes:X.spacing})} / 2)`},Q),a&&o.createElement(wt,I({icon:J},p?.("first"))),n&&o.createElement(ht,I({icon:Y},p?.("previous"))),o.createElement(at,{dotsIcon:K}),n&&o.createElement(Ot,I({icon:W},p?.("next"))),a&&o.createElement(Ct,I({icon:q},p?.("last")))))}v.displayName="@mantine/core/Pagination";v.Root=ft;v.Items=at;v.Control=G;v.Dots=et;v.Next=Ot;v.Previous=ht;v.Last=Ct;v.First=wt;export{v as P};
@@ -1 +1 @@
1
- import{bE as H,bF as _,bH as o,dW as M,r as q,bG as J,ah as s,T as K,bI as w,b$ as O}from"./index-CnKUadG6.js";const k={xs:o(3),sm:o(5),md:o(8),lg:o(12),xl:o(16)},Q=M({from:{backgroundPosition:"0 0"},to:{backgroundPosition:`${o(40)} 0`}});var U=H((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:`${Q} 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"}})),X=Object.defineProperty,Y=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,N=(a,r,e)=>r in a?X(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},h=(a,r)=>Y(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(h(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=J("Progress",ea,a),{className:t,value:c,color:E,size:C,radius:$,striped:u,animate:i,label:m,"aria-label":j,classNames:z,styles:I,sections:p,unstyled:T,variant:D}=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}=U({color:E,radius:$},{name:"Progress",classNames:z,styles:I,unstyled:T,variant:D,size:C}),L=Array.isArray(p)?aa(p).map((A,B)=>{var v=A,{tooltip:g,accumulated:V,value:W,label:y,color:G}=v,P=x(v,["tooltip","accumulated","value","label","color"]);return s.createElement(K.Floating,{label:g,disabled:!g,key:B},s.createElement(w,h(d({},P),{className:f(l.bar,P.className),"data-striped":u||i||void 0,"data-animate":i||void 0,sx:{width:`${W}%`,left:`${V}%`,backgroundColor:b.fn.variant({variant:"filled",primaryFallback:!1,color:G||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),L||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{bv as q,bw as _,by as o,dm as G,r as H,bx as J,a9 as s,T as K,bz as w,bg as O}from"./index-wyU9I4Kz.js";const k={xs:o(3),sm:o(5),md:o(8),lg:o(12),xl:o(16)},Q=G({from:{backgroundPosition:"0 0"},to:{backgroundPosition:`${o(40)} 0`}});var U=q((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:`${Q} 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"}})),X=Object.defineProperty,Y=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,x=(a,r,e)=>r in a?X(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)&&x(a,e,r[e]);if(n)for(var e of n(r))S.call(r,e)&&x(a,e,r[e]);return a},h=(a,r)=>Y(a,Z(r)),N=(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(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=H.forwardRef((a,r)=>{const e=J("Progress",ea,a),{className:t,value:c,color:C,size:E,radius:$,striped:u,animate:i,label:m,"aria-label":z,classNames:j,styles:T,sections:p,unstyled:D,variant:I}=e,L=N(e,["className","value","color","size","radius","striped","animate","label","aria-label","classNames","styles","sections","unstyled","variant"]),{classes:l,cx:f,theme:b}=U({color:C,radius:$},{name:"Progress",classNames:j,styles:T,unstyled:D,variant:I,size:E}),A=Array.isArray(p)?aa(p).map((B,F)=>{var v=B,{tooltip:g,accumulated:V,value:M,label:y,color:W}=v,P=N(v,["tooltip","accumulated","value","label","color"]);return s.createElement(K.Floating,{label:g,disabled:!g,key:F},s.createElement(w,h(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:W||b.primaryColor}).background}}),y&&s.createElement(O,{className:l.label},y)))}):null;return s.createElement(w,d({className:f(l.root,t),ref:r},L),A||s.createElement("div",{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-label":z,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};
@@ -0,0 +1 @@
1
+ import{bv as $,by as k,bw as s,r as x,bx as j,a9 as m,bz as T}from"./index-wyU9I4Kz.js";var B=Object.defineProperty,E=Object.defineProperties,N=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,p=(r,o,t)=>o in r?B(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,D=(r,o)=>{for(var t in o||(o={}))R.call(o,t)&&p(r,t,o[t]);if(c)for(var t of c(o))C.call(o,t)&&p(r,t,o[t]);return r},H=(r,o)=>E(r,N(o)),I=$((r,{captionSide:o,horizontalSpacing:t,verticalSpacing:e,fontSize:n,withBorder:d,withColumnBorders:i})=>{const a=`${k(1)} solid ${r.colorScheme==="dark"?r.colors.dark[4]:r.colors.gray[3]}`;return{root:H(D({},r.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:o,color:r.colorScheme==="dark"?r.colors.dark[0]:r.black,lineHeight:r.lineHeight,border:d?a:void 0,"& > caption":{marginTop:o==="top"?0:r.spacing.xs,marginBottom:o==="bottom"?0:r.spacing.xs,fontSize:r.fontSizes.sm,color:r.colorScheme==="dark"?r.colors.dark[2]:r.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:r.colorScheme==="dark"?r.colors.dark[0]:r.colors.gray[7],fontSize:s({size:n,sizes:r.fontSizes}),padding:`${s({size:e,sizes:r.spacing})} ${s({size:t,sizes:r.spacing})}`},"& > thead > tr > th":{borderBottom:a},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:a},"& > tbody > tr > td":{padding:`${s({size:e,sizes:r.spacing})} ${s({size:t,sizes:r.spacing})}`,borderTop:a,fontSize:s({size:n,sizes:r.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:i?a:"none","&:last-of-type":{borderRight:"none",borderLeft:i?a:"none"}},"& > tbody > tr > th":{borderRight:i?a:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.colors.gray[0]},"&[data-hover] > tbody > tr":r.fn.hover({backgroundColor:r.colorScheme==="dark"?r.colors.dark[5]:r.colors.gray[1]})})}}),V=Object.defineProperty,A=Object.defineProperties,L=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,f=(r,o,t)=>o in r?V(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,W=(r,o)=>{for(var t in o||(o={}))g.call(o,t)&&f(r,t,o[t]);if(l)for(var t of l(o))b.call(o,t)&&f(r,t,o[t]);return r},q=(r,o)=>A(r,L(o)),F=(r,o)=>{var t={};for(var e in r)g.call(r,e)&&o.indexOf(e)<0&&(t[e]=r[e]);if(r!=null&&l)for(var e of l(r))o.indexOf(e)<0&&b.call(r,e)&&(t[e]=r[e]);return t};const G={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},J=x.forwardRef((r,o)=>{const t=j("Table",G,r),{className:e,children:n,striped:d,highlightOnHover:i,captionSide:a,horizontalSpacing:v,verticalSpacing:y,fontSize:_,unstyled:O,withBorder:S,withColumnBorders:P,variant:z}=t,h=F(t,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:u,cx:w}=I({captionSide:a,verticalSpacing:y,horizontalSpacing:v,fontSize:_,withBorder:S,withColumnBorders:P},{unstyled:O,name:"Table",variant:z});return m.createElement(T,q(W({},h),{component:"table",ref:o,className:w(u.root,e),"data-striped":d||void 0,"data-hover":i||void 0}),n)});J.displayName="@mantine/core/Table";export{J as T};
@@ -0,0 +1 @@
1
+ import{dG as S,dH as K,dI as Q,dJ as X,dK as W,dL as Y,cA as Z,cz as z,r as A,cE as N,dM as tt,j as et,aa as rt,dn as V}from"./index-wyU9I4Kz.js";function kt(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}const $=t=>t,nt=()=>{let t=$;return{configure(e){t=e},generate(e){return t(e)},reset(){t=$}}},ot=nt(),st={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 G(t,e,r="Mui"){const n=st[e];return n?`${r}-${n}`:`${ot.generate(t)}-${e}`}function it(t,e,r="Mui"){const n={};return e.forEach(o=>{n[o]=G(t,o,r)}),n}function I(t){const{variants:e,...r}=t,n={variants:e,style:S(r),isProcessed:!0};return n.style===r||e&&e.forEach(o=>{typeof o.style!="function"&&(o.style=S(o.style))}),n}const at=K();function L(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function g(t,e){return e&&t&&typeof t=="object"&&t.styles&&!t.styles.startsWith("@layer")&&(t.styles=`@layer ${e}{${String(t.styles)}}`),t}function lt(t){return t?(e,r)=>r[t]:null}function ut(t,e,r){t.theme=ht(t.theme)?r:t.theme[e]||t.theme}function M(t,e,r){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(o=>M(t,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 U(t,n.variants,[o],r)}return n?.isProcessed?r?g(S(n.style),r):n.style:r?g(S(n),r):n}function U(t,e,r=[],n=void 0){let o;t:for(let s=0;s<e.length;s+=1){const i=e[s];if(typeof i.props=="function"){if(o??={...t,...t.ownerState,ownerState:t.ownerState},!i.props(o))continue}else for(const a in i.props)if(t[a]!==i.props[a]&&t.ownerState?.[a]!==i.props[a])continue t;typeof i.style=="function"?(o??={...t,...t.ownerState,ownerState:t.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 ct(t={}){const{themeId:e,defaultTheme:r=at,rootShouldForwardProp:n=L,slotShouldForwardProp:o=L}=t;function s(a){ut(a,e,r)}return(a,y={})=>{Q(a,u=>u.filter(c=>c!==W));const{name:l,slot:h,skipVariantsResolver:b,skipSx:C,overridesResolver:v=lt(dt(h)),...T}=y,w=l&&l.startsWith("Mui")||h?"components":"custom",P=b!==void 0?b:h&&h!=="Root"&&h!=="root"||!1,k=C||!1;let x=L;h==="Root"||h==="root"?x=n:h?x=o:pt(a)&&(x=void 0);const F=X(a,{shouldForwardProp:x,label:ft(),...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=I(u);return function(d){return c.variants?M(d,c,d.theme.modularCssLayers?w:void 0):d.theme.modularCssLayers?g(c.style,w):c.style}}return u},_=(...u)=>{const c=[],m=u.map(q),d=[];if(c.push(s),l&&v&&d.push(function(f){const p=f.theme.components?.[l]?.styleOverrides;if(!p)return null;const j={};for(const B in p)j[B]=M(f,p[B],f.theme.modularCssLayers?"theme":void 0);return v(f,j)}),l&&!P&&d.push(function(f){const p=f.theme?.components?.[l]?.variants;return p?U(f,p,[],f.theme.modularCssLayers?"theme":void 0):null}),k||d.push(W),Array.isArray(m[0])){const O=m.shift(),f=new Array(c.length).fill(""),R=new Array(d.length).fill("");let p;p=[...f,...O,...R],p.raw=[...f,...O.raw,...R],c.unshift(p)}const J=[...c,...m,...d],E=F(...J);return a.muiName&&(E.muiName=a.muiName),E};return F.withConfig&&(_.withConfig=F.withConfig),_}}function ft(t,e){return void 0}function ht(t){for(const e in t)return!1;return!0}function pt(t){return typeof t=="string"&&t.charCodeAt(0)>96}function dt(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const H={theme:void 0};function yt(t){let e,r;return function(o){let s=e;return(s===void 0||o.theme!==r)&&(H.theme=o.theme,s=I(t(H)),e=s,r=o.theme),s}}function mt(t,e,r=void 0){const n={};for(const o in t){const s=t[o];let i="",a=!0;for(let y=0;y<s.length;y+=1){const l=s[y];l&&(i+=(a===!0?"":" ")+e(l),a=!1,r&&r[l]&&(i+=" "+r[l]))}n[o]=i}return n}function gt(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const St=t=>gt(t)&&t!=="classes",vt=ct({themeId:Z,defaultTheme:z,rootShouldForwardProp:St}),wt=yt;function Ft(...t){const e=A.useRef(void 0),r=A.useCallback(n=>{const o=t.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?.())}},t);return A.useMemo(()=>t.every(n=>n==null)?null:n=>{e.current&&(e.current(),e.current=void 0),n!=null&&(e.current=r(n))},t)}function xt(t){return typeof t.main=="string"}function bt(t,e=[]){if(!xt(t))return!1;for(const r of e)if(!t.hasOwnProperty(r)||typeof t[r]!="string")return!1;return!0}function Ct(t=[]){return([,e])=>e&&bt(e,t)}function Tt(t){return G("MuiTypography",t)}it("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Pt={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Ot=tt(),Rt=t=>{const{align:e,gutterBottom:r,noWrap:n,paragraph:o,variant:s,classes:i}=t,a={root:["root",s,t.align!=="inherit"&&`align${V(e)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return mt(a,Tt,i)},At=vt("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.variant&&e[r.variant],r.align!=="inherit"&&e[`align${V(r.align)}`],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})(wt(({theme:t})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([e,r])=>e!=="inherit"&&r&&typeof r=="object").map(([e,r])=>({props:{variant:e},style:r})),...Object.entries(t.palette).filter(Ct()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette?.text||{}).filter(([,e])=>typeof e=="string").map(([e])=>({props:{color:`text${V(e)}`},style:{color:(t.vars||t).palette.text[e]}})),{props:({ownerState:e})=>e.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),D={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Lt=A.forwardRef(function(e,r){const{color:n,...o}=N({props:e,name:"MuiTypography"}),s=!Pt[n],i=Ot({...o,...s&&{color:n}}),{align:a="inherit",className:y,component:l,gutterBottom:h=!1,noWrap:b=!1,paragraph:C=!1,variant:v="body1",variantMapping:T=D,...w}=i,P={...i,align:a,color:n,className:y,component:l,gutterBottom:h,noWrap:b,paragraph:C,variant:v,variantMapping:T},k=l||(C?"p":T[v]||D[v])||"span",x=Rt(P);return et.jsx(At,{as:k,ref:r,className:rt(x.root,y),...w,ownerState:P,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...w.style}})});export{Lt as T,kt as _,it as a,L as b,mt as c,Ct as d,G as g,wt as m,vt as s,Ft as u};
@@ -0,0 +1 @@
1
+ import{r as E,bx as j,gd as q,a9 as C,ge as G,gf as J,gg as K,gh as Q,gi as h}from"./index-wyU9I4Kz.js";var U=Object.defineProperty,v=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,S=(e,a,r)=>a in e?U(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,Y=(e,a)=>{for(var r in a||(a={}))R.call(a,r)&&S(e,r,a[r]);if(v)for(var r of v(a))V.call(a,r)&&S(e,r,a[r]);return e},W=(e,a)=>{var r={};for(var t in e)R.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&v)for(var t of v(e))a.indexOf(t)<0&&V.call(e,t)&&(r[t]=e[t]);return r};const X={type:"default"},$=E.forwardRef((e,a)=>{const r=j("YearPicker",X,e),{type:t,defaultValue:g,value:m,onChange:y,__staticSelector:O,getYearControlProps:p,allowSingleDateInRange:i,allowDeselect:c,onMouseLeave:f,onYearSelect:n}=r,w=W(r,["type","defaultValue","value","onChange","__staticSelector","getYearControlProps","allowSingleDateInRange","allowDeselect","onMouseLeave","onYearSelect"]),{onDateChange:u,onRootMouseLeave:d,onHoveredDateChange:_,getControlProps:D}=q({type:t,level:"year",allowDeselect:c,allowSingleDateInRange:i,value:m,defaultValue:g,onChange:y,onMouseLeave:f});return C.createElement(G,Y({ref:a,minLevel:"decade",__updateDateOnYearSelect:!1,__staticSelector:O||"YearPicker",onMouseLeave:d,onYearMouseEnter:(o,l)=>_(l),onYearSelect:o=>{u(o),n?.(o)},getYearControlProps:o=>Y(Y({},D(o)),p?.(o))},w))});$.displayName="@mantine/dates/YearPicker";var Z=Object.defineProperty,ee=Object.defineProperties,ae=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,I=(e,a,r)=>a in e?Z(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,b=(e,a)=>{for(var r in a||(a={}))k.call(a,r)&&I(e,r,a[r]);if(P)for(var r of P(a))x.call(a,r)&&I(e,r,a[r]);return e},re=(e,a)=>ee(e,ae(a)),te=(e,a)=>{var r={};for(var t in e)k.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&P)for(var t of P(e))a.indexOf(t)<0&&x.call(e,t)&&(r[t]=e[t]);return r};const oe={type:"default",valueFormat:"YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},ne=E.forwardRef((e,a)=>{const r=j("YearPickerInput",oe,e),{type:t,value:g,defaultValue:m,onChange:y,valueFormat:O,labelSeparator:p,locale:i,classNames:c,styles:f,unstyled:n,closeOnChange:w,size:u,variant:d,dropdownType:_,sortDates:D,minDate:o,maxDate:l}=r,N=te(r,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","size","variant","dropdownType","sortDates","minDate","maxDate"]),{calendarProps:L,others:M}=J(N),{_value:s,setValue:F,formattedValue:T,dropdownHandlers:z,dropdownOpened:A,onClear:H,shouldClear:B}=K({type:t,value:g,defaultValue:m,onChange:y,locale:i,format:O,labelSeparator:p,closeOnChange:w,sortDates:D});return C.createElement(Q,b({formattedValue:T,dropdownOpened:A,dropdownHandlers:z,classNames:c,styles:f,unstyled:n,__staticSelector:"YearPickerInput",ref:a,onClear:H,shouldClear:B,value:s,type:t,size:u,variant:d,dropdownType:_},M),C.createElement($,re(b({},L),{size:u,variant:d,type:t,value:s,defaultDate:Array.isArray(s)?s[0]||h({maxDate:l,minDate:o}):s||h({maxDate:l,minDate:o}),onChange:F,locale:i,classNames:c,styles:f,unstyled:n,__staticSelector:"YearPickerInput",__stopPropagation:_==="popover",minDate:o,maxDate:l})))});ne.displayName="@mantine/dates/YearPickerInput";export{ne as Y};
@@ -1 +1 @@
1
- import{ah as l,j as t,fe as Q,ff as W,fg as O,fh as X,fi as Z,fj as T,fk as ee,fl as oe,fm as M,fn as re,fo as te,fp as ne,p as P,dU as ae}from"./index-CnKUadG6.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(fe,{...r,ref:n}):t.jsx(pe,{...c,ref:n})})});V.displayName=d;var[H,le]=b(d),[K,de]=b(d,{collapsible:!1}),pe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},collapsible:r=!1,...s}=e,[i,p]=M({prop:o,defaultProp:a??"",onChange:c,caller:d});return t.jsx(H,{scope:e.__scopeAccordion,value:l.useMemo(()=>i?[i]:[],[i]),onItemOpen:p,onItemClose:l.useCallback(()=>r&&p(""),[r,p]),children:t.jsx(K,{scope:e.__scopeAccordion,collapsible:r,children:t.jsx($,{...s,ref:n})})})}),fe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},...r}=e,[s,i]=M({prop:o,defaultProp:a??[],onChange:c,caller:d}),p=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:p,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),p=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 f=g;const j=0,w=D-1,_=()=>{f=g+1,f>w&&(f=j)},y=()=>{f=g-1,f<j&&(f=w)};switch(m.key){case"Home":f=j;break;case"End":f=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=f%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:p,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),p=X(),v=a&&s.value.includes(a)||!1,x=r.disabled||e.disabled;return t.jsx(ve,{scope:o,open:v,disabled:x,triggerId:p,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",U=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})});U.displayName=L;var N="AccordionTrigger",G=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})})});G.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=U,Ae=G,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{a9 as l,j as t,gQ as q,gR as B,gS as T,gT as F,gU as J,gV as O,gW as ee,gX as oe,gY as M,gZ as re,g_ as te,g$ as ne,m as P,dk as ae}from"./index-wyU9I4Kz.js";var d="Accordion",ce=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[k,ie,se]=q(d),[b]=B(d,[se,T]),E=T(),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(ue,{...r,ref:n}):t.jsx(pe,{...c,ref:n})})});V.displayName=d;var[H,le]=b(d),[$,de]=b(d,{collapsible:!1}),pe=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},collapsible:r=!1,...s}=e,[i,p]=M({prop:o,defaultProp:a??"",onChange:c,caller:d});return t.jsx(H,{scope:e.__scopeAccordion,value:l.useMemo(()=>i?[i]:[],[i]),onItemOpen:p,onItemClose:l.useCallback(()=>r&&p(""),[r,p]),children:t.jsx($,{scope:e.__scopeAccordion,collapsible:r,children:t.jsx(K,{...s,ref:n})})})}),ue=l.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:c=()=>{},...r}=e,[s,i]=M({prop:o,defaultProp:a??[],onChange:c,caller:d}),p=l.useCallback(v=>i((f=[])=>[...f,v]),[i]),g=l.useCallback(v=>i((f=[])=>f.filter(h=>h!==v)),[i]);return t.jsx(H,{scope:e.__scopeAccordion,value:s,onItemOpen:p,onItemClose:g,children:t.jsx($,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(K,{...r,ref:n})})})}),[fe,C]=b(d),K=l.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:c,orientation:r="vertical",...s}=e,i=l.useRef(null),p=re(i,n),g=ie(o),f=te(c)==="ltr",h=ne(e.onKeyDown,x=>{if(!ce.includes(x.key))return;const X=x.target,I=g().filter(R=>!R.ref.current?.disabled),m=I.findIndex(R=>R.ref.current===X),D=I.length;if(m===-1)return;x.preventDefault();let u=m;const j=0,w=D-1,_=()=>{u=m+1,u>w&&(u=j)},y=()=>{u=m-1,u<j&&(u=w)};switch(x.key){case"Home":u=j;break;case"End":u=w;break;case"ArrowRight":r==="horizontal"&&(f?_():y());break;case"ArrowDown":r==="vertical"&&_();break;case"ArrowLeft":r==="horizontal"&&(f?y():_());break;case"ArrowUp":r==="vertical"&&y();break}const Z=u%D;I[Z].ref.current?.focus()});return t.jsx(fe,{scope:o,disabled:a,direction:c,orientation:r,children:t.jsx(k.Slot,{scope:o,children:t.jsx(O.div,{...s,"data-orientation":r,ref:p,onKeyDown:a?void 0:h})})})}),A="AccordionItem",[ge,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),p=F(),g=a&&s.value.includes(a)||!1,v=r.disabled||e.disabled;return t.jsx(ge,{scope:o,open:g,disabled:v,triggerId:p,children:t.jsx(J,{"data-orientation":r.orientation,"data-state":W(g),...i,...c,ref:n,disabled:v,open:g,onOpenChange:f=>{f?s.onItemOpen(a):s.onItemClose(a)}})})});z.displayName=A;var L="AccordionHeader",U=l.forwardRef((e,n)=>{const{__scopeAccordion:o,...a}=e,c=C(d,o),r=S(L,o);return t.jsx(O.h3,{"data-orientation":c.orientation,"data-state":W(r.open),"data-disabled":r.disabled?"":void 0,...a,ref:n})});U.displayName=L;var N="AccordionTrigger",G=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})})});G.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 W(e){return e?"open":"closed"}var ve=V,xe=z,me=U,Ae=G,be=Q;function he({...e}){return t.jsx(ve,{"data-slot":"accordion",...e})}function Ie({className:e,...n}){return t.jsx(xe,{"data-slot":"accordion-item",className:P("border-b last:border-b-0",e),...n})}function je({className:e,children:n,...o}){return t.jsx(me,{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,a6 as v,a8 as C,u as P,j as e,L as A,h0 as F}from"./index-wyU9I4Kz.js";import{u as b}from"./use-url-query-CUVSXgm0.js";import{C as y}from"./charges-filters-Dq-8QHH-.js";import{P as j}from"./page-layout-BG0XvWfD.js";import{P as D}from"./Progress-7xtiFwK3.js";import"./switch-GSloW_Ey.js";import"./modal-D47umnak.js";import"./Pagination-6Sv5LXxl.js";import"./create-event-handler-BiA-1lGu.js";import"./funnel-BJ71hzoq.js";import"./sub-B4_VmmF9.js";import"./addDays-DvwuJbUs.js";import"./subMonths-DG7w6bCY.js";import"./MultiSelect-BqcJrWnD.js";const V=()=>{const{setFiltersContext:i}=s.useContext(h),{get:c}=b(),{userContext:p}=s.useContext(v),[a,m]=s.useState(c("chargesFilters")?JSON.parse(decodeURIComponent(c("chargesFilters"))):{byOwners:p?.context.adminBusinessId?[p?.context.adminBusinessId]:[],sortBy:{field:C.Date,asc:!1},toAnyDate:null,fromAnyDate:null}),[{data:r,fetching:u}]=P({query:F,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 x=100*o/t,d=100*l/t,g=100*n/t;return s.useEffect(()=>{i(e.jsx("div",{className:"flex flex-row gap-x-5",children:e.jsx(y,{filter:a,setFilter:m,activePage:1,setPage:()=>{},totalPages:1})}))},[r,u,a,i,m]),e.jsx(j,{title:"Accountant Approvals Status",children:u?e.jsx(A,{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:x,color:"green",label:`${x.toFixed(1)}% (${o})`},{value:d,color:"orange",label:`${d.toFixed(1)}% (${l})`},{value:g,color:"red",label:`${g.toFixed(1)}% (${n})`}]})]})})};export{V as AccountantApprovals};
@@ -0,0 +1 @@
1
+ import{r as s,j as t,B as a,dR as d}from"./index-wyU9I4Kz.js";import{P as c}from"./Pagination-6Sv5LXxl.js";import{T as h}from"./Table-C5zxD95i.js";function m(e){const[i,o]=s.useState(!1),n=e.moreInfo?e.moreInfo(e.item):null;return t.jsxs(t.Fragment,{children:[t.jsxs("tr",{children:[e.columns.map((l,r)=>l.disabled?null:t.jsx("td",{style:l.style,children:l.value(e.item,e.rowContext?e.rowContext(e.item):void 0)},String(r))),e.moreInfo&&t.jsx("td",{children:n===null?t.jsx("p",{children:"No Data Related"}):t.jsx(a,{onClick:()=>o(!i),className:"ml-auto",children:"More Info"})})]}),(e.isShowAll||i)&&n!==null&&t.jsx("tr",{children:t.jsx("td",{colSpan:12,children:t.jsx(d,{style:{width:"100%"},withBorder:!0,shadow:"lg",children:n})})})]})}function j(e){const[i,o]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-row justify-end w-full",children:[e.pagination&&t.jsx(c,{className:"flex-auto",...e.pagination}),e.showButton===!0?t.jsx(a,{type:"button",onClick:()=>{o(n=>!n)},children:i?"Hide All":"Show All"}):null]}),t.jsxs(h,{striped:e.striped,highlightOnHover:e.highlightOnHover,children:[t.jsx("thead",{style:e.stickyHeader?{position:"sticky",top:0,zIndex:20}:{},children:t.jsxs("tr",{className:"px-10 py-10 title-font tracking-wider font-medium text-gray-900 text-sm bg-gray-100 rounded-tl rounded-bl",children:[e.columns.map((n,l)=>n.disabled?null:t.jsx("th",{children:n.title},String(l))),e.moreInfo&&t.jsx("th",{children:"More Info"})]})}),t.jsx("tbody",{children:e.items.map((n,l)=>t.jsx(m,{columns:e.columns,item:n,moreInfo:e.moreInfo,isShowAll:i,rowContext:e.rowContext},l))})]})]})}export{m as A,j as a};
@@ -0,0 +1 @@
1
+ import{fD as s,gm as i}from"./index-wyU9I4Kz.js";function o(a,r,e){const t=s(a,e?.in);return isNaN(r)?i(a,NaN):(r&&t.setDate(t.getDate()+r),t)}export{o as a};
@@ -0,0 +1 @@
1
+ import{r as t,F as y,u as A,j as e,T as N,B as b,L as w,A as O}from"./index-wyU9I4Kz.js";import{u as T}from"./use-url-query-CUVSXgm0.js";import{C as z}from"./charges-filters-Dq-8QHH-.js";import{C as B}from"./charges-table-Cncs1HLi.js";import{M as L}from"./index-UMFH47hN.js";import{E as R,I as k,M as Q}from"./match-document-modal-BPG_hljb.js";import{P as U}from"./page-layout-BG0XvWfD.js";import{P as q,a as J}from"./panel-top-open-B1rhJYjQ.js";import"./switch-GSloW_Ey.js";import"./modal-D47umnak.js";import"./Pagination-6Sv5LXxl.js";import"./create-event-handler-BiA-1lGu.js";import"./funnel-BJ71hzoq.js";import"./sub-B4_VmmF9.js";import"./addDays-DvwuJbUs.js";import"./subMonths-DG7w6bCY.js";import"./MultiSelect-BqcJrWnD.js";import"./toggle-expansion-button-lwJYTklN.js";import"./index-DR_5jpS4.js";import"./similar-transactions-modal-MQeC2gtu.js";import"./list-plus-Dy3vzJVy.js";import"./tooltip-BbKSwLCX.js";import"./Table-C5zxD95i.js";import"./summary-DvHtnArZ.js";import"./Checkbox-BR6kGuhg.js";import"./YearPickerInput-CllwSjcn.js";import"./insert-business-trip-modal-vS1QrUJz.js";import"./accounter-table-CpeQD4PG.js";const xe=()=>{const{setFiltersContext:h}=t.useContext(y),[i,C]=t.useState(void 0),[n,f]=t.useState(void 0),[l,x]=t.useState(void 0),[c,j]=t.useState(!1),[a,m]=t.useState([]),{get:p}=T(),[d,M]=t.useState(p("page")?Number(p("page")):1),g=p("chargesFilters"),v=t.useMemo(()=>{if(g)try{return JSON.parse(decodeURIComponent(g))}catch{return}},[g]),[r,S]=t.useState(v),D=t.useCallback((s,F)=>{a.map(u=>u.id).includes(s)?m(a.filter(u=>u.id!==s)):m([...a,{id:s,onChange:F}])},[a]),[{data:o,fetching:I},P]=A({query:O,variables:{filters:r,page:d,limit:100},pause:!0});t.useEffect(()=>{r&&P()},[r,P]);function E(){m([])}return t.useEffect(()=>{h(e.jsxs("div",{className:"flex flex-row gap-x-5",children:[e.jsx(z,{filter:r,setFilter:S,activePage:d,setPage:M,totalPages:o?.allCharges?.pageInfo.totalPages,initiallyOpened:!r}),e.jsx(N,{label:"Expand all accounts",children:e.jsx(b,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>j(s=>!s),children:c?e.jsx(q,{className:"size-5"}):e.jsx(J,{className:"size-5"})})}),e.jsx(L,{selected:a,resetMerge:E})]}))},[o,I,r,d,c,h,M,S,j,a,v]),e.jsxs(U,{title:"All Charges",description:"Manage charges",children:[I?e.jsx(w,{className:"h-10 w-10 animate-spin mr-2 self-center"}):o?.allCharges.nodes?e.jsx(B,{setEditChargeId:C,setInsertDocument:f,setMatchDocuments:x,toggleMergeCharge:D,mergeSelectedCharges:new Set(a.map(s=>s.id)),data:o?.allCharges?.nodes,isAllOpened:c}):e.jsx("span",{children:"Please apply filters"}),i&&e.jsx(R,{chargeId:i?.id,close:()=>C(void 0),onChange:i.onChange}),n&&e.jsx(k,{chargeId:n.id,onChange:n.onChange,close:()=>f(void 0)}),l&&e.jsx(Q,{chargeId:l.id,ownerId:l.ownerId,setMatchDocuments:()=>x(void 0)})]})};export{xe as AllCharges};
@@ -1,4 +1,4 @@
1
- import{D as o}from"./index-CnKUadG6.js";/**
1
+ import{v as o}from"./index-wyU9I4Kz.js";/**
2
2
  * @license lucide-react v0.546.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{D as a}from"./index-CnKUadG6.js";/**
1
+ import{v as a}from"./index-wyU9I4Kz.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,32 @@
1
+ import{v as xe,w as be,S as Ee,x as Ne,u as we,y as Ms,r as y,j as e,D as Pe,z as Be,E as Us,c as Cs,g as pe,t as O,i as je,U as zs,G as Ie,H as Oe,J as De,K as q,N as W,O as K,P as H,Q as Ae,V as X,W as j,X as g,Y as f,Z as N,I as E,_ as I,$ as C,a0 as Ye,B as T,a1 as Gs,a2 as Le,a3 as Ze,a4 as V,a5 as bs,a6 as es,a7 as qs,a8 as Ws,a9 as L,aa as ds,ab as Ks,ac as Hs,ad as Xs,ae as de,af as ss,ag as G,ah as ns,ai as ts,aj as as,ak as Z,al as me,am as re,an as ie,ao as le,ap as ce,aq as oe,ar as rs,as as is,at as Ue,au as ae,av as ze,aw as Ge,ax as Fe,ay as Js,az as ee,aA as Qs,aB as Ys,aC as Zs,aD as qe,aE as en,aF as sn,aG as nn,aH as tn,aI as an,aJ as We,aK as Ke,aL as ws,aM as rn,aN as He,aO as ln,aP as Is,aQ as Ds,aR as cn,aS as on,aT as As,aU as ls,aV as dn,aW as ms,aX as mn,aY as un,aZ as hn,a_ as xn,a$ as pn,b0 as jn,b1 as D,b2 as gn,b3 as cs,b4 as fn,b5 as vn,b6 as yn,b7 as Nn,b8 as Cn,b9 as Q,ba as bn,bb as wn,bc as z,bd as In,a as Dn,b as An,be as Sn}from"./index-wyU9I4Kz.js";import{S as os}from"./save-Czmh3tvC.js";import{B as kn}from"./business-header-u2sfE_d8.js";import{S as En,C as Tn}from"./charges-table-Cncs1HLi.js";import{P as Pn}from"./Pagination-6Sv5LXxl.js";import{i as Bn,D as On,f as Ln,E as Vn,L as _e,a as Se,C as Fn,A as _n,b as ve,c as $n,d as Xe,h as Rn,e as Mn,g as Ss,u as Un,G as zn,j as us,k as Gn,X as ks,Y as Es,l as qn,m as Wn,R as Kn,n as Hn,o as Xn,p as Jn}from"./chart-ByngRufj.js";import{S as Y}from"./switch-GSloW_Ey.js";import{P as Qn}from"./pencil-tV0FsM6V.js";import{E as Yn}from"./index-DR_5jpS4.js";import{A as Zn,a as $e,b as Re,c as hs}from"./accordion-CMR2fANH.js";import{B as et}from"./business-extended-info-7CM8px2e.js";import{B as st}from"./building-2-BgvPBt2Z.js";import"./toggle-expansion-button-lwJYTklN.js";import"./panel-top-open-B1rhJYjQ.js";import"./Table-C5zxD95i.js";import"./summary-DvHtnArZ.js";import"./create-event-handler-BiA-1lGu.js";import"./list-plus-Dy3vzJVy.js";import"./sequential-CAnleQny.js";import"./similar-transactions-modal-MQeC2gtu.js";import"./addDays-DvwuJbUs.js";import"./tooltip-BbKSwLCX.js";import"./download-csv-button-Df5rDeDc.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 nt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xs=xe("circle-check",nt);/**
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 tt=[["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=xe("dollar-sign",tt);/**
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 at=[["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"}]],rt=xe("file-check",at);/**
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 it=[["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"}]],lt=xe("plug",it);/**
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 ct=[["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"}]],Ts=xe("shield",ct);/**
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 ot=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Me=xe("trending-up",ot);function Ps(s){switch(s){case be.Annual:return"Annual";case be.Monthly:return"Monthly";default:throw new Error(`Unsupported Billing Cycle: ${s}`)}}function Bs(s){switch(s){case Ee.Enterprise:return"Enterprise";case Ee.Pro:return"Pro";default:throw new Error(`Unsupported Subscription plan: ${s}`)}}function dt(s){return Ne(s,"yyyy-MM-dd")}function mt({businessId:s,tagIds:n,description:t,open:a,onOpenChange:l,onClose:i}){const[{data:c,fetching:r},o]=we({pause:!0,query:Ms,variables:{businessId:s,tagsDifferentThan:n?n.map(u=>u.id):void 0,descriptionDifferentThan:t}});y.useEffect(()=>{a&&(n||t)&&!c&&o()},[a,n,t,o,c]);const d=y.useCallback(u=>{l(u),a&&!u&&i?.()},[l,i,a]),h=y.useMemo(()=>a&&(!!n||!!t)&&c&&c?.similarChargesByBusiness.length>0,[a,n,t,c]);return e.jsx(Pe,{open:h,onOpenChange:d,children:e.jsx(Be,{className:"overflow-scroll max-h-screen w-full sm:max-w-[640px] md:max-w-[768px] lg:max-w-[900px]",onClick:u=>u.stopPropagation(),children:e.jsx(Us,{fallback:e.jsx("div",{children:"Error fetching similar charges"}),children:r?e.jsx(Cs,{}):n||t?e.jsx(En,{data:c?.similarChargesByBusiness??[],tagIds:n,description:t,onOpenChange:d,title:"Similar Charges by Business"}):null})})})}const ut="updateAdminBusiness",ht=()=>{const[{fetching:s},n]=pe(zs),t=y.useCallback(async a=>{const l=`Error updating admin business ID [${a.adminBusinessId}]`,i=`${ut}-${a.adminBusinessId}`;O.loading("Updating admin business",{id:i});try{const c=await n(a),r=je(c,l,i,"updateAdminBusiness");if(r)return O.success("Success",{id:i,description:"Admin Business Updated"}),r.updateAdminBusiness}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateAdminBusiness:t}},xt=Le({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:bs().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 pt(s){return{employerWithholdingTaxAccountNumber:s.employerWithholdingTaxAccountNumber,taxPrepaymentId:s.taxPrepaymentId,nationalInsuranceEmployerId:s.nationalInsuranceEmployerId,advanceTaxRate:s.advanceTaxRate,registrationDate:s.registrationDate?dt(new Date(s.registrationDate)):void 0}}function jt({data:s,refetchBusiness:n}){const t=De(Gs,s),[a,l]=y.useState(ps(t)),{updateAdminBusiness:i,fetching:c}=ht(),r=Ie({resolver:Oe(xt),defaultValues:a}),o=async d=>{if(!t)return;const h=Ze(d,r.formState.dirtyFields);if(!h)return;const u=pt(h);await i({adminBusinessId:t.id,fields:u}),n?.()};return y.useEffect(()=>{if(t){const d=ps(t);l(d),r.reset(d)}},[t,r]),e.jsxs(q,{children:[e.jsxs(W,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ts,{className:"h-5 w-5 text-primary"}),e.jsx(K,{children:"Admin Business Configuration"})]}),e.jsx(H,{children:"Tax and registration information for the business operating this application"})]}),e.jsx(Ae,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(o),className:"space-y-6",children:[e.jsx(X,{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:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Employer Withholding Tax Account Number"}),e.jsx(N,{children:e.jsx(E,{placeholder:"Enter account number",...d,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"taxPrepaymentId",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tax Prepayment ID"}),e.jsx(N,{children:e.jsx(E,{placeholder:"Enter prepayment ID",...d,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"nationalInsuranceEmployerId",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"National Insurance Employer ID"}),e.jsx(N,{children:e.jsx(E,{placeholder:"Enter employer ID",...d,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"advanceTaxRate",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Advance Tax Rate (%)"}),e.jsx(N,{children:e.jsx(E,{type:"number",step:"0.01",min:"0",max:"100",placeholder:"Enter tax rate",...d,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"registrationDate",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Registration Date"}),e.jsx(N,{children:e.jsx(E,{type:"date",...d,className:I(h)})}),e.jsx(C,{})]})})]})}),e.jsx(Ye,{className:"flex justify-end border-t mt-4 pt-6",children:e.jsxs(T,{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 gt({businessId:s}){const{userContext:n}=y.useContext(es),[t,a]=y.useState(1),[{data:l,fetching:i}]=we({query:qs,variables:{filters:{byOwners:n?.context.adminBusinessId?[n.context.adminBusinessId]:void 0,sortBy:{field:Ws.Date,asc:!1},byBusinesses:[s]},page:t,limit:100}}),c=l?.allCharges?.pageInfo.totalPages??1,r=l?.allCharges?.nodes??[];return i?e.jsx("div",{children:"Loading charges..."}):e.jsxs(q,{children:[e.jsxs(W,{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(K,{children:"Charges"}),e.jsx(H,{children:"Recurring and one-time charges for this business"})]})}),c>1&&e.jsx(Pn,{className:"flex-fit",value:t,onChange:a,total:c})]}),e.jsx(X,{children:e.jsx("div",{className:"rounded-md border",children:e.jsx(Tn,{data:r,isAllOpened:!1})})})]})}var ft=["type","layout","connectNulls","ref"],vt=["key"];function ue(s){"@babel/helpers - typeof";return ue=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},ue(s)}function js(s,n){if(s==null)return{};var t=yt(s,n),a,l;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);for(l=0;l<i.length;l++)a=i[l],!(n.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(s,a)&&(t[a]=s[a])}return t}function yt(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 Ce(){return Ce=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},Ce.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(l){return Object.getOwnPropertyDescriptor(s,l).enumerable})),t.push.apply(t,a)}return t}function _(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 te(s){return wt(s)||bt(s)||Ct(s)||Nt()}function Nt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ct(s,n){if(s){if(typeof s=="string")return Je(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 Je(s,n)}}function bt(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function wt(s){if(Array.isArray(s))return Je(s)}function Je(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 It(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,Ls(a.key),a)}}function Dt(s,n,t){return n&&fs(s.prototype,n),t&&fs(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function At(s,n,t){return n=Te(n),St(s,Os()?Reflect.construct(n,t||[],Te(s).constructor):n.apply(s,t))}function St(s,n){if(n&&(ue(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 Os(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Os=function(){return!!s})()}function Te(s){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Te(s)}function Et(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&&Qe(s,n)}function Qe(s,n){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,l){return a.__proto__=l,a},Qe(s,n)}function M(s,n,t){return n=Ls(n),n in s?Object.defineProperty(s,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[n]=t,s}function Ls(s){var n=Tt(s,"string");return ue(n)=="symbol"?n:n+""}function Tt(s,n){if(ue(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var a=t.call(s,n);if(ue(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}var he=(function(s){function n(){var t;It(this,n);for(var a=arguments.length,l=new Array(a),i=0;i<a;i++)l[i]=arguments[i];return t=At(this,n,[].concat(l)),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,k){return b+k});if(!d)return t.generateSimpleStrokeDasharray(r,c);for(var h=Math.floor(c/d),u=c%d,x=r-c,A=[],m=0,p=0;m<o.length;p+=o[m],++m)if(p+o[m]>u){A=[].concat(te(o.slice(0,m)),[u-p]);break}var S=A.length%2===0?[0,x]:[x];return[].concat(te(n.repeat(o,h)),te(A),S).map(function(b){return"".concat(b,"px")}).join(", ")}),M(t,"id",Un("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 Et(n,s),Dt(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,l){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,c=i.points,r=i.xAxis,o=i.yAxis,d=i.layout,h=i.children,u=Ln(h,Vn);if(!u)return null;var x=function(p,S){return{x:p.x,y:p.y,value:p.value,errorVal:Ss(p.payload,S)}},A={clipPath:a?"url(#clipPath-".concat(l,")"):null};return L.createElement(_e,A,u.map(function(m){return L.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:c,xAxis:r,yAxis:o,layout:d,dataPointFormatter:x})}))}},{key:"renderDots",value:function(a,l,i){var c=this.props.isAnimationActive;if(c&&!this.state.isAnimationFinished)return null;var r=this.props,o=r.dot,d=r.points,h=r.dataKey,u=Se(this.props,!1),x=Se(o,!0),A=d.map(function(p,S){var b=_(_(_({key:"dot-".concat(S),r:3},u),x),{},{index:S,cx:p.x,cy:p.y,value:p.value,dataKey:h,payload:p.payload,points:d});return n.renderDotItem(o,b)}),m={clipPath:a?"url(#clipPath-".concat(l?"":"dots-").concat(i,")"):null};return L.createElement(_e,Ce({className:"recharts-line-dots",key:"dots"},m),A)}},{key:"renderCurveStatically",value:function(a,l,i,c){var r=this.props,o=r.type,d=r.layout,h=r.connectNulls;r.ref;var u=js(r,ft),x=_(_(_({},Se(u,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:l?"url(#clipPath-".concat(i,")"):null,points:a},c),{},{type:o,layout:d,connectNulls:h});return L.createElement(Fn,Ce({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(a,l){var i=this,c=this.props,r=c.points,o=c.strokeDasharray,d=c.isAnimationActive,h=c.animationBegin,u=c.animationDuration,x=c.animationEasing,A=c.animationId,m=c.animateNewValues,p=c.width,S=c.height,b=this.state,k=b.prevPoints,F=b.totalLength;return L.createElement(_n,{begin:h,duration:u,isActive:d,easing:x,from:{t:0},to:{t:1},key:"line-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(R){var $=R.t;if(k){var J=k.length/r.length,U=r.map(function(B,Ve){var ge=Math.floor(Ve*J);if(k[ge]){var fe=k[ge],ne=ve(fe.x,B.x),_s=ve(fe.y,B.y);return _(_({},B),{},{x:ne($),y:_s($)})}if(m){var $s=ve(p*2,B.x),Rs=ve(S/2,B.y);return _(_({},B),{},{x:$s($),y:Rs($)})}return _(_({},B),{},{x:B.x,y:B.y})});return i.renderCurveStatically(U,a,l)}var se=ve(0,F),v=se($),w;if(o){var P="".concat(o).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});w=i.getStrokeDasharray(v,F,P)}else w=i.generateSimpleStrokeDasharray(F,v);return i.renderCurveStatically(r,a,l,{strokeDasharray:w})})}},{key:"renderCurve",value:function(a,l){var i=this.props,c=i.points,r=i.isAnimationActive,o=this.state,d=o.prevPoints,h=o.totalLength;return r&&c&&c.length&&(!d&&h>0||!$n(d,c))?this.renderCurveWithAnimation(a,l):this.renderCurveStatically(c,a,l)}},{key:"render",value:function(){var a,l=this.props,i=l.hide,c=l.dot,r=l.points,o=l.className,d=l.xAxis,h=l.yAxis,u=l.top,x=l.left,A=l.width,m=l.height,p=l.isAnimationActive,S=l.id;if(i||!r||!r.length)return null;var b=this.state.isAnimationFinished,k=r.length===1,F=ds("recharts-line",o),R=d&&d.allowDataOverflow,$=h&&h.allowDataOverflow,J=R||$,U=Xe(S)?this.id:S,se=(a=Se(c,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},v=se.r,w=v===void 0?3:v,P=se.strokeWidth,B=P===void 0?2:P,Ve=Rn(c)?c:{},ge=Ve.clipDot,fe=ge===void 0?!0:ge,ne=w*2+B;return L.createElement(_e,{className:F},R||$?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(U)},L.createElement("rect",{x:R?x:x-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:x-ne/2,y:u-ne/2,width:A+ne,height:m+ne}))):null,!k&&this.renderCurve(J,U),this.renderErrorBar(J,U),(k||c)&&this.renderDots(J,fe,U),(!p||b)&&Mn.renderCallByParent(this.props,r))}}],[{key:"getDerivedStateFromProps",value:function(a,l){return a.animationId!==l.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,prevPoints:l.curPoints}:a.points!==l.curPoints?{curPoints:a.points}:null}},{key:"repeat",value:function(a,l){for(var i=a.length%2!==0?[].concat(te(a),[0]):a,c=[],r=0;r<l;++r)c=[].concat(te(c),te(i));return c}},{key:"renderDotItem",value:function(a,l){var i;if(L.isValidElement(a))i=L.cloneElement(a,l);else if(Bn(a))i=a(l);else{var c=l.key,r=js(l,vt),o=ds("recharts-line-dot",typeof a!="boolean"?a.className:"");i=L.createElement(On,Ce({key:c},r,{className:o}))}return i}}])})(y.PureComponent);M(he,"displayName","Line");M(he,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!zn.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});M(he,"getComposedData",function(s){var n=s.props,t=s.xAxis,a=s.yAxis,l=s.xAxisTicks,i=s.yAxisTicks,c=s.dataKey,r=s.bandSize,o=s.displayedData,d=s.offset,h=n.layout,u=o.map(function(x,A){var m=Ss(x,c);return h==="horizontal"?{x:us({axis:t,ticks:l,bandSize:r,entry:x,index:A}),y:Xe(m)?null:a.scale(m),value:m,payload:x}:{x:Xe(m)?null:t.scale(m),y:us({axis:a,ticks:i,bandSize:r,entry:x,index:A}),value:m,payload:x}});return _({points:u,layout:h},d)});var Pt=Gn({chartName:"LineChart",GraphicalChild:he,axisComponents:[{axisType:"xAxis",AxisComp:ks},{axisType:"yAxis",AxisComp:Es}],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 Bt(){const s=ye.reduce((t,a)=>t+a.revenue,0),n=s/ye.length;return e.jsxs(q,{children:[e.jsxs(W,{children:[e.jsx(K,{children:"Revenue Analytics"}),e.jsx(H,{children:"Revenue and expenses over time"})]}),e.jsxs(X,{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(Me,{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(Me,{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(Me,{className:"h-3 w-3"}),e.jsx("span",{children:"+8.0% from last month"})]})]})]}),e.jsx(Wn,{config:{revenue:{label:"Revenue",color:"hsl(var(--chart-1))"},expenses:{label:"Expenses",color:"hsl(var(--chart-2))"}},className:"h-[400px]",children:e.jsx(Kn,{width:"100%",height:"100%",children:e.jsxs(Pt,{data:ye,margin:{top:5,right:10,left:10,bottom:5},children:[e.jsx(Hn,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ks,{dataKey:"month",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Es,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Xn,{content:e.jsx(Jn,{})}),e.jsx(he,{type:"monotone",dataKey:"revenue",stroke:"var(--color-revenue)",strokeWidth:2,dot:{fill:"var(--color-revenue)",r:4}}),e.jsx(he,{type:"monotone",dataKey:"expenses",stroke:"var(--color-expenses)",strokeWidth:2,dot:{fill:"var(--color-expenses)",r:4}})]})})})]})]})}const Ot="updateBusiness",Vs=()=>{const[{fetching:s},n]=pe(Ks),t=y.useCallback(async a=>{const l=`Error updating business ID [${a.businessId}]`,i=`${Ot}-${a.businessId}`;O.loading("Updating business",{id:i});try{const c=await n(a),r=je(c,l,i,"updateBusiness");if(r)return O.success("Success",{id:i,description:"Business updated"}),r.updateBusiness}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateBusiness:t}},Lt="insertClient",Vt=()=>{const[{fetching:s},n]=pe(Hs),t=y.useCallback(async a=>{const l=`Error creating client [${a.fields.businessId}]`,i=`${Lt}-${a.fields.businessId}`;O.loading("Creating Client...",{id:i});try{const c=await n(a),r=je(c,l,i,"insertClient");if(r)return O.success("Success",{id:i,description:`Client [${a.fields.businessId}] was created`}),r.insertClient}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,insertClient:t}},Ft="updateClient",Fs=()=>{const[{fetching:s},n]=pe(Xs),t=y.useCallback(async a=>{const l=`Error updating client ID [${a.businessId}]`,i=`${Ft}-${a.businessId}`;O.loading("Updating client",{id:i});try{const c=await n(a),r=je(c,l,i,"updateClient");if(r)return O.success("Success",{id:i,description:"Client updated"}),r.updateClient}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateClient:t}},_t=Le({businessId:Ue().optional(),emails:ze(Ge()).optional(),generatedDocumentType:ae(Object.values(de)),greenInvoiceId:Ue().optional(),hiveId:V().optional()});function $t({client:s,businessId:n,onDone:t}){const[a,l]=y.useState(!1),[i,c]=y.useState(null),{updateClient:r}=Fs(),{insertClient:o}=Vt(),[d,h]=y.useState(""),u={businessId:n,generatedDocumentType:de.Proforma,emails:[]},x=Ie({resolver:Oe(_t),defaultValues:s||u});y.useEffect(()=>{s&&(c(s),x.reset({emails:s.emails,greenInvoiceId:s.greenInvoiceId,hiveId:s.hiveId,generatedDocumentType:s.generatedDocumentType,businessId:s.businessId}),l(!0))},[s,x]);const A=()=>{c(null),x.reset(u),l(!0)},m=()=>{if(d.trim()){const b=x.getValues("emails");x.setValue("emails",[...b??[],d.trim()],{shouldDirty:!0}),h("")}},p=b=>{const k=x.getValues("emails");x.setValue("emails",(k??[]).filter((F,R)=>R!==b),{shouldDirty:!0})},S=y.useCallback(async b=>{if(i)r({businessId:n,fields:b});else{if(!b.greenInvoiceId){x.setError("greenInvoiceId",{message:"Green Invoice ID is required"});return}o({fields:{...b,greenInvoiceId:b.greenInvoiceId,businessId:n}})}l(!1),c(null),t?.()},[i,t,r,n,o,x]);return e.jsxs(Pe,{open:a,onOpenChange:l,children:[e.jsx(ss,{asChild:!0,children:e.jsxs(T,{size:"sm",onClick:A,children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"New Client"]})}),e.jsxs(Be,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ns,{children:[e.jsx(ts,{children:i?"Edit Client":"Create New Client"}),e.jsx(as,{children:i?"Update client details":"Add a new client with all required details"})]}),e.jsx(Ae,{...x,children:e.jsxs("form",{onSubmit:x.handleSubmit(S),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:x.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(E,{placeholder:"Add email...",value:d,onChange:k=>h(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),m())}}),e.jsx(T,{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((k,F)=>e.jsxs(Z,{variant:"secondary",className:"gap-1",children:[k,e.jsx(T,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>p(F),children:e.jsx(me,{className:"size-3 cursor-pointer"})})]},F))}),e.jsx(C,{})]})}),e.jsx(j,{control:x.control,name:"generatedDocumentType",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Default Document Type"}),e.jsxs(re,{onValueChange:b.onChange,defaultValue:b.value,children:[e.jsx(N,{children:e.jsx(ie,{children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.values(de).map(k=>e.jsx(oe,{value:k,children:rs(k)},k))})]}),e.jsx(C,{})]})}),e.jsx(j,{control:x.control,name:"greenInvoiceId",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Green Invoice ID"}),e.jsx(N,{children:e.jsx(E,{type:"text",placeholder:"Enter Green Invoice ID",...b,required:!i})}),e.jsx(C,{})]})}),e.jsx(j,{control:x.control,name:"hiveId",render:({field:b})=>e.jsxs(g,{children:[e.jsx(f,{children:"Hive ID"}),e.jsx(N,{children:e.jsx(E,{type:"text",placeholder:"Enter Hive ID",...b,required:!i})}),e.jsx(C,{})]})})]})}),e.jsxs(is,{children:[e.jsx(T,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(T,{type:"submit",children:i?"Update Client":"Create Client"})]})]})})]})]})}const Rt=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 Mt(s){const t=s.internalLinks||s.useMessageBody||s.attachmentTypes?{internalEmailLinks:s.internalLinks,emailBody:s.useMessageBody,attachments:s.attachmentTypes}:void 0,l=s.description||s.tags||s.phrases||s.emails||t?{description:s.description,tags:s.tags?.map(i=>({id:i})),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:l}}function Ut({data:s,refetchBusiness:n}){const t=De(Js,s),[a,l]=y.useState(vs(t)),{userContext:i}=y.useContext(es),{updateBusiness:c,fetching:r}=Vs(),[o,d]=y.useState(!1),[h,u]=y.useState(void 0),x=Ie({defaultValues:a}),A=async p=>{if(!t||!i?.context.adminBusinessId)return;const S=Ze(p,x.formState.dirtyFields);if(!S)return;const b=Mt(S);await c({businessId:t.id,ownerId:i.context.adminBusinessId,fields:b}),S.tags?.length||S.description?(u({tagIds:S.tags?.map(k=>({id:k})),description:S.description}),d(!0)):n?.()};if(y.useEffect(()=>{if(t){const p=vs(t);l(p),x.reset(p)}},[t,x]),!t)return e.jsx("div",{});const m=x.watch("isClient");return e.jsxs(q,{children:[e.jsx(W,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(K,{children:"Configurations"}),e.jsx(H,{children:"Business status, tax settings, automation rules, and integration preferences"})]}),!m&&e.jsx($t,{businessId:t.id,onDone:n})]})}),e.jsx(Ae,{...x,children:e.jsxs("form",{onSubmit:x.handleSubmit(A),children:[e.jsxs(X,{className:"space-y-6",children:[e.jsx(zt,{form:x}),e.jsx(Fe,{}),e.jsx(Gt,{form:x}),e.jsx(Fe,{}),e.jsx(qt,{form:x}),e.jsx(Fe,{}),e.jsx(Wt,{form:x})]}),e.jsx(Ye,{className:"flex justify-end border-t pt-6",children:e.jsxs(T,{type:"submit",disabled:r||Object.keys(x.formState.dirtyFields).length===0,children:[e.jsx(os,{className:"h-4 w-4 mr-2"}),"Save Changes"]})})]})}),e.jsx(mt,{businessId:t.id,tagIds:h?.tagIds,description:h?.description,open:o,onOpenChange:d,onClose:n})]})}function zt({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(ee,{children:"Mark this business as a client"})]}),e.jsx(N,{children:e.jsx(Y,{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(ee,{children:"Business is currently active"})]}),e.jsx(N,{children:e.jsx(Y,{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(ee,{children:"Generate ledger for receipt documents if no invoice available"})]}),e.jsx(N,{children:e.jsx(Y,{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(ee,{children:"Skip document validation for common charges"})]}),e.jsx(N,{children:e.jsx(Y,{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(ee,{children:"Mute missing VAT indicator"})]}),e.jsx(N,{children:e.jsx(Y,{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(ee,{children:"Business is exempt from VAT requirements"})]}),e.jsx(N,{children:e.jsx(Y,{checked:n.value,onCheckedChange:n.onChange,className:I(t)})})]})})]})]})}function Gt({form:s}){const{selectableTaxCategories:n,fetching:t}=Qs(),{selectableSortCodes:a,fetching:l,sortCodes:i}=Ys(),{selectableTags:c,fetching:r}=Zs(),o=y.useCallback(d=>{if(d){const h=i.find(u=>Number(u.key)===Number(d));h&&(h.defaultIrsCode?s.setValue("irsCode",h.defaultIrsCode,{shouldDirty:!0}):s.setValue("irsCode",null,{shouldDirty:!0}))}},[s,i]);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:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Sort Code"}),e.jsx(N,{children:e.jsx(qe,{onChange:u=>{o(u),d.onChange(u)},data:a,value:d.value,disabled:l,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(h)}})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"taxCategory",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tax Category"}),e.jsx(N,{children:e.jsx(qe,{data:n,disabled:t,value:d.value,onChange:d.onChange,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(h)}})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"pcn874RecordType",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"PCN874 Record Type"}),e.jsxs(re,{onValueChange:d.onChange,value:d.value,children:[e.jsx(N,{children:e.jsx(ie,{className:I(h),children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.entries(en).map(([u,x])=>e.jsx(oe,{value:u,children:`${x} (${u})`},u))})]}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"irsCode",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"IRS Code"}),e.jsx(N,{children:e.jsx(sn,{value:d.value??void 0,onValueChange:u=>d.onChange(u??null),hideControls:!0,decimalScale:0,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"description",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Charge Description"}),e.jsx(N,{children:e.jsx(E,{placeholder:"Enter default charge description",...d,className:I(h)})}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"tags",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Tags"}),e.jsx(N,{children:e.jsx(nn,{options:Object.values(c).map(({value:u,label:x})=>({label:x,value:u})),onValueChange:d.onChange,defaultValue:d.value,value:d.value,placeholder:"Select Default Tags",variant:"default",disabled:r,className:I(h)})}),e.jsx(C,{})]})})]})]})}function qt({form:s}){const[n,t]=y.useState(""),[a,l]=y.useState(""),i=()=>{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}),l("")}},r=d=>{const h=s.getValues("phrases");s.setValue("phrases",h.filter((u,x)=>x!==d),{shouldDirty:!0})},o=d=>{const h=s.getValues("emails");s.setValue("emails",h.filter((u,x)=>x!==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:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Phrases"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{placeholder:"Add phrase...",value:n,onChange:u=>t(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),i())},className:I(h)}),e.jsx(T,{type:"button",size:"sm",onClick:i,children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.value?.map((u,x)=>e.jsxs(Z,{variant:"secondary",className:"gap-1",children:[u,e.jsx(T,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>r(x),children:e.jsx(me,{className:"size-3 cursor-pointer",onClick:()=>r(x)})})]},x))}),e.jsx(C,{})]})}),e.jsx(j,{control:s.control,name:"emails",render:({field:d,fieldState:h})=>e.jsxs(g,{children:[e.jsx(f,{children:"Email Addresses"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{type:"email",placeholder:"Add email...",value:a,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),c())},className:I(h)}),e.jsx(T,{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,x)=>e.jsxs(Z,{variant:"secondary",className:"gap-1",children:[u,e.jsx(T,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>o(x),children:e.jsx(me,{className:"size-3 cursor-pointer"})})]},x))}),e.jsx(C,{})]})})]})}function Wt({form:s}){const[n,t]=y.useState(""),a=()=>{if(n.trim()){const c=s.getValues("internalLinks");s.setValue("internalLinks",[...c,n.trim()],{shouldDirty:!0}),t("")}},l=c=>{const r=s.getValues("attachmentTypes");s.setValue("attachmentTypes",r?.includes(c)?r.filter(o=>o!==c):[...r,c],{shouldDirty:!0})},i=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:Rt.map(o=>e.jsx(Z,{variant:c.value?.includes(o)?"default":"outline",className:"cursor-pointer",onClick:()=>l(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(E,{type:"url",placeholder:"Add internal link...",value:n,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),a())}}),e.jsx(T,{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(Z,{variant:"secondary",className:"gap-1 max-w-xs truncate",children:[o,e.jsx(T,{variant:"ghost",size:"icon",className:"p-0 size-3",onClick:()=>i(d),children:e.jsx(me,{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(ee,{children:"Extract information from email message body"})]}),e.jsx(N,{children:e.jsx(Y,{checked:c.value,onCheckedChange:c.onChange,className:I(r)})})]})})]})}const Kt=Le({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:Is("Invalid URL").optional().or(Ds("")),generalContacts:ze(Ge()).optional(),billingEmails:ze(Ge()).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 Ht(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 Xt({data:s,refetchBusiness:n}){const t=De(ln,s),[a,l]=y.useState(ys(t)),{userContext:i}=y.useContext(es),{updateBusiness:c,fetching:r}=Vs(),o=Ie({resolver:Oe(Kt),defaultValues:a}),{countries:d,fetching:h}=an(),[u,x]=y.useState(""),[A,m]=y.useState(""),p=o.watch("locality"),S=o.watch("address"),b=o.watch("localAddress");y.useEffect(()=>{S!==a.address&&o.setValue("address",S,{shouldDirty:!0})},[S,a.address,o]),y.useEffect(()=>{b!==a.localAddress&&o.setValue("localAddress",b,{shouldDirty:!0})},[b,a.localAddress,o]);const k=t&&"clientInfo"in t&&!!t.clientInfo,F=p===i?.context.locality,R=v=>{u.trim()&&(o.setValue("generalContacts",[...v,u.trim()],{shouldDirty:!0}),x(""))},$=(v,w)=>{o.setValue("generalContacts",v.filter((P,B)=>B!==w),{shouldDirty:!0})},J=v=>{A.trim()&&(o.setValue("billingEmails",[...v,A.trim()],{shouldDirty:!0}),m(""))},U=(v,w)=>{o.setValue("billingEmails",v.filter((P,B)=>B!==w),{shouldDirty:!0})},se=async v=>{if(!t||!i?.context.adminBusinessId)return;const w=Ze(v,o.formState.dirtyFields);if(!w)return;const P=Ht(w);await c({businessId:t.id,ownerId:i.context.adminBusinessId,fields:P}),n?.()};return y.useEffect(()=>{if(t){const v=ys(t);l(v),o.reset(v)}},[t,o]),e.jsxs(q,{children:[e.jsxs(W,{children:[e.jsx(K,{children:"Contact Information"}),e.jsx(H,{children:"Business contact details and address information"})]}),e.jsx(Ae,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(se),children:[e.jsx(X,{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(N,{children:e.jsx(E,{...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(qe,{onChange:v.onChange,data:d.map(P=>({value:P.code,label:P.name})),value:v.value,disabled:h,placeholder:"Scroll to see all options",formPart:!0,triggerProps:{className:I(w)}}),e.jsx(C,{})]})}),F&&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(N,{children:e.jsx(E,{...v,placeholder:"Business name in local language",className:I(w)})}),e.jsx(C,{})]})}),F&&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(N,{children:e.jsx(E,{...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(We,{className:"h-4 w-4"}),"Address"]}),e.jsx(N,{children:e.jsx(Ke,{...v,rows:3,placeholder:"Enter business address",className:I(w)})}),e.jsx(C,{})]})}),F&&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(We,{className:"h-4 w-4"}),"Local Address"]}),e.jsx(N,{children:e.jsx(Ke,{...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(ws,{className:"h-4 w-4"}),"Phone"]}),e.jsx(N,{children:e.jsx(E,{...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(N,{children:e.jsx(E,{...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(He,{className:"h-4 w-4"}),"General Contacts"]}),e.jsx(N,{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,B)=>e.jsxs(Z,{variant:"secondary",className:"gap-1 pr-1",children:[P,e.jsx("button",{type:"button",onClick:()=>$(v.value??[],B),className:"ml-1 hover:bg-muted rounded-sm p-0.5",children:e.jsx(me,{className:"h-3 w-3"})})]},B))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{value:u,onChange:P=>x(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),R(v.value??[]))},placeholder:"Add contact email",type:"email"}),e.jsx(T,{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,{})]})}),k&&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(He,{className:"h-4 w-4"}),"Billing Emails"]}),e.jsx(N,{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,B)=>e.jsxs(Z,{variant:"secondary",className:"gap-1 pr-1",children:[P,e.jsx("button",{type:"button",onClick:()=>U(v.value??[],B),className:"ml-1 hover:bg-muted rounded-sm p-0.5",children:e.jsx(me,{className:"h-3 w-3"})})]},B))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{value:A,onChange:P=>m(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),J(v.value??[]))},placeholder:"Add billing email",type:"email"}),e.jsx(T,{type:"button",variant:"outline",size:"icon",disabled:!A.trim(),onClick:()=>J(v.value??[]),children:e.jsx(G,{className:"h-4 w-4"})})]})]})}),e.jsx(C,{})]})})]})}),e.jsx(Ye,{className:"flex justify-end border-t mt-4 pt-6",children:e.jsxs(T,{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 Jt="createContract",Qt=()=>{const[{fetching:s},n]=pe(cn),t=y.useCallback(async a=>{const l=`Error creating new contract for client[${a.input.clientId}]`,i=`${Jt}-${a.input.clientId}`;O.loading("Creating contract",{id:i});try{const c=await n(a);je(c,l,i)&&O.success("Success",{id:i,description:`Contract for client ${a.input.clientId} was successfully created`})}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{creating:s,createContract:t}},Yt="updateContract",Zt=()=>{const[{fetching:s},n]=pe(on),t=y.useCallback(async a=>{const l=`Error updating contract ID [${a.contractId}]`,i=`${Yt}-${a.contractId}`;O.loading("Updating contract",{id:i});try{const c=await n(a),r=je(c,l,i,"updateContract");if(r)return O.success("Success",{id:i,description:"Contract updated"}),r.updateContract}catch(c){console.error(`${l}: ${c}`),O.error("Error",{id:i,description:l,duration:1e5,closeButton:!0})}},[n]);return{updating:s,updateContract:t}},ea=Le({id:Ue().optional(),startDate:ms("Start date is required"),endDate:ms("End date is required"),po:V().optional(),paymentAmount:bs().min(0,"Payment amount must be non-negative"),paymentCurrency:ae(Object.values(ls),"Currency is required"),productType:ae(Object.values(As)).optional(),msCloudLink:Is().optional().or(Ds("")),billingCycle:ae(Object.values(be)).optional(),subscriptionPlan:ae(Object.values(Ee)).optional(),isActive:dn(),defaultRemark:V().optional(),defaultDocumentType:ae(Object.values(de))}),Ns={startDate:"",endDate:"",po:void 0,paymentAmount:0,paymentCurrency:ls.Usd,productType:As.Hive,msCloudLink:void 0,billingCycle:be.Monthly,subscriptionPlan:void 0,isActive:!0,defaultRemark:void 0,defaultDocumentType:de.Proforma};function sa({clientId:s,contract:n,onDone:t}){const[a,l]=y.useState(!1),[i,c]=y.useState(null),{updateContract:r,updating:o}=Zt(),{createContract:d,creating:h}=Qt(),u=Ie({resolver:Oe(ea),defaultValues:n||Ns});y.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}),l(!0))},[n,u]);const x=()=>{c(null),u.reset(Ns),l(!0)},A=y.useCallback(async m=>{if(i)await r({contractId:i.id,input:{amount:{raw:m.paymentAmount,currency:m.paymentCurrency},billingCycle:m.billingCycle,documentType:m.defaultDocumentType,endDate:Ne(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:Ne(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:Ne(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:Ne(new Date(m.startDate),"yyyy-MM-dd")}})}l(!1),c(null),t?.()},[i,t,d,r,s,u]);return e.jsxs(Pe,{open:a,onOpenChange:l,children:[e.jsx(ss,{asChild:!0,children:e.jsxs(T,{size:"sm",onClick:x,children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"New Contract"]})}),e.jsxs(Be,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ns,{children:[e.jsx(ts,{children:i?"Edit Contract":"Create New Contract"}),e.jsx(as,{children:i?"Update contract details":"Add a new contract with all required details"})]}),e.jsx(Ae,{...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(N,{children:e.jsx(E,{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(N,{children:e.jsx(E,{type:"date",...p,onInput:S=>m(S)})}),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(N,{children:e.jsx(E,{type:"date",...p,onInput:S=>m(S)})}),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(N,{children:e.jsx(E,{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(re,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(N,{children:e.jsx(ie,{children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.values(ls).map(p=>e.jsx(oe,{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(N,{children:e.jsx(E,{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(re,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(N,{children:e.jsx(ie,{children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.values(be).map(p=>e.jsx(oe,{value:p,children:Ps(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(N,{children:e.jsxs(re,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(N,{children:e.jsx(ie,{children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.values(Ee).map(p=>e.jsx(oe,{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(N,{children:e.jsx(Y,{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(N,{children:e.jsx(E,{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(re,{onValueChange:m.onChange,defaultValue:m.value,children:[e.jsx(N,{children:e.jsx(ie,{children:e.jsx(le,{})})}),e.jsx(ce,{children:Object.values(de).map(p=>e.jsx(oe,{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(N,{children:e.jsx(Ke,{placeholder:"Enter default remark for this contract...",rows:3,...m})}),e.jsx(C,{})]})})]}),e.jsxs(is,{children:[e.jsx(T,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(T,{type:"submit",disabled:h||o,children:i?"Update Contract":"Create Contract"})]})]})})]})]})}function na(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 ta({clientId:s}){const[n,t]=y.useState(null),[{data:a,fetching:l},i]=we({query:mn,variables:{clientId:s}}),c=a?.contractsByClient??[];return l?e.jsx("div",{children:"Loading contracts..."}):e.jsxs(q,{children:[e.jsx(W,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(K,{children:"Contracts"}),e.jsx(H,{children:"Current and past contracts sorted by start date"})]}),e.jsx(sa,{clientId:s,contract:n,onDone:i})]})}),e.jsx(X,{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(Z,{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(T,{variant:"ghost",size:"sm",onClick:()=>t(na(r)),children:e.jsx(Qn,{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:Ps(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(T,{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(Yn,{className:"h-3 w-3 ml-1"})]})})})]},r.id)})})]})}function aa({businessId:s}){return e.jsxs(q,{children:[e.jsx(W,{children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx(K,{children:"Documents"}),e.jsx(H,{children:"Invoices, proformas, receipts, and other accounting documents"})]})})}),e.jsx(X,{children:e.jsx(pn,{businessId:s,linkedDocumentIds:[],limit:1e3})})]})}const ra=[{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 ia({data:s}){const n=De(fn,s),[{data:t,fetching:a},l]=we({query:jn,variables:{clientId:n?.id??""},pause:!n?.clientInfo?.greenInvoiceId||!n?.id}),{updateClient:i}=Fs(),c=y.useCallback((o,d)=>{if(!n?.id)return;const h={};h[d]=o,i({businessId:n?.id,fields:h})},[n?.id,i]);y.useEffect(()=>{n?.clientInfo?.greenInvoiceId&&n?.id&&l()},[n?.clientInfo?.greenInvoiceId,n?.id,l]);const r=t?.greenInvoiceClient;return e.jsxs(q,{children:[e.jsx(W,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(K,{children:"Integrations"}),e.jsx(H,{children:"Connected external services and providers"})]}),e.jsxs(T,{size:"sm",children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"Add Integration"]})]})}),e.jsx(X,{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(Re,{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(la,{id:n?.clientInfo?.greenInvoiceId,provider:"Green Invoice",updateClient:async o=>c(o,"greenInvoiceId")}),e.jsx(hs,{className:"hover:no-underline p-2"})]})]})}),e.jsx(Re,{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(He,{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(ws,{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(We,{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})]})]})]})]})})]}),ra.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(gn,{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(T,{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(Re,{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 la({id:s,provider:n,updateClient:t}){const[a,l]=y.useState(!1),[i,c]=y.useState(s),r=y.useCallback(async()=>{await t(i),l(!1)},[i,t]);return e.jsxs(Pe,{open:a,onOpenChange:l,children:[e.jsx(ss,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",onClick:o=>o.stopPropagation(),children:[e.jsx(cs,{className:"h-4 w-4 mr-2"}),"Configure"]})}),e.jsxs(Be,{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(vn,{htmlFor:"id",children:[n," ID"]}),e.jsx(E,{id:"id",value:i,onChange:o=>c(o.target.value),placeholder:`Enter ${n} ID`})]})}),e.jsxs(is,{children:[e.jsx(T,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(T,{onClick:r,disabled:!i,children:"Save Changes"})]})]})]})}function ca({businessId:s}){return e.jsxs(q,{children:[e.jsx(W,{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(K,{children:"Transactions"}),e.jsx(H,{children:"Complete transaction history for this business"})]})})}),e.jsx(X,{children:e.jsx("div",{className:"rounded-md border",children:e.jsx(et,{businessID:s,filter:{}})})})]})}function oa({data:s,refetchBusiness:n}){const t=De(In,s),[a,l]=yn(),i=a.get("tab")||"contact",c=d=>{l({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(kn,{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(Nn,{value:i,onValueChange:c,className:"w-full",children:[e.jsxs(Cn,{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(Q,{value:"contact",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(st,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Contact"})]}),e.jsxs(Q,{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(Q,{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(Q,{value:"transactions",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(bn,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Transactions"})]}),e.jsxs(Q,{value:"documents",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(wn,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Documents"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(Q,{value:"contracts",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(rt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Contracts"})]}),e.jsxs(Q,{value:"integrations",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(lt,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Integrations"})]})]}),o&&e.jsxs(Q,{value:"admin",className:"flex items-center gap-2 data-[state=active]:bg-background",children:[e.jsx(Ts,{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(Xt,{data:t,refetchBusiness:n})}),e.jsx(z,{value:"config",className:"mt-0",children:e.jsx(Ut,{data:t,refetchBusiness:n})}),e.jsx(z,{value:"charges",className:"mt-0",children:e.jsx(gt,{businessId:t.id})}),e.jsx(z,{value:"transactions",className:"mt-0",children:e.jsx(ca,{businessId:t.id})}),e.jsx(z,{value:"documents",className:"mt-0",children:e.jsx(aa,{businessId:t.id})}),r&&e.jsxs(e.Fragment,{children:[e.jsx(z,{value:"contracts",className:"mt-0",children:e.jsx(ta,{clientId:t.id})}),e.jsx(z,{value:"integrations",className:"mt-0",children:e.jsx(ia,{data:t})}),e.jsx(z,{value:"charts",className:"mt-0",children:e.jsx(Bt,{})})]}),o&&e.jsx(z,{value:"admin",className:"mt-0",children:e.jsx(jt,{data:t})})]})})]})}const Ba=()=>{const{businessId:s}=Dn();let n;try{n=An()}catch{}const[{data:t,fetching:a},l]=we({query:Sn,pause:!s||!!n,variables:{businessId:s??""}}),i=n||t;return!n&&a&&!i?.business?e.jsx(Cs,{}):!s||!i?.business?e.jsx("div",{children:"Business not found"}):e.jsx(oa,{data:i.business,refetchBusiness:async()=>l()})};export{Ba as BusinessScreen};