@gusto/embedded-react-sdk 0.56.7 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  4. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  5. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  6. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  7. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  8. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  9. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  10. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  11. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  12. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  13. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
  14. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  15. package/dist/components/Company/Industry/Context.js +8 -7
  16. package/dist/components/Company/Industry/Context.js.map +1 -1
  17. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  18. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  19. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  20. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  21. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  22. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  23. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js +70 -0
  24. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js.map +1 -0
  25. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +30 -32
  26. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -1
  27. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +35 -27
  28. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -1
  29. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +52 -31
  30. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -1
  31. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +106 -66
  32. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
  33. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +36 -30
  34. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -1
  35. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js +7 -0
  36. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js.map +1 -0
  37. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js +81 -0
  38. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -0
  39. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +46 -18
  40. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
  41. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  42. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  43. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  44. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  45. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +5 -4
  46. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  47. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  48. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  49. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +13 -13
  50. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
  51. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  52. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  53. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js +113 -111
  54. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
  55. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +27 -31
  56. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  57. package/dist/components/Payroll/PayrollList/PayrollList.js +31 -35
  58. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  59. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +5 -9
  60. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +1 -1
  61. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  62. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  63. package/dist/contexts/ApiProvider/createSdkQueryClient.js +4 -3
  64. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
  65. package/dist/contexts/ObservabilityProvider/sanitization.js +98 -47
  66. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  67. package/dist/helpers/validations.js +1 -1
  68. package/dist/helpers/validations.js.map +1 -1
  69. package/dist/i18n/en/Company.AssignSignatory.json.js +1 -1
  70. package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -14
  71. package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
  72. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +12 -10
  73. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -1
  74. package/dist/package.json.js +1 -1
  75. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.d.ts +15 -0
  76. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +3 -3
  77. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +7 -3
  78. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +20 -4
  79. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.d.ts +3 -0
  80. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +10 -1
  81. package/dist/src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.d.ts +25 -0
  82. package/dist/src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.test.d.ts +1 -0
  83. package/dist/src/contexts/ApiProvider/createSdkQueryClient.d.ts +2 -0
  84. package/dist/src/contexts/ApiProvider/createSdkQueryClient.test.d.ts +1 -0
  85. package/dist/src/contexts/ObservabilityProvider/sanitization.d.ts +8 -17
  86. package/dist/src/contexts/ObservabilityProvider/useSanitizedObservability.test.d.ts +1 -0
  87. package/dist/src/helpers/validations.test.d.ts +1 -0
  88. package/dist/src/i18n/types.d.ts +38 -2
  89. package/dist/src/models/external.d.ts +7 -6
  90. package/dist/src/types/observability.d.ts +59 -20
  91. package/docs/guides/endpoint-inventory.json +15 -0
  92. package/package.json +12 -12
@@ -1,81 +1,87 @@
1
- import { state as a, transition as n, reduce as s } from "robot3";
2
- import { AssignmentScheduleStep as i, AssignmentTypeStep as E, AssignmentCreateScheduleStep as o, AssignmentReviewStep as c } from "./PayScheduleAssignmentComponents.js";
1
+ import { state as i, transition as n, reduce as a } from "robot3";
2
+ import { AssignmentScheduleStep as d, AssignmentTypeStep as u, AssignmentCreateScheduleStep as m, AssignmentReviewStep as E } from "./PayScheduleAssignmentComponents.js";
3
3
  import { componentEvents as t } from "../../../../../shared/constants.js";
4
- const m = s(
4
+ const o = a(
5
5
  (e) => ({
6
6
  ...e,
7
- component: i
7
+ component: d
8
8
  })
9
- ), l = {
10
- assignmentType: a(
9
+ ), y = {
10
+ assignmentType: i(
11
11
  n(
12
12
  t.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED,
13
13
  "assignmentSchedule",
14
- s(
15
- (e, S) => ({
16
- ...e,
17
- component: i,
18
- assignmentType: S.payload.type
19
- })
14
+ a(
15
+ (e, s) => {
16
+ const S = e.assignmentType === s.payload.type;
17
+ return {
18
+ ...e,
19
+ component: d,
20
+ assignmentType: s.payload.type,
21
+ defaultPayScheduleUuid: S ? e.defaultPayScheduleUuid : void 0,
22
+ hourlyPayScheduleUuid: S ? e.hourlyPayScheduleUuid : void 0,
23
+ salariedPayScheduleUuid: S ? e.salariedPayScheduleUuid : void 0
24
+ };
25
+ }
20
26
  )
21
27
  )
22
28
  ),
23
- assignmentSchedule: a(
29
+ assignmentSchedule: i(
24
30
  n(
25
31
  t.PAY_SCHEDULE_ASSIGNMENT_BACK,
26
32
  "assignmentType",
27
- s(
33
+ a(
28
34
  (e) => ({
29
35
  ...e,
30
- component: E
36
+ component: u
31
37
  })
32
38
  )
33
39
  ),
34
40
  n(
35
41
  t.PAY_SCHEDULE_CREATE,
36
42
  "assignmentCreateSchedule",
37
- s(
43
+ a(
38
44
  (e) => ({
39
45
  ...e,
40
- component: o
46
+ component: m
41
47
  })
42
48
  )
43
49
  ),
44
50
  n(
45
51
  t.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED,
46
52
  "assignmentReview",
47
- s(
48
- (e, S) => ({
53
+ a(
54
+ (e, s) => ({
49
55
  ...e,
50
- component: c,
51
- defaultPayScheduleUuid: S.payload.defaultPayScheduleUuid
56
+ component: E,
57
+ ...s.payload
52
58
  })
53
59
  )
54
60
  )
55
61
  ),
56
- assignmentCreateSchedule: a(
62
+ assignmentCreateSchedule: i(
57
63
  n(
58
64
  t.PAY_SCHEDULE_CREATED,
59
65
  "assignmentSchedule",
60
- s(
61
- (e, S) => ({
66
+ a(
67
+ (e, s) => ({
62
68
  ...e,
63
- component: i,
64
- defaultPayScheduleUuid: S.payload.paySchedule.uuid
69
+ component: d,
70
+ defaultPayScheduleUuid: s.payload.paySchedule.uuid
65
71
  })
66
72
  )
67
73
  ),
68
- n(t.CANCEL, "assignmentSchedule", m)
74
+ n(t.CANCEL, "assignmentSchedule", o)
69
75
  ),
70
- assignmentReview: a(
76
+ assignmentReview: i(
71
77
  n(
72
78
  t.PAY_SCHEDULE_ASSIGNMENT_BACK,
73
79
  "assignmentSchedule",
74
- m
80
+ o
75
81
  )
76
82
  )
77
83
  };
78
84
  export {
79
- l as payScheduleAssignmentStateMachine
85
+ y as payScheduleAssignmentStateMachine
80
86
  };
81
87
  //# sourceMappingURL=payScheduleAssignmentStateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payScheduleAssignmentStateMachine.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ComponentType } from 'react'\nimport {\n AssignmentTypeStep,\n AssignmentScheduleStep,\n AssignmentCreateScheduleStep,\n AssignmentReviewStep,\n} from './PayScheduleAssignmentComponents'\nimport type { EventPayloads } from './PayScheduleAssignmentComponents'\nimport type { PayScheduleAssignmentContextInterface } from './usePayScheduleAssignment'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nconst toAssignmentSchedule = reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n }),\n)\n\n/** @internal */\nexport const payScheduleAssignmentStateMachine = {\n assignmentType: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED,\n 'assignmentSchedule',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED\n >,\n ): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n assignmentType: ev.payload.type,\n }),\n ),\n ),\n ),\n assignmentSchedule: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK,\n 'assignmentType',\n reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentTypeStep as ComponentType,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_CREATE,\n 'assignmentCreateSchedule',\n reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentCreateScheduleStep as ComponentType,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED,\n 'assignmentReview',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED\n >,\n ): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentReviewStep as ComponentType,\n defaultPayScheduleUuid: ev.payload.defaultPayScheduleUuid,\n }),\n ),\n ),\n ),\n assignmentCreateSchedule: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_CREATED,\n 'assignmentSchedule',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.PAY_SCHEDULE_CREATED>,\n ): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n defaultPayScheduleUuid: ev.payload.paySchedule.uuid,\n }),\n ),\n ),\n transition(componentEvents.CANCEL, 'assignmentSchedule', toAssignmentSchedule),\n ),\n assignmentReview: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK,\n 'assignmentSchedule',\n toAssignmentSchedule,\n ),\n ),\n}\n"],"names":["toAssignmentSchedule","reduce","ctx","AssignmentScheduleStep","payScheduleAssignmentStateMachine","state","transition","componentEvents","ev","AssignmentTypeStep","AssignmentCreateScheduleStep","AssignmentReviewStep"],"mappings":";;;AAaA,MAAMA,IAAuBC;AAAA,EAC3B,CAACC,OAAuF;AAAA,IACtF,GAAGA;AAAA,IACH,WAAWC;AAAA,EAAA;AAEf,GAGaC,IAAoC;AAAA,EAC/C,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,OAI2C;AAAA,UAC3C,GAAGN;AAAA,UACH,WAAWC;AAAA,UACX,gBAAgBK,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AAAA,EAEF,oBAAoBH;AAAA,IAClBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWO;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,IAEFH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWQ;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,OAI2C;AAAA,UAC3C,GAAGN;AAAA,UACH,WAAWS;AAAA,UACX,wBAAwBH,EAAG,QAAQ;AAAA,QAAA;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,0BAA0BH;AAAA,IACxBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,OAC2C;AAAA,UAC3C,GAAGN;AAAA,UACH,WAAWC;AAAA,UACX,wBAAwBK,EAAG,QAAQ,YAAY;AAAA,QAAA;AAAA,MACjD;AAAA,IACF;AAAA,IAEFF,EAAWC,EAAgB,QAAQ,sBAAsBP,CAAoB;AAAA,EAAA;AAAA,EAE/E,kBAAkBK;AAAA,IAChBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"payScheduleAssignmentStateMachine.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ComponentType } from 'react'\nimport {\n AssignmentTypeStep,\n AssignmentScheduleStep,\n AssignmentCreateScheduleStep,\n AssignmentReviewStep,\n} from './PayScheduleAssignmentComponents'\nimport type { EventPayloads } from './PayScheduleAssignmentComponents'\nimport type { PayScheduleAssignmentContextInterface } from './usePayScheduleAssignment'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nconst toAssignmentSchedule = reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n }),\n)\n\n/** @internal */\nexport const payScheduleAssignmentStateMachine = {\n assignmentType: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED,\n 'assignmentSchedule',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED\n >,\n ): PayScheduleAssignmentContextInterface => {\n // Switching type invalidates every schedule already picked under the old one, so a\n // Single → HourlySalaried → Back → Single round trip can't resurrect a stale uuid.\n const isSameType = ctx.assignmentType === ev.payload.type\n\n return {\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n assignmentType: ev.payload.type,\n defaultPayScheduleUuid: isSameType ? ctx.defaultPayScheduleUuid : undefined,\n hourlyPayScheduleUuid: isSameType ? ctx.hourlyPayScheduleUuid : undefined,\n salariedPayScheduleUuid: isSameType ? ctx.salariedPayScheduleUuid : undefined,\n }\n },\n ),\n ),\n ),\n assignmentSchedule: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK,\n 'assignmentType',\n reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentTypeStep as ComponentType,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_CREATE,\n 'assignmentCreateSchedule',\n reduce(\n (ctx: PayScheduleAssignmentContextInterface): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentCreateScheduleStep as ComponentType,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED,\n 'assignmentReview',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED\n >,\n ): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentReviewStep as ComponentType,\n ...ev.payload,\n }),\n ),\n ),\n ),\n assignmentCreateSchedule: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_CREATED,\n 'assignmentSchedule',\n reduce(\n (\n ctx: PayScheduleAssignmentContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.PAY_SCHEDULE_CREATED>,\n ): PayScheduleAssignmentContextInterface => ({\n ...ctx,\n component: AssignmentScheduleStep as ComponentType,\n defaultPayScheduleUuid: ev.payload.paySchedule.uuid,\n }),\n ),\n ),\n transition(componentEvents.CANCEL, 'assignmentSchedule', toAssignmentSchedule),\n ),\n assignmentReview: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNMENT_BACK,\n 'assignmentSchedule',\n toAssignmentSchedule,\n ),\n ),\n}\n"],"names":["toAssignmentSchedule","reduce","ctx","AssignmentScheduleStep","payScheduleAssignmentStateMachine","state","transition","componentEvents","ev","isSameType","AssignmentTypeStep","AssignmentCreateScheduleStep","AssignmentReviewStep"],"mappings":";;;AAaA,MAAMA,IAAuBC;AAAA,EAC3B,CAACC,OAAuF;AAAA,IACtF,GAAGA;AAAA,IACH,WAAWC;AAAA,EAAA;AAEf,GAGaC,IAAoC;AAAA,EAC/C,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,MAI0C;AAG1C,gBAAMC,IAAaP,EAAI,mBAAmBM,EAAG,QAAQ;AAErD,iBAAO;AAAA,YACL,GAAGN;AAAA,YACH,WAAWC;AAAA,YACX,gBAAgBK,EAAG,QAAQ;AAAA,YAC3B,wBAAwBC,IAAaP,EAAI,yBAAyB;AAAA,YAClE,uBAAuBO,IAAaP,EAAI,wBAAwB;AAAA,YAChE,yBAAyBO,IAAaP,EAAI,0BAA0B;AAAA,UAAA;AAAA,QAExE;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAAA,EAEF,oBAAoBG;AAAA,IAClBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWQ;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWS;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,OAI2C;AAAA,UAC3C,GAAGN;AAAA,UACH,WAAWU;AAAA,UACX,GAAGJ,EAAG;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EAEF,0BAA0BH;AAAA,IACxBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN;AAAA,QACE,CACEC,GACAM,OAC2C;AAAA,UAC3C,GAAGN;AAAA,UACH,WAAWC;AAAA,UACX,wBAAwBK,EAAG,QAAQ,YAAY;AAAA,QAAA;AAAA,MACjD;AAAA,IACF;AAAA,IAEFF,EAAWC,EAAgB,QAAQ,sBAAsBP,CAAoB;AAAA,EAAA;AAAA,EAE/E,kBAAkBK;AAAA,IAChBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -0,0 +1,7 @@
1
+ function n(e) {
2
+ return [e.customName, e.frequency].filter(Boolean).join(" — ");
3
+ }
4
+ export {
5
+ n as scheduleLabel
6
+ };
7
+ //# sourceMappingURL=scheduleLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduleLabel.js","sources":["../../../../../../src/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.ts"],"sourcesContent":["import type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\n\n/** @internal */\nexport function scheduleLabel(schedule: PayScheduleShow): string {\n return [schedule.customName, schedule.frequency].filter(Boolean).join(' — ')\n}\n"],"names":["scheduleLabel","schedule"],"mappings":"AAGO,SAASA,EAAcC,GAAmC;AAC/D,SAAO,CAACA,EAAS,YAAYA,EAAS,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK;AAC7E;"}
@@ -0,0 +1,81 @@
1
+ import { jsxs as d, Fragment as p, jsx as o } from "react/jsx-runtime";
2
+ import { useTranslation as b } from "react-i18next";
3
+ import { HamburgerMenu as y } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
4
+ import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
5
+ import { useDataView as g } from "../../../Common/DataView/useDataView.js";
6
+ import { DataView as h } from "../../../Common/DataView/DataView.js";
7
+ function B({
8
+ rows: i,
9
+ enableAutoPilot: n,
10
+ enableMultipleSchedules: r,
11
+ onEditSchedule: l,
12
+ onManageAssignment: s,
13
+ onEditAutoPilot: c
14
+ }) {
15
+ const { t: e } = b("Company.Management.PaySchedule"), a = f(), m = g({
16
+ data: i,
17
+ columns: [
18
+ {
19
+ key: "schedule",
20
+ title: e("labels.schedule"),
21
+ render: ({ compensationType: t, schedule: u }) => /* @__PURE__ */ d(p, { children: [
22
+ e(`compensationTypes.${t}`),
23
+ /* @__PURE__ */ o(a.Text, { variant: "supporting", size: "sm", children: u.customName })
24
+ ] })
25
+ },
26
+ {
27
+ key: "frequency",
28
+ title: e("labels.frequency"),
29
+ render: ({ schedule: t }) => t.frequency
30
+ },
31
+ ...n ? [
32
+ {
33
+ key: "autoPilot",
34
+ title: e("autoPilot.label"),
35
+ render: ({ schedule: t }) => /* @__PURE__ */ o(a.Badge, { status: t.autoPayroll ? "success" : "info", children: t.autoPayroll ? e("autoPilot.enabled") : e("autoPilot.disabled") })
36
+ }
37
+ ] : []
38
+ ],
39
+ itemMenu: ({ schedule: t }) => /* @__PURE__ */ o(
40
+ y,
41
+ {
42
+ items: [
43
+ {
44
+ label: e("editScheduleCta"),
45
+ onClick: () => {
46
+ l(t);
47
+ }
48
+ },
49
+ ...n ? [
50
+ {
51
+ label: e("autoPilot.label"),
52
+ onClick: () => {
53
+ c(t);
54
+ }
55
+ }
56
+ ] : []
57
+ ],
58
+ triggerLabel: e("rowMenuTriggerLabel")
59
+ }
60
+ )
61
+ });
62
+ return /* @__PURE__ */ o(
63
+ a.Box,
64
+ {
65
+ withPadding: !1,
66
+ header: /* @__PURE__ */ o(
67
+ a.BoxHeader,
68
+ {
69
+ title: e("title"),
70
+ description: e("compensationDescription"),
71
+ action: r ? /* @__PURE__ */ o(a.Button, { variant: "secondary", onClick: s, children: e("manageCta") }) : void 0
72
+ }
73
+ ),
74
+ children: /* @__PURE__ */ o(h, { label: e("compensationTableLabel"), isWithinBox: !0, ...m })
75
+ }
76
+ );
77
+ }
78
+ export {
79
+ B as PayScheduleCompensationOverviewPresentation
80
+ };
81
+ //# sourceMappingURL=PayScheduleCompensationOverviewPresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayScheduleCompensationOverviewPresentation.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** @internal */\nexport type CompensationType = 'hourly' | 'salaried'\n\n/** @internal */\nexport interface PayScheduleCompensationRow {\n compensationType: CompensationType\n schedule: PayScheduleShow\n}\n\n/** @internal */\nexport interface PayScheduleCompensationOverviewPresentationProps {\n /** One row per compensation type, in display order. */\n rows: PayScheduleCompensationRow[]\n /** Shows the AutoPilot column and its row action when `true`. */\n enableAutoPilot?: boolean\n /** Shows the Manage action when `true`. */\n enableMultipleSchedules?: boolean\n /** Fired when the user chooses Edit schedule from a row menu. */\n onEditSchedule: (schedule: PayScheduleShow) => void\n /** Fired when the user clicks Manage. */\n onManageAssignment: () => void\n /** Fired when the user chooses AutoPilot from a row menu. */\n onEditAutoPilot: (schedule: PayScheduleShow) => void\n}\n\n/** @internal */\nexport function PayScheduleCompensationOverviewPresentation({\n rows,\n enableAutoPilot,\n enableMultipleSchedules,\n onEditSchedule,\n onManageAssignment,\n onEditAutoPilot,\n}: PayScheduleCompensationOverviewPresentationProps) {\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n const dataViewProps = useDataView<PayScheduleCompensationRow>({\n data: rows,\n columns: [\n {\n key: 'schedule',\n title: t('labels.schedule'),\n render: ({ compensationType, schedule }) => (\n <>\n {t(`compensationTypes.${compensationType}`)}\n <Components.Text variant=\"supporting\" size=\"sm\">\n {schedule.customName}\n </Components.Text>\n </>\n ),\n },\n {\n key: 'frequency',\n title: t('labels.frequency'),\n render: ({ schedule }) => schedule.frequency,\n },\n ...(enableAutoPilot\n ? [\n {\n key: 'autoPilot',\n title: t('autoPilot.label'),\n render: ({ schedule }: PayScheduleCompensationRow) => (\n <Components.Badge status={schedule.autoPayroll ? 'success' : 'info'}>\n {schedule.autoPayroll ? t('autoPilot.enabled') : t('autoPilot.disabled')}\n </Components.Badge>\n ),\n },\n ]\n : []),\n ],\n itemMenu: ({ schedule }) => (\n <HamburgerMenu\n items={[\n {\n label: t('editScheduleCta'),\n onClick: () => {\n onEditSchedule(schedule)\n },\n },\n ...(enableAutoPilot\n ? [\n {\n label: t('autoPilot.label'),\n onClick: () => {\n onEditAutoPilot(schedule)\n },\n },\n ]\n : []),\n ]}\n triggerLabel={t('rowMenuTriggerLabel')}\n />\n ),\n })\n\n return (\n <Components.Box\n withPadding={false}\n header={\n <Components.BoxHeader\n title={t('title')}\n description={t('compensationDescription')}\n action={\n enableMultipleSchedules ? (\n <Components.Button variant=\"secondary\" onClick={onManageAssignment}>\n {t('manageCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n >\n <DataView label={t('compensationTableLabel')} isWithinBox {...dataViewProps} />\n </Components.Box>\n )\n}\n"],"names":["PayScheduleCompensationOverviewPresentation","rows","enableAutoPilot","enableMultipleSchedules","onEditSchedule","onManageAssignment","onEditAutoPilot","t","useTranslation","Components","useComponentContext","dataViewProps","useDataView","compensationType","schedule","jsxs","Fragment","jsx","HamburgerMenu","DataView"],"mappings":";;;;;;AAgCO,SAASA,EAA4C;AAAA,EAC1D,MAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AACF,GAAqD;AACnD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAwC;AAAA,IAC5D,MAAMX;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOM,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAC,EAAE,kBAAAM,GAAkB,UAAAC,EAAA,MAC3B,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAT,EAAE,qBAAqBM,CAAgB,EAAE;AAAA,UAC1C,gBAAAI,EAACR,EAAW,MAAX,EAAgB,SAAQ,cAAa,MAAK,MACxC,UAAAK,EAAS,WAAA,CACZ;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOP,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAC,EAAE,UAAAO,EAAA,MAAeA,EAAS;AAAA,MAAA;AAAA,MAErC,GAAIZ,IACA;AAAA,QACE;AAAA,UACE,KAAK;AAAA,UACL,OAAOK,EAAE,iBAAiB;AAAA,UAC1B,QAAQ,CAAC,EAAE,UAAAO,QACT,gBAAAG,EAACR,EAAW,OAAX,EAAiB,QAAQK,EAAS,cAAc,YAAY,QAC1D,UAAAA,EAAS,cAAcP,EAAE,mBAAmB,IAAIA,EAAE,oBAAoB,EAAA,CACzE;AAAA,QAAA;AAAA,MAEJ,IAEF,CAAA;AAAA,IAAC;AAAA,IAEP,UAAU,CAAC,EAAE,UAAAO,EAAA,MACX,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAOX,EAAE,iBAAiB;AAAA,YAC1B,SAAS,MAAM;AACb,cAAAH,EAAeU,CAAQ;AAAA,YACzB;AAAA,UAAA;AAAA,UAEF,GAAIZ,IACA;AAAA,YACE;AAAA,cACE,OAAOK,EAAE,iBAAiB;AAAA,cAC1B,SAAS,MAAM;AACb,gBAAAD,EAAgBQ,CAAQ;AAAA,cAC1B;AAAA,YAAA;AAAA,UACF,IAEF,CAAA;AAAA,QAAC;AAAA,QAEP,cAAcP,EAAE,qBAAqB;AAAA,MAAA;AAAA,IAAA;AAAA,EACvC,CAEH;AAED,SACE,gBAAAU;AAAA,IAACR,EAAW;AAAA,IAAX;AAAA,MACC,aAAa;AAAA,MACb,QACE,gBAAAQ;AAAA,QAACR,EAAW;AAAA,QAAX;AAAA,UACC,OAAOF,EAAE,OAAO;AAAA,UAChB,aAAaA,EAAE,yBAAyB;AAAA,UACxC,QACEJ,IACE,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAAE,EAAE,WAAW,GAChB,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,MAKV,UAAA,gBAAAU,EAACE,KAAS,OAAOZ,EAAE,wBAAwB,GAAG,aAAW,IAAE,GAAGI,EAAA,CAAe;AAAA,IAAA;AAAA,EAAA;AAGnF;"}
@@ -1,34 +1,62 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { usePaySchedulesGetAllSuspense as S } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
3
- import { PayScheduleOverviewPresentation as m } from "./PayScheduleOverviewPresentation.js";
4
- import { componentEvents as t } from "../../../../shared/constants.js";
5
- import { ensureRequired as a } from "../../../../helpers/ensureRequired.js";
6
- function h({
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { usePaySchedulesGetAllSuspense as f } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
3
+ import { usePaySchedulesGetAssignmentsSuspense as E } from "@gusto/embedded-api/react-query/paySchedulesGetAssignments";
4
+ import { PayScheduleAssignmentType as g } from "@gusto/embedded-api/models/components/payscheduleassignment";
5
+ import { PayScheduleOverviewPresentation as _ } from "./PayScheduleOverviewPresentation.js";
6
+ import { PayScheduleCompensationOverviewPresentation as T } from "./PayScheduleCompensationOverviewPresentation.js";
7
+ import { componentEvents as i } from "../../../../shared/constants.js";
8
+ import { ensureRequired as U } from "../../../../helpers/ensureRequired.js";
9
+ function M({
7
10
  companyId: u,
8
- onEvent: e,
9
- enableAutoPilot: i,
11
+ onEvent: s,
12
+ enableAutoPilot: d,
10
13
  enableMultipleSchedules: r
11
14
  }) {
12
- const { data: n } = S({ companyId: u }), s = n.payScheduleShowResponse ?? [], o = a(s.find((d) => d.active) ?? s[0]);
13
- return /* @__PURE__ */ c(
14
- m,
15
+ const { data: S } = f({ companyId: u }), { data: h } = E({ companyId: u }), t = S.payScheduleShowResponse ?? [], n = h.payScheduleAssignment, a = (e) => {
16
+ s(i.PAY_SCHEDULE_UPDATE, { uuid: e.uuid });
17
+ }, c = (e) => {
18
+ s(i.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule: e });
19
+ }, m = () => {
20
+ s(i.PAY_SCHEDULE_MANAGE_ASSIGNMENT);
21
+ };
22
+ if (n?.type === g.HourlySalaried) {
23
+ const e = [
24
+ { compensationType: "salaried", uuid: n.salariedPayScheduleUuid },
25
+ { compensationType: "hourly", uuid: n.hourlyPayScheduleUuid }
26
+ ].flatMap(({ compensationType: y, uuid: A }) => {
27
+ const l = t.find((P) => P.uuid === A);
28
+ return l ? [{ compensationType: y, schedule: l }] : [];
29
+ });
30
+ return /* @__PURE__ */ p(
31
+ T,
32
+ {
33
+ rows: e,
34
+ enableAutoPilot: d,
35
+ enableMultipleSchedules: r,
36
+ onEditSchedule: a,
37
+ onManageAssignment: m,
38
+ onEditAutoPilot: c
39
+ }
40
+ );
41
+ }
42
+ const o = U(t.find((e) => e.active) ?? t[0]);
43
+ return /* @__PURE__ */ p(
44
+ _,
15
45
  {
16
46
  schedule: o,
17
- enableAutoPilot: i,
47
+ enableAutoPilot: d,
18
48
  enableMultipleSchedules: r,
19
49
  onEditSchedule: () => {
20
- e(t.PAY_SCHEDULE_UPDATE, { uuid: o.uuid });
21
- },
22
- onManageAssignment: () => {
23
- e(t.PAY_SCHEDULE_MANAGE_ASSIGNMENT);
50
+ a(o);
24
51
  },
52
+ onManageAssignment: m,
25
53
  onEditAutoPilot: () => {
26
- e(t.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule: o });
54
+ c(o);
27
55
  }
28
56
  }
29
57
  );
30
58
  }
31
59
  export {
32
- h as PayScheduleOverview
60
+ M as PayScheduleOverview
33
61
  };
34
62
  //# sourceMappingURL=PayScheduleOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleOverview.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleOverview.tsx"],"sourcesContent":["import { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { PayScheduleOverviewPresentation } from './PayScheduleOverviewPresentation'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/** @internal */\nexport interface PayScheduleOverviewProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n}\n\n/** @internal */\nexport function PayScheduleOverview({\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n}: PayScheduleOverviewProps) {\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n /**\n * Prefer the schedule with employees assigned to it over an unassigned leftover — relevant\n * if enableMultipleSchedules was previously on and is now off, leaving more than one schedule\n * behind. PaySchedule.tsx only routes here once it's confirmed at least one schedule exists.\n */\n const schedule = ensureRequired(schedules.find(s => s.active) ?? schedules[0])\n\n return (\n <PayScheduleOverviewPresentation\n schedule={schedule}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n onEditSchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_UPDATE, { uuid: schedule.uuid })\n }}\n onManageAssignment={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT)\n }}\n onEditAutoPilot={() => {\n onEvent(componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule })\n }}\n />\n )\n}\n"],"names":["PayScheduleOverview","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","paySchedules","usePaySchedulesGetAllSuspense","schedules","schedule","ensureRequired","s","jsx","PayScheduleOverviewPresentation","componentEvents"],"mappings":";;;;;AAeO,SAASA,EAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AACF,GAA6B;AAC3B,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAL,GAAW,GACpEM,IAAYF,EAAa,2BAA2B,CAAA,GAMpDG,IAAWC,EAAeF,EAAU,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAU,CAAC,CAAC;AAE7E,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAAJ;AAAA,MACA,iBAAAL;AAAA,MACA,yBAAAC;AAAA,MACA,gBAAgB,MAAM;AACpB,QAAAF,EAAQW,EAAgB,qBAAqB,EAAE,MAAML,EAAS,MAAM;AAAA,MACtE;AAAA,MACA,oBAAoB,MAAM;AACxB,QAAAN,EAAQW,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,iBAAiB,MAAM;AACrB,QAAAX,EAAQW,EAAgB,8BAA8B,EAAE,UAAAL,EAAA,CAAU;AAAA,MACpE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayScheduleOverview.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleOverview.tsx"],"sourcesContent":["import { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesGetAssignmentsSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAssignments'\nimport { PayScheduleAssignmentType } from '@gusto/embedded-api/models/components/payscheduleassignment'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { PayScheduleOverviewPresentation } from './PayScheduleOverviewPresentation'\nimport type { PayScheduleCompensationRow } from './PayScheduleCompensationOverviewPresentation'\nimport { PayScheduleCompensationOverviewPresentation } from './PayScheduleCompensationOverviewPresentation'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/** @internal */\nexport interface PayScheduleOverviewProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n}\n\n/** @internal */\nexport function PayScheduleOverview({\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n}: PayScheduleOverviewProps) {\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n const { data: assignments } = usePaySchedulesGetAssignmentsSuspense({ companyId })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n const assignment = assignments.payScheduleAssignment\n\n const editSchedule = (schedule: PayScheduleShow) => {\n onEvent(componentEvents.PAY_SCHEDULE_UPDATE, { uuid: schedule.uuid })\n }\n const editAutoPilot = (schedule: PayScheduleShow) => {\n onEvent(componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule })\n }\n const manageAssignment = () => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT)\n }\n\n if (assignment?.type === PayScheduleAssignmentType.HourlySalaried) {\n /**\n * A uuid the assignment references but `paySchedulesGetAll` doesn't return has no schedule\n * to name, edit, or hand to the AutoPilot dialog, so its row is dropped rather than\n * rendered half-populated.\n */\n const rows = (\n [\n { compensationType: 'salaried', uuid: assignment.salariedPayScheduleUuid },\n { compensationType: 'hourly', uuid: assignment.hourlyPayScheduleUuid },\n ] as const\n ).flatMap<PayScheduleCompensationRow>(({ compensationType, uuid }) => {\n const schedule = schedules.find(s => s.uuid === uuid)\n return schedule ? [{ compensationType, schedule }] : []\n })\n\n return (\n <PayScheduleCompensationOverviewPresentation\n rows={rows}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n onEditSchedule={editSchedule}\n onManageAssignment={manageAssignment}\n onEditAutoPilot={editAutoPilot}\n />\n )\n }\n\n /**\n * Prefer the schedule with employees assigned to it over an unassigned leftover — relevant\n * if enableMultipleSchedules was previously on and is now off, leaving more than one schedule\n * behind. PaySchedule.tsx only routes here once it's confirmed at least one schedule exists.\n */\n const schedule = ensureRequired(schedules.find(s => s.active) ?? schedules[0])\n\n return (\n <PayScheduleOverviewPresentation\n schedule={schedule}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n onEditSchedule={() => {\n editSchedule(schedule)\n }}\n onManageAssignment={manageAssignment}\n onEditAutoPilot={() => {\n editAutoPilot(schedule)\n }}\n />\n )\n}\n"],"names":["PayScheduleOverview","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","paySchedules","usePaySchedulesGetAllSuspense","assignments","usePaySchedulesGetAssignmentsSuspense","schedules","assignment","editSchedule","schedule","componentEvents","editAutoPilot","manageAssignment","PayScheduleAssignmentType","rows","compensationType","uuid","s","jsx","PayScheduleCompensationOverviewPresentation","ensureRequired","PayScheduleOverviewPresentation"],"mappings":";;;;;;;;AAoBO,SAASA,EAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AACF,GAA6B;AAC3B,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAL,GAAW,GACpE,EAAE,MAAMM,EAAA,IAAgBC,EAAsC,EAAE,WAAAP,GAAW,GAC3EQ,IAAYJ,EAAa,2BAA2B,CAAA,GACpDK,IAAaH,EAAY,uBAEzBI,IAAe,CAACC,MAA8B;AAClD,IAAAV,EAAQW,EAAgB,qBAAqB,EAAE,MAAMD,EAAS,MAAM;AAAA,EACtE,GACME,IAAgB,CAACF,MAA8B;AACnD,IAAAV,EAAQW,EAAgB,8BAA8B,EAAE,UAAAD,GAAU;AAAA,EACpE,GACMG,IAAmB,MAAM;AAC7B,IAAAb,EAAQW,EAAgB,8BAA8B;AAAA,EACxD;AAEA,MAAIH,GAAY,SAASM,EAA0B,gBAAgB;AAMjE,UAAMC,IACJ;AAAA,MACE,EAAE,kBAAkB,YAAY,MAAMP,EAAW,wBAAA;AAAA,MACjD,EAAE,kBAAkB,UAAU,MAAMA,EAAW,sBAAA;AAAA,IAAsB,EAEvE,QAAoC,CAAC,EAAE,kBAAAQ,GAAkB,MAAAC,QAAW;AACpE,YAAMP,IAAWH,EAAU,KAAK,CAAAW,MAAKA,EAAE,SAASD,CAAI;AACpD,aAAOP,IAAW,CAAC,EAAE,kBAAAM,GAAkB,UAAAN,EAAAA,CAAU,IAAI,CAAA;AAAA,IACvD,CAAC;AAED,WACE,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAL;AAAA,QACA,iBAAAd;AAAA,QACA,yBAAAC;AAAA,QACA,gBAAgBO;AAAA,QAChB,oBAAoBI;AAAA,QACpB,iBAAiBD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGvB;AAOA,QAAMF,IAAWW,EAAed,EAAU,KAAK,CAAAW,MAAKA,EAAE,MAAM,KAAKX,EAAU,CAAC,CAAC;AAE7E,SACE,gBAAAY;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,UAAAZ;AAAA,MACA,iBAAAT;AAAA,MACA,yBAAAC;AAAA,MACA,gBAAgB,MAAM;AACpB,QAAAO,EAAaC,CAAQ;AAAA,MACvB;AAAA,MACA,oBAAoBG;AAAA,MACpB,iBAAiB,MAAM;AACrB,QAAAD,EAAcF,CAAQ;AAAA,MACxB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -9,13 +9,14 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
+ import "dompurify";
13
+ import "../../../../contexts/LocaleProvider/useLocale.js";
12
14
  import "../../../../shared/constants.js";
13
15
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, u] = t("StateTaxesFormContext");
17
+ const [u, f] = t("StateTaxesFormContext");
17
18
  export {
18
- u as StateTaxesFormProvider,
19
- d as useStateTaxesForm
19
+ f as StateTaxesFormProvider,
20
+ u as useStateTaxesForm
20
21
  };
21
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -9,13 +9,14 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
+ import "dompurify";
13
+ import "../../../../contexts/LocaleProvider/useLocale.js";
12
14
  import "../../../../shared/constants.js";
13
15
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, u] = t("StateTaxesListContext");
17
+ const [u, f] = t("StateTaxesListContext");
17
18
  export {
18
- u as StateTaxesListProvider,
19
- d as useStateTaxesList
19
+ f as StateTaxesListProvider,
20
+ u as useStateTaxesList
20
21
  };
21
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -9,13 +9,14 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
+ import "dompurify";
13
+ import "../../../../contexts/LocaleProvider/useLocale.js";
12
14
  import "../../../../shared/constants.js";
13
15
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, s] = t("TaxRateManagementContext");
17
+ const [s, u] = t("TaxRateManagementContext");
17
18
  export {
18
- s as TaxRateManagementProvider,
19
- d as useTaxRateManagement
19
+ u as TaxRateManagementProvider,
20
+ s as useTaxRateManagement
20
21
  };
21
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}
@@ -9,13 +9,14 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
+ import "dompurify";
13
+ import "../../../../../../contexts/LocaleProvider/useLocale.js";
12
14
  import "../../../../../../shared/constants.js";
13
15
  import "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
16
  import { createCompoundContext as t } from "../../../../../Base/createCompoundContext.js";
16
- const [a, f] = t("DocumentListContext");
17
+ const [f, v] = t("DocumentListContext");
17
18
  export {
18
- f as DocumentListProvider,
19
- a as useDocumentList
19
+ v as DocumentListProvider,
20
+ f as useDocumentList
20
21
  };
21
22
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -1,36 +1,36 @@
1
1
  import { z as r } from "zod";
2
2
  import { buildFormSchema as I } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
3
- import { SSN_REGEX as n, NAME_REGEX as i } from "../../../../../helpers/validations.js";
3
+ import { SSN_REGEX as m, NAME_REGEX as s } from "../../../../../helpers/validations.js";
4
4
  const e = {
5
5
  REQUIRED: "REQUIRED",
6
6
  INVALID_NAME: "INVALID_NAME",
7
7
  INVALID_EMAIL: "INVALID_EMAIL",
8
8
  INVALID_SSN: "INVALID_SSN"
9
- }, E = {
10
- firstName: r.string().min(1, { message: e.REQUIRED }).regex(i, { message: e.INVALID_NAME }),
9
+ }, n = {
10
+ firstName: r.string().trim().min(1, { message: e.REQUIRED }).regex(s, { message: e.INVALID_NAME }),
11
11
  middleInitial: r.string(),
12
- lastName: r.string().min(1, { message: e.REQUIRED }).regex(i, { message: e.INVALID_NAME }),
12
+ lastName: r.string().trim().min(1, { message: e.REQUIRED }).regex(s, { message: e.INVALID_NAME }),
13
13
  email: r.email({ error: () => e.INVALID_EMAIL }),
14
14
  dateOfBirth: r.iso.date({ error: () => e.REQUIRED }),
15
- ssn: r.string({ error: () => e.REQUIRED }).refine((s) => n.test(s.replace(/\D/g, "")), {
15
+ ssn: r.string({ error: () => e.REQUIRED }).refine((i) => m.test(i.replace(/\D/g, "")), {
16
16
  message: e.INVALID_SSN
17
17
  }),
18
18
  selfOnboarding: r.boolean()
19
- }, m = {
19
+ }, E = {
20
20
  firstName: "create",
21
21
  lastName: "create",
22
22
  middleInitial: "never",
23
23
  dateOfBirth: "never",
24
24
  ssn: "never",
25
- email: (s) => s.selfOnboarding
25
+ email: (i) => i.selfOnboarding
26
26
  };
27
- function D(s = {}) {
28
- const { mode: a = "create", optionalFieldsToRequire: t, hasSsn: o = !1 } = s;
29
- return I(E, {
30
- requiredFieldsConfig: m,
27
+ function D(i = {}) {
28
+ const { mode: t = "create", optionalFieldsToRequire: a, hasSsn: o = !1 } = i;
29
+ return I(n, {
30
+ requiredFieldsConfig: E,
31
31
  requiredErrorCode: e.REQUIRED,
32
- mode: a,
33
- optionalFieldsToRequire: t,
32
+ mode: t,
33
+ optionalFieldsToRequire: a,
34
34
  fieldsWithRedactedValues: o ? ["ssn"] : []
35
35
  });
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"employeeDetailsSchema.js","sources":["../../../../../../src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { SSN_REGEX, NAME_REGEX } from '@/helpers/validations'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the employee details form schema. Map\n * these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const EmployeeDetailsErrorCodes = {\n REQUIRED: 'REQUIRED',\n INVALID_NAME: 'INVALID_NAME',\n INVALID_EMAIL: 'INVALID_EMAIL',\n INVALID_SSN: 'INVALID_SSN',\n} as const\n\n/**\n * Union of validation error code strings emitted by the employee details form\n * schema.\n *\n * @public\n */\nexport type EmployeeDetailsErrorCode =\n (typeof EmployeeDetailsErrorCodes)[keyof typeof EmployeeDetailsErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n firstName: z\n .string()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n middleInitial: z.string(),\n lastName: z\n .string()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n email: z.email({ error: () => EmployeeDetailsErrorCodes.INVALID_EMAIL }),\n dateOfBirth: z.iso.date({ error: () => EmployeeDetailsErrorCodes.REQUIRED }),\n ssn: z\n .string({ error: () => EmployeeDetailsErrorCodes.REQUIRED })\n .refine((v: string) => SSN_REGEX.test(v.replace(/\\D/g, '')), {\n message: EmployeeDetailsErrorCodes.INVALID_SSN,\n }),\n selfOnboarding: z.boolean(),\n}\n\n/**\n * Field names accepted by the employee details form.\n *\n * @public\n */\nexport type EmployeeDetailsField = Exclude<keyof typeof fieldValidators, 'selfOnboarding'>\n\n/**\n * Shape of the values managed by the employee details form.\n *\n * @public\n * @interface\n */\nexport type EmployeeDetailsFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n/** @internal */\nexport type EmployeeDetailsFormOutputs = EmployeeDetailsFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\n// Requiredness mirrors the employee create/update API contract: fields the API\n// requires on create are `'create'` (optional on update), and fields the API\n// treats as optional are `'never'`.\n//\n// `email` is value-conditional: it always applies but is only required when\n// self-onboarding is on (create and update), matching the API's \"if\n// self_onboarding is true, then email is required\" — the employee needs an\n// email to receive the invitation. A single-operand predicate keeps\n// `buildFormSchema`'s dependency-detecting Proxy accurate, and the predicate\n// drives both validation and `fieldsMetadata.isRequired` so the rendered label\n// and validation always agree. Consumers that need email required regardless of\n// self-onboarding promote it via `optionalFieldsToRequire`.\nconst requiredFieldsConfig = {\n firstName: 'create',\n lastName: 'create',\n middleInitial: 'never',\n dateOfBirth: 'never',\n ssn: 'never',\n email: data => data.selfOnboarding,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\n/**\n * Keys of optional employee details fields that can be promoted to required\n * via the hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type EmployeeDetailsOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface EmployeeDetailsSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: EmployeeDetailsOptionalFieldsToRequire\n hasSsn?: boolean\n}\n\n/** @internal */\nexport function createEmployeeDetailsSchema(options: EmployeeDetailsSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hasSsn = false } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: EmployeeDetailsErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n fieldsWithRedactedValues: hasSsn ? ['ssn'] : [],\n })\n}\n"],"names":["EmployeeDetailsErrorCodes","fieldValidators","z","NAME_REGEX","v","SSN_REGEX","requiredFieldsConfig","data","createEmployeeDetailsSchema","options","mode","optionalFieldsToRequire","hasSsn","buildFormSchema"],"mappings":";;;AAiBO,MAAMA,IAA4B;AAAA,EACvC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AACf,GAaMC,IAAkB;AAAA,EACtB,WAAWC,EACR,OAAA,EACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,eAAeE,EAAE,OAAA;AAAA,EACjB,UAAUA,EACP,OAAA,EACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,OAAOE,EAAE,MAAM,EAAE,OAAO,MAAMF,EAA0B,eAAe;AAAA,EACvE,aAAaE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAA0B,UAAU;AAAA,EAC3E,KAAKE,EACF,OAAO,EAAE,OAAO,MAAMF,EAA0B,UAAU,EAC1D,OAAO,CAACI,MAAcC,EAAU,KAAKD,EAAE,QAAQ,OAAO,EAAE,CAAC,GAAG;AAAA,IAC3D,SAASJ,EAA0B;AAAA,EAAA,CACpC;AAAA,EACH,gBAAgBE,EAAE,QAAA;AACpB,GAmCMI,IAAuB;AAAA,EAC3B,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,KAAK;AAAA,EACL,OAAO,OAAQC,EAAK;AACtB;AAsBO,SAASC,EAA4BC,IAAwC,IAAI;AACtF,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,GAAyB,QAAAC,IAAS,OAAUH;AAErE,SAAOI,EAAgBZ,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAA0B;AAAA,IAC7C,MAAAU;AAAA,IACA,yBAAAC;AAAA,IACA,0BAA0BC,IAAS,CAAC,KAAK,IAAI,CAAA;AAAA,EAAC,CAC/C;AACH;"}
1
+ {"version":3,"file":"employeeDetailsSchema.js","sources":["../../../../../../src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { SSN_REGEX, NAME_REGEX } from '@/helpers/validations'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the employee details form schema. Map\n * these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const EmployeeDetailsErrorCodes = {\n REQUIRED: 'REQUIRED',\n INVALID_NAME: 'INVALID_NAME',\n INVALID_EMAIL: 'INVALID_EMAIL',\n INVALID_SSN: 'INVALID_SSN',\n} as const\n\n/**\n * Union of validation error code strings emitted by the employee details form\n * schema.\n *\n * @public\n */\nexport type EmployeeDetailsErrorCode =\n (typeof EmployeeDetailsErrorCodes)[keyof typeof EmployeeDetailsErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n firstName: z\n .string()\n .trim()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n middleInitial: z.string(),\n lastName: z\n .string()\n .trim()\n .min(1, { message: EmployeeDetailsErrorCodes.REQUIRED })\n .regex(NAME_REGEX, { message: EmployeeDetailsErrorCodes.INVALID_NAME }),\n email: z.email({ error: () => EmployeeDetailsErrorCodes.INVALID_EMAIL }),\n dateOfBirth: z.iso.date({ error: () => EmployeeDetailsErrorCodes.REQUIRED }),\n ssn: z\n .string({ error: () => EmployeeDetailsErrorCodes.REQUIRED })\n .refine((v: string) => SSN_REGEX.test(v.replace(/\\D/g, '')), {\n message: EmployeeDetailsErrorCodes.INVALID_SSN,\n }),\n selfOnboarding: z.boolean(),\n}\n\n/**\n * Field names accepted by the employee details form.\n *\n * @public\n */\nexport type EmployeeDetailsField = Exclude<keyof typeof fieldValidators, 'selfOnboarding'>\n\n/**\n * Shape of the values managed by the employee details form.\n *\n * @public\n * @interface\n */\nexport type EmployeeDetailsFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n/** @internal */\nexport type EmployeeDetailsFormOutputs = EmployeeDetailsFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\n// Requiredness mirrors the employee create/update API contract: fields the API\n// requires on create are `'create'` (optional on update), and fields the API\n// treats as optional are `'never'`.\n//\n// `email` is value-conditional: it always applies but is only required when\n// self-onboarding is on (create and update), matching the API's \"if\n// self_onboarding is true, then email is required\" — the employee needs an\n// email to receive the invitation. A single-operand predicate keeps\n// `buildFormSchema`'s dependency-detecting Proxy accurate, and the predicate\n// drives both validation and `fieldsMetadata.isRequired` so the rendered label\n// and validation always agree. Consumers that need email required regardless of\n// self-onboarding promote it via `optionalFieldsToRequire`.\nconst requiredFieldsConfig = {\n firstName: 'create',\n lastName: 'create',\n middleInitial: 'never',\n dateOfBirth: 'never',\n ssn: 'never',\n email: data => data.selfOnboarding,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\n/**\n * Keys of optional employee details fields that can be promoted to required\n * via the hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type EmployeeDetailsOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface EmployeeDetailsSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: EmployeeDetailsOptionalFieldsToRequire\n hasSsn?: boolean\n}\n\n/** @internal */\nexport function createEmployeeDetailsSchema(options: EmployeeDetailsSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hasSsn = false } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: EmployeeDetailsErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n fieldsWithRedactedValues: hasSsn ? ['ssn'] : [],\n })\n}\n"],"names":["EmployeeDetailsErrorCodes","fieldValidators","z","NAME_REGEX","v","SSN_REGEX","requiredFieldsConfig","data","createEmployeeDetailsSchema","options","mode","optionalFieldsToRequire","hasSsn","buildFormSchema"],"mappings":";;;AAiBO,MAAMA,IAA4B;AAAA,EACvC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AACf,GAaMC,IAAkB;AAAA,EACtB,WAAWC,EACR,OAAA,EACA,OACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,eAAeE,EAAE,OAAA;AAAA,EACjB,UAAUA,EACP,OAAA,EACA,OACA,IAAI,GAAG,EAAE,SAASF,EAA0B,SAAA,CAAU,EACtD,MAAMG,GAAY,EAAE,SAASH,EAA0B,cAAc;AAAA,EACxE,OAAOE,EAAE,MAAM,EAAE,OAAO,MAAMF,EAA0B,eAAe;AAAA,EACvE,aAAaE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAA0B,UAAU;AAAA,EAC3E,KAAKE,EACF,OAAO,EAAE,OAAO,MAAMF,EAA0B,UAAU,EAC1D,OAAO,CAACI,MAAcC,EAAU,KAAKD,EAAE,QAAQ,OAAO,EAAE,CAAC,GAAG;AAAA,IAC3D,SAASJ,EAA0B;AAAA,EAAA,CACpC;AAAA,EACH,gBAAgBE,EAAE,QAAA;AACpB,GAmCMI,IAAuB;AAAA,EAC3B,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,KAAK;AAAA,EACL,OAAO,OAAQC,EAAK;AACtB;AAsBO,SAASC,EAA4BC,IAAwC,IAAI;AACtF,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,GAAyB,QAAAC,IAAS,OAAUH;AAErE,SAAOI,EAAgBZ,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAA0B;AAAA,IAC7C,MAAAU;AAAA,IACA,yBAAAC;AAAA,IACA,0BAA0BC,IAAS,CAAC,KAAK,IAAI,CAAA;AAAA,EAAC,CAC/C;AACH;"}
@@ -18,13 +18,12 @@ import "@gusto/embedded-api/models/errors/httpclienterrors";
18
18
  import { formatNumberAsCurrency as B } from "../../../helpers/formattedStrings.js";
19
19
  import "../../../shared/constants.js";
20
20
  import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
21
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
22
21
  import { useI18n as D } from "../../../i18n/I18n.js";
23
22
  import { NumberInputField as E } from "../../Common/Fields/NumberInputField/NumberInputField.js";
24
23
  const T = C.object({
25
24
  netPay: C.number().positive()
26
25
  });
27
- function ue({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
26
+ function pe({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
28
27
  D("Payroll.GrossUpModal");
29
28
  const { t: r } = z("Payroll.GrossUpModal"), { Modal: x, Heading: u, Text: i, Button: c, Alert: f } = V(), { baseSubmitHandler: y } = k(), A = F(null), [l, m] = o(null), [h, d] = o(null), [M, g] = o(!1), [N, v] = o(!1), s = R({
30
29
  resolver: H(T),
@@ -114,6 +113,6 @@ function ue({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
114
113
  );
115
114
  }
116
115
  export {
117
- ue as GrossUpModal
116
+ pe as GrossUpModal
118
117
  };
119
118
  //# sourceMappingURL=GrossUpModal.js.map