@xframework-ca-test/cli 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/AIVision-0025192f.js +4 -0
- package/dist/ui/assets/AccountDetails-42610e44.js +1 -0
- package/dist/ui/assets/AccountDetails-5b4cd3f7.js +1 -0
- package/dist/ui/assets/AccountServices-f68f471d.js +1 -0
- package/dist/ui/assets/AccountsList-262479cf.js +1 -0
- package/dist/ui/assets/ActionLink-9db8b1c2.js +1 -0
- package/dist/ui/assets/AdaptableCard-3d1e1f96.js +1 -0
- package/dist/ui/assets/AddAccount-2cd72664.js +1 -0
- package/dist/ui/assets/AddEditFile-6ae10d57.js +1 -0
- package/dist/ui/assets/AddEditTranslation-3812ff0f.js +1 -0
- package/dist/ui/assets/AiApiLogList-1eac39b7.js +1 -0
- package/dist/ui/assets/AiCa-2e90495f.js +1 -0
- package/dist/ui/assets/Alert-59d09a99.js +1 -0
- package/dist/ui/assets/ApiService-df126758.js +1 -0
- package/dist/ui/assets/AppLandingPage-afcea727.js +4 -0
- package/dist/ui/assets/AuditLogsList-ea37686b.js +1 -0
- package/dist/ui/assets/Auth0Callback-00729568.js +1 -0
- package/dist/ui/assets/BarCodes-4ff49536.js +1 -0
- package/dist/ui/assets/BlankLayout-7085ab88.js +1 -0
- package/dist/ui/assets/{BrainServices-a4bb698e.js → BrainServices-4cb93af5.js} +1 -1
- package/dist/ui/assets/CalendarList-689ed66a.js +2 -0
- package/dist/ui/assets/CalendarList-f4a9aa21.css +8 -0
- package/dist/ui/assets/CategoryList-a6d01041.js +1 -0
- package/dist/ui/assets/CategoryList-c03f4259.js +1 -0
- package/dist/ui/assets/ChatContainer-fec7b84d.js +1 -0
- package/dist/ui/assets/ChatsList-4b3194e4.js +1 -0
- package/dist/ui/assets/Check-af681a30.js +1 -0
- package/dist/ui/assets/CheckInVideo-aa9f50b2.js +6 -0
- package/dist/ui/assets/ClassicLayout-a9866742.js +2 -0
- package/dist/ui/assets/CompanyList-94119d71.js +1 -0
- package/dist/ui/assets/{CompanyService-1bf7c3c8.js → CompanyService-491a9cc1.js} +1 -1
- package/dist/ui/assets/{Component-59e4c14b.js → Component-566d01e0.js} +1 -1
- package/dist/ui/assets/ConfirmDialog-2838a642.js +1 -0
- package/dist/ui/assets/ContactDetails-c9dc0ed1.js +1 -0
- package/dist/ui/assets/{ContactService-92281a90.js → ContactService-8afcaeb7.js} +1 -1
- package/dist/ui/assets/ContactsList-5b06c9b8.js +1 -0
- package/dist/ui/assets/CountiesList-18b23cf7.js +1 -0
- package/dist/ui/assets/CountyDetails-ea024f14.js +1 -0
- package/dist/ui/assets/CourseDetails-8a5f8d63.js +1 -0
- package/dist/ui/assets/CourseList-3564fec3.js +1 -0
- package/dist/ui/assets/{CourseService-f0dc3bf1.js → CourseService-29ad460c.js} +1 -1
- package/dist/ui/assets/CreateSignature-c22e4a71.js +7 -0
- package/dist/ui/assets/{CustomerInfoField-fff65ace.js → CustomerInfoField-4bf880e2.js} +1 -1
- package/dist/ui/assets/DeckedLayout-610fe851.js +1 -0
- package/dist/ui/assets/DensitySelector-5d2e901f.js +1 -0
- package/dist/ui/assets/{DepartmentServices-3d56a9e7.js → DepartmentServices-a53e998b.js} +1 -1
- package/dist/ui/assets/{DigitalSignature-fff42e33.js → DigitalSignature-69eaf80c.js} +1 -1
- package/dist/ui/assets/{DocumemtManagementService-6501a5c1.js → DocumemtManagementService-85cde51a.js} +1 -1
- package/dist/ui/assets/DocumentActivity-bc938c61.js +1 -0
- package/dist/ui/assets/DocumentLayout-a12982d7.js +1 -0
- package/dist/ui/assets/DocumentList2-9c8c6284.js +23 -0
- package/dist/ui/assets/DocumentLists-1cdaae06.js +1 -0
- package/dist/ui/assets/DocumentUserSigned-f7371fc5.js +7 -0
- package/dist/ui/assets/DocumentsList-3b25907c.js +1 -0
- package/dist/ui/assets/DoubleSidedImage-b4bd3915.js +1 -0
- package/dist/ui/assets/{Drawer-949c18c6.js → Drawer-4f97e662.js} +1 -1
- package/dist/ui/assets/DynamicDashboard-0a41d287.js +1 -0
- package/dist/ui/assets/{DynamicTablesService-963fe77b.js → DynamicTablesService-6aa57f52.js} +1 -1
- package/dist/ui/assets/EditAccount-e42d66af.js +1 -0
- package/dist/ui/assets/EditLead-c8c9760a.js +1 -0
- package/dist/ui/assets/FaqItems-25d66543.js +6 -0
- package/dist/ui/assets/{FileManagementServices-25fd64c5.js → FileManagementServices-19b47568.js} +1 -1
- package/dist/ui/assets/{FolderOpen-88bfcc74.js → FolderOpen-7b0e2ac0.js} +1 -1
- package/dist/ui/assets/FormContainer-9a52b9e8.js +1 -0
- package/dist/ui/assets/{GeneralSettings-a7f805e8.js → GeneralSettings-c8c2f051.js} +5 -5
- package/dist/ui/assets/GenericPage-81e41302.js +1 -0
- package/dist/ui/assets/GridMapDetails-38f50b3c.js +1 -0
- package/dist/ui/assets/HorizontalMenuContent-fd559f4d.js +1 -0
- package/dist/ui/assets/{ImportFile-3f60d715.js → ImportFile-026b1771.js} +1 -1
- package/dist/ui/assets/{InlineSignaturePad-09c06619.js → InlineSignaturePad-f5630151.js} +1 -1
- package/dist/ui/assets/InvoicesList-9723bc5a.js +1 -0
- package/dist/ui/assets/{KeyVaultService-874d83fe.js → KeyVaultService-9608f0ff.js} +1 -1
- package/dist/ui/assets/LeadDetails-8cdaae0e.js +1 -0
- package/dist/ui/assets/{LeadSourceService-e46fa85e.js → LeadSourceService-cf71ea64.js} +1 -1
- package/dist/ui/assets/LeadsList-1ec20a77.js +1 -0
- package/dist/ui/assets/Logo-dd6f7656.js +1 -0
- package/dist/ui/assets/MapView-dcab88b3.js +1 -0
- package/dist/ui/assets/MarketingPage-998d10b0.js +4 -0
- package/dist/ui/assets/MenuNew-79fc95f3.js +1 -0
- package/dist/ui/assets/{MenuTable-c2c65021.js → MenuTable-f69e0fe4.js} +1 -1
- package/dist/ui/assets/MessageInput-07fcc5cb.js +21 -0
- package/dist/ui/assets/MessagesList-21d2b034.js +1 -0
- package/dist/ui/assets/ModernLayout-05af7cf7.js +1 -0
- package/dist/ui/assets/{NoData-8c485a3a.js → NoData-4cc4af03.js} +1 -1
- package/dist/ui/assets/Notify-8fb74d48.js +1 -0
- package/dist/ui/assets/OpportunitiesList-2f96958f.js +1 -0
- package/dist/ui/assets/OpportunityDetails-aaec3200.js +1 -0
- package/dist/ui/assets/{OpportunityServices-fa4fabfd.js → OpportunityServices-c4510dd2.js} +1 -1
- package/dist/ui/assets/OpportunityStatus-ea3b5ee2.js +1 -0
- package/dist/ui/assets/PageBreadcrumb-cf54a6e9.js +1 -0
- package/dist/ui/assets/{Password-d9294711.js → Password-21414dc6.js} +1 -1
- package/dist/ui/assets/PasswordInput-333c82ca.js +1 -0
- package/dist/ui/assets/{PreferenceService-75bf9db6.js → PreferenceService-d2b3e003.js} +1 -1
- package/dist/ui/assets/Profile-8c9fd2fc.js +1 -0
- package/dist/ui/assets/{ReportEditor-8880f57e.js → ReportEditor-4e4f6d53.js} +3 -3
- package/dist/ui/assets/{ReportViewer-9f1080f7.js → ReportViewer-616d3cfc.js} +30 -30
- package/dist/ui/assets/RoleEdit-a076ea85.js +1 -0
- package/dist/ui/assets/RoleForm-47691f91.js +1 -0
- package/dist/ui/assets/{RoleNew-49fadb16.js → RoleNew-e86a1513.js} +1 -1
- package/dist/ui/assets/{RoleService-7008da2c.js → RoleService-2f9ed883.js} +1 -1
- package/dist/ui/assets/ScheduleCycle-0ae23631.js +1 -0
- package/dist/ui/assets/{ScheduleService-7228f0a3.js → ScheduleService-41a88c41.js} +1 -1
- package/dist/ui/assets/ScreenList-8f58150b.js +1 -0
- package/dist/ui/assets/Settings-fc91c9d2.js +2 -0
- package/dist/ui/assets/{SetupWizard-4172e377.js → SetupWizard-d1363582.js} +1 -1
- package/dist/ui/assets/SimpleLayout-77cfb778.js +1 -0
- package/dist/ui/assets/StackedSideLayout-2f1ee9d1.js +1 -0
- package/dist/ui/assets/StickyFooter-3e569b80.js +1 -0
- package/dist/ui/assets/SupportRequets-0ecd4ab8.js +1 -0
- package/dist/ui/assets/{Switcher-c8648037.js → Switcher-e2fba588.js} +1 -1
- package/dist/ui/assets/TimeLogApprovalDataList-7b49a432.js +1 -0
- package/dist/ui/assets/TimeLogApprovalList-78cab2b6.js +1 -0
- package/dist/ui/assets/TimeLogList-592b29aa.js +1 -0
- package/dist/ui/assets/{TimeLogService-cd7b2f61.js → TimeLogService-83166cbc.js} +1 -1
- package/dist/ui/assets/TimesheetsList-d1520efb.js +1 -0
- package/dist/ui/assets/TranslationList-88d7d5d7.js +1 -0
- package/dist/ui/assets/TweaksPanel-bc10bc47.js +112 -0
- package/dist/ui/assets/{Upload-fb34ce03.js → Upload-be937eb6.js} +4 -4
- package/dist/ui/assets/UserEdit-1f8208f3.js +1 -0
- package/dist/ui/assets/UserForm-e9b56aff.js +1 -0
- package/dist/ui/assets/{UserNew-b36c342c.js → UserNew-31fa258f.js} +1 -1
- package/dist/ui/assets/{UserService-047aef51.js → UserService-1b93ceb0.js} +1 -1
- package/dist/ui/assets/ViewTimeLogForApproval-ae077050.js +1 -0
- package/dist/ui/assets/Views-1359da48.js +1 -0
- package/dist/ui/assets/WelcomeList-dc8666ec.js +9 -0
- package/dist/ui/assets/WidgetLayoutsService-49730609.js +1 -0
- package/dist/ui/assets/{WrapperCell-a7981b07.js → WrapperCell-3d5592cf.js} +1 -1
- package/dist/ui/assets/actioncell-6b5ebd6c.js +1 -0
- package/dist/ui/assets/{ar-3c9c213e.js → ar-fb4f0ea8.js} +1 -1
- package/dist/ui/assets/calendarList-ac838a86.js +2 -0
- package/dist/ui/assets/{cjs-162261df.js → cjs-998de55c.js} +1 -1
- package/dist/ui/assets/createSvgIcon-aba65987.js +1 -0
- package/dist/ui/assets/documentsList-4e2e061e.js +1 -0
- package/dist/ui/assets/{es-be649ede.js → es-cd58d3ad.js} +1 -1
- package/dist/ui/assets/{esm-f306d015.js → esm-c40433f8.js} +1 -1
- package/dist/ui/assets/gridList-e1571c87.js +1 -0
- package/dist/ui/assets/gridMapTable-d95f9c70.js +1 -0
- package/dist/ui/assets/{index-f6be0390.js → index-00a8eb64.js} +1 -1
- package/dist/ui/assets/index-04438b6b.js +22 -0
- package/dist/ui/assets/index-058738bc.js +1 -0
- package/dist/ui/assets/{index-e4c6057f.js → index-0b08ce18.js} +1 -1
- package/dist/ui/assets/index-0d730815.js +4 -0
- package/dist/ui/assets/index-0efcf53a.js +1 -0
- package/dist/ui/assets/index-0f432250.js +1 -0
- package/dist/ui/assets/{index-cebd880b.js → index-0fd6e996.js} +1 -1
- package/dist/ui/assets/{index-49a94e54.js → index-11297f4a.js} +1 -1
- package/dist/ui/assets/index-14c1c1d7.js +1 -0
- package/dist/ui/assets/index-15e1f4be.js +1 -0
- package/dist/ui/assets/index-16586c21.js +1 -0
- package/dist/ui/assets/index-19346c14.js +1 -0
- package/dist/ui/assets/{index-16bb10a6.js → index-1dc2b9d2.js} +1 -1
- package/dist/ui/assets/index-211fbe21.js +1 -0
- package/dist/ui/assets/index-23e16bff.js +1 -0
- package/dist/ui/assets/index-27aef8b5.js +1 -0
- package/dist/ui/assets/{index-36228db5.js → index-289b3fd9.js} +1 -1
- package/dist/ui/assets/{index-a22a3546.js → index-2dae59b1.js} +1 -1
- package/dist/ui/assets/index-353fd6dd.js +1 -0
- package/dist/ui/assets/{index-ea125a16.js → index-359d245d.js} +1 -1
- package/dist/ui/assets/{index-c62ac197.js → index-3b5ce20a.js} +70 -62
- package/dist/ui/assets/index-3b929ba4.js +34 -0
- package/dist/ui/assets/index-42e3a337.js +1 -0
- package/dist/ui/assets/index-44b6de3a.js +1 -0
- package/dist/ui/assets/index-46d3ca9a.js +7 -0
- package/dist/ui/assets/{index-e3cc723f.js → index-49016ad0.js} +1 -1
- package/dist/ui/assets/index-51132258.js +1 -0
- package/dist/ui/assets/{index-dc103f22.js → index-52963879.js} +1 -1
- package/dist/ui/assets/{index-fcc1c999.js → index-533fd007.js} +1 -1
- package/dist/ui/assets/index-59ec468b.js +13 -0
- package/dist/ui/assets/index-5e2d5279.js +1 -0
- package/dist/ui/assets/{index-d17da176.js → index-62f95885.js} +1 -1
- package/dist/ui/assets/index-659c6412.js +1 -0
- package/dist/ui/assets/index-6873dfc3.js +1 -0
- package/dist/ui/assets/index-69a68d9e.js +1 -0
- package/dist/ui/assets/index-6a6902c7.js +1 -0
- package/dist/ui/assets/index-7596c6bb.js +1 -0
- package/dist/ui/assets/{index-47dcc43a.js → index-8045c5f0.js} +1 -1
- package/dist/ui/assets/{index-b028e652.js → index-8677acd1.js} +1 -1
- package/dist/ui/assets/{index-42e65911.js → index-88c52b97.js} +1 -1
- package/dist/ui/assets/index-89cfefab.js +1 -0
- package/dist/ui/assets/{index-bea4c3dc.js → index-8c0643fd.js} +1 -1
- package/dist/ui/assets/index-8d5b6a1f.js +1 -0
- package/dist/ui/assets/index-8d5d70f9.js +1 -0
- package/dist/ui/assets/{index-9b41371d.js → index-91505016.js} +1 -1
- package/dist/ui/assets/{index-ffc00dbb.js → index-92314073.js} +1 -1
- package/dist/ui/assets/index-985cf3f6.js +1 -0
- package/dist/ui/assets/index-a14e51de.js +1 -0
- package/dist/ui/assets/index-a733f80b.js +1 -0
- package/dist/ui/assets/index-a84d5808.js +1 -0
- package/dist/ui/assets/index-acac6006.js +1 -0
- package/dist/ui/assets/index-b0ef7ac3.js +1 -0
- package/dist/ui/assets/index-b6ef5984.js +1 -0
- package/dist/ui/assets/{index-fc9071e0.js → index-bd4edda3.js} +1 -1
- package/dist/ui/assets/{index-0ec72c4b.js → index-c29b8474.js} +1 -1
- package/dist/ui/assets/index-c88c7790.js +19 -0
- package/dist/ui/assets/index-ce89a95e.css +7 -0
- package/dist/ui/assets/index-d221d69e.js +1 -0
- package/dist/ui/assets/{index-f1576468.js → index-d33facae.js} +1 -1
- package/dist/ui/assets/index-e46c57a5.js +1 -0
- package/dist/ui/assets/index-e863817c.js +1 -0
- package/dist/ui/assets/index-f4af2342.js +1 -0
- package/dist/ui/assets/{index-77e820d0.js → index-fc9f8c4b.js} +1 -1
- package/dist/ui/assets/{index-ec2010d2.js → index-ff23edc5.js} +1 -1
- package/dist/ui/assets/{index.esm-70ab539c.js → index.esm-b2d342b5.js} +1 -1
- package/dist/ui/assets/liveLocation-8e0bb2f3.js +1 -0
- package/dist/ui/assets/{mapView-ab35acaa.js → mapView-c8063ed6.js} +1 -1
- package/dist/ui/assets/modeuls-setup-4b06843c.js +1 -0
- package/dist/ui/assets/{permissionHoc-6f787658.js → permissionHoc-0818bfb0.js} +1 -1
- package/dist/ui/assets/{react-21134174.js → react-12ddbe48.js} +1 -1
- package/dist/ui/assets/{react-4d5dc208.js → react-61e0b284.js} +1 -1
- package/dist/ui/assets/{strongPassword-bbec776a.js → strongPassword-6bc8786f.js} +1 -1
- package/dist/ui/assets/{styles-0608350c.js → styles-b7ae7bf6.js} +1 -1
- package/dist/ui/assets/{tableV2-4d1c9fd2.js → tableV2-99c808c0.js} +1 -1
- package/dist/ui/assets/tableV3-24eed052.js +1 -0
- package/dist/ui/assets/ticketRequestDetails-8b299fbd.js +1 -0
- package/dist/ui/assets/{useDidUpdate-25c4d4ed.js → useDidUpdate-de319a18.js} +1 -1
- package/dist/ui/assets/{useDrop-02b0e5d7.js → useDrop-8f0d11a7.js} +1 -1
- package/dist/ui/assets/useFilteredData-e8fad668.js +1 -0
- package/dist/ui/assets/{usePermission-d94b4984.js → usePermission-4689548c.js} +1 -1
- package/dist/ui/assets/{vendor-charts-eccea5d1.js → vendor-charts-4be0b5ab.js} +1 -1
- package/dist/ui/assets/{vendor-codemirror-c8203b49.js → vendor-codemirror-1a1216c9.js} +11 -11
- package/dist/ui/assets/{vendor-devex-33a39e11.js → vendor-devex-4076ffeb.js} +2 -2
- package/dist/ui/assets/{vendor-excel-ee8fc4e5.js → vendor-excel-3b3553df.js} +1 -1
- package/dist/ui/assets/{vendor-i18n-2fcb1983.js → vendor-i18n-b89304ef.js} +1 -1
- package/dist/ui/assets/vendor-mui-98daa63f.js +185 -0
- package/dist/ui/assets/{vendor-pdf-b2a5d8b1.js → vendor-pdf-3c29882d.js} +1 -1
- package/dist/ui/assets/withHeaderItem-df2cc5d9.js +1 -0
- package/dist/ui/assets/{zh-cn-1881e930.js → zh-cn-13c6c696.js} +1 -1
- package/dist/ui/config.js +16 -20
- package/dist/ui/index.html +9 -9
- package/dist/ui/manifest.json +2 -2
- package/index.bundle.js +23 -9
- package/package.json +1 -1
- package/dist/ui/assets/AIVision-4f515575.js +0 -4
- package/dist/ui/assets/AccountDetails-2b42d262.js +0 -1
- package/dist/ui/assets/AccountDetails-492dee8f.js +0 -1
- package/dist/ui/assets/AccountServices-62599aae.js +0 -1
- package/dist/ui/assets/AccountsList-fe7cb5f9.js +0 -1
- package/dist/ui/assets/ActionLink-33e476e1.js +0 -1
- package/dist/ui/assets/AdaptableCard-df7695d6.js +0 -1
- package/dist/ui/assets/AddAccount-a05910e8.js +0 -1
- package/dist/ui/assets/AddEditFile-063c229b.js +0 -1
- package/dist/ui/assets/AddEditTranslation-43beae49.js +0 -1
- package/dist/ui/assets/AiApiLogList-a488921d.js +0 -1
- package/dist/ui/assets/AiCa-9c1b25b2.js +0 -1
- package/dist/ui/assets/Alert-7dfbd254.js +0 -1
- package/dist/ui/assets/ApiService-2b99757f.js +0 -1
- package/dist/ui/assets/AppLandingPage-3956cf0c.js +0 -4
- package/dist/ui/assets/AuditLogsList-7a2ce37d.js +0 -1
- package/dist/ui/assets/Auth0Callback-b943f19f.js +0 -1
- package/dist/ui/assets/BarCodes-17ed5da4.js +0 -1
- package/dist/ui/assets/BlankLayout-2f6e1153.js +0 -1
- package/dist/ui/assets/CalendarList-25834ddb.css +0 -11
- package/dist/ui/assets/CalendarList-72739043.js +0 -2
- package/dist/ui/assets/CategoryList-9f82e9a3.js +0 -1
- package/dist/ui/assets/CategoryList-c97891e7.js +0 -1
- package/dist/ui/assets/ChatContainer-4a38b179.js +0 -1
- package/dist/ui/assets/ChatsList-6c2c3e2f.js +0 -1
- package/dist/ui/assets/Check-71f21a49.js +0 -1
- package/dist/ui/assets/CheckInVideo-cb5fa9a2.js +0 -6
- package/dist/ui/assets/ClassicLayout-7d09e5ac.js +0 -1
- package/dist/ui/assets/CompanyList-9532f511.js +0 -1
- package/dist/ui/assets/ConfirmDialog-3202eb3d.js +0 -1
- package/dist/ui/assets/ContactDetails-3b70919b.js +0 -1
- package/dist/ui/assets/ContactsList-e9ac0fa3.js +0 -1
- package/dist/ui/assets/CountiesList-6ad338a5.js +0 -1
- package/dist/ui/assets/CountyDetails-22d4bc89.js +0 -1
- package/dist/ui/assets/CourseDetails-18040b49.js +0 -1
- package/dist/ui/assets/CourseList-e502f89d.js +0 -1
- package/dist/ui/assets/CreateSignature-375d191b.js +0 -7
- package/dist/ui/assets/DeckedLayout-909ac220.js +0 -1
- package/dist/ui/assets/DensitySelector-a2c1c68f.js +0 -1
- package/dist/ui/assets/DocumentActivity-d63dacec.js +0 -1
- package/dist/ui/assets/DocumentLayout-637075fd.js +0 -1
- package/dist/ui/assets/DocumentList2-518d2fa4.js +0 -23
- package/dist/ui/assets/DocumentLists-2da9ff88.js +0 -1
- package/dist/ui/assets/DocumentUserSigned-27bfa6e6.js +0 -7
- package/dist/ui/assets/DocumentsList-9f56db71.js +0 -1
- package/dist/ui/assets/DoubleSidedImage-ae98733b.js +0 -1
- package/dist/ui/assets/DynamicDashboard-6f177244.js +0 -1
- package/dist/ui/assets/EditAccount-1c1a8318.js +0 -1
- package/dist/ui/assets/EditLead-cc38d2a2.js +0 -1
- package/dist/ui/assets/FaqItems-c1c85af7.js +0 -6
- package/dist/ui/assets/FormContainer-91c2b0e4.js +0 -1
- package/dist/ui/assets/GenericPage-25a5d92a.js +0 -1
- package/dist/ui/assets/GridMapDetails-851a5781.js +0 -1
- package/dist/ui/assets/HorizontalMenuContent-96da38e1.js +0 -1
- package/dist/ui/assets/InvoicesList-8e66a112.js +0 -1
- package/dist/ui/assets/LeadDetails-ad63b3df.js +0 -1
- package/dist/ui/assets/LeadsList-bd7d9804.js +0 -1
- package/dist/ui/assets/Logo-3f3c9ee6.js +0 -1
- package/dist/ui/assets/MapView-afd1c913.js +0 -1
- package/dist/ui/assets/MarketingPage-89a860b1.js +0 -4
- package/dist/ui/assets/MenuEdit-d6e0d64c.js +0 -1
- package/dist/ui/assets/MessageInput-6dc83761.js +0 -21
- package/dist/ui/assets/MessagesList-966b69c5.js +0 -1
- package/dist/ui/assets/ModernLayout-03f30574.js +0 -1
- package/dist/ui/assets/Notify-bb3ce372.js +0 -1
- package/dist/ui/assets/OpportunitiesList-62eb34f6.js +0 -1
- package/dist/ui/assets/OpportunityDetails-356a8580.js +0 -1
- package/dist/ui/assets/OpportunityStatus-fa8108ea.js +0 -1
- package/dist/ui/assets/PasswordInput-8619a9df.js +0 -1
- package/dist/ui/assets/Profile-9104808b.js +0 -1
- package/dist/ui/assets/RoleEdit-98a6410b.js +0 -1
- package/dist/ui/assets/RoleForm-cc251eba.js +0 -1
- package/dist/ui/assets/ScheduleCycle-22c8e809.js +0 -1
- package/dist/ui/assets/ScreenList-9f7afa1c.js +0 -1
- package/dist/ui/assets/SidePanelContent-6b13836f.js +0 -1
- package/dist/ui/assets/SimpleLayout-d5445c0d.js +0 -2
- package/dist/ui/assets/StackedSideLayout-51127dc5.js +0 -1
- package/dist/ui/assets/StickyFooter-5b934274.js +0 -1
- package/dist/ui/assets/SupportRequets-be6542a9.js +0 -1
- package/dist/ui/assets/TimeLogApprovalDataList-c16d8bae.js +0 -1
- package/dist/ui/assets/TimeLogApprovalList-f6a75a20.js +0 -1
- package/dist/ui/assets/TimeLogList-ea288cce.js +0 -1
- package/dist/ui/assets/TimesheetsList-4a20e96c.js +0 -1
- package/dist/ui/assets/TranslationList-7a989333.js +0 -1
- package/dist/ui/assets/UserEdit-87262ea5.js +0 -1
- package/dist/ui/assets/UserForm-31fdd3b3.js +0 -1
- package/dist/ui/assets/ViewTimeLogForApproval-43b24a1a.js +0 -1
- package/dist/ui/assets/Views-74429e81.js +0 -1
- package/dist/ui/assets/WelcomeList-6c693eae.js +0 -9
- package/dist/ui/assets/actioncell-17e12e21.js +0 -1
- package/dist/ui/assets/calendarList-511b4d8f.js +0 -2
- package/dist/ui/assets/createSvgIcon-c5fc0d04.js +0 -1
- package/dist/ui/assets/documentsList-ac2c91ec.js +0 -1
- package/dist/ui/assets/dxicons-4c1b2089.ttf +0 -0
- package/dist/ui/assets/dxicons-ade3c9ed.woff2 +0 -0
- package/dist/ui/assets/dxicons-b4cd1226.woff +0 -0
- package/dist/ui/assets/gridList-cb9a14b1.js +0 -1
- package/dist/ui/assets/gridMapTable-c19770a8.js +0 -1
- package/dist/ui/assets/index-1d60e514.js +0 -1
- package/dist/ui/assets/index-26466d9d.js +0 -1
- package/dist/ui/assets/index-289cfedb.js +0 -1
- package/dist/ui/assets/index-2ce5b358.js +0 -1
- package/dist/ui/assets/index-307ce6d7.js +0 -1
- package/dist/ui/assets/index-36ba4ea7.js +0 -1
- package/dist/ui/assets/index-3f02e05a.js +0 -1
- package/dist/ui/assets/index-44662933.js +0 -13
- package/dist/ui/assets/index-51ee35f9.js +0 -1
- package/dist/ui/assets/index-54372d82.js +0 -1
- package/dist/ui/assets/index-569a9d2c.js +0 -1
- package/dist/ui/assets/index-62de659f.js +0 -13
- package/dist/ui/assets/index-6589dd2d.js +0 -1
- package/dist/ui/assets/index-6b6d0f06.js +0 -1
- package/dist/ui/assets/index-6c618440.js +0 -1
- package/dist/ui/assets/index-785ad361.js +0 -1
- package/dist/ui/assets/index-7df8779c.js +0 -1
- package/dist/ui/assets/index-82c9477e.js +0 -1
- package/dist/ui/assets/index-8ab45286.js +0 -1
- package/dist/ui/assets/index-8c229076.css +0 -7
- package/dist/ui/assets/index-a205cfed.js +0 -34
- package/dist/ui/assets/index-a23f9c87.js +0 -1
- package/dist/ui/assets/index-a455424a.js +0 -1
- package/dist/ui/assets/index-a4f78ee1.js +0 -1
- package/dist/ui/assets/index-aaad94c2.js +0 -1
- package/dist/ui/assets/index-b1b6b0f6.js +0 -1
- package/dist/ui/assets/index-c1f92742.js +0 -4
- package/dist/ui/assets/index-c2088808.js +0 -1
- package/dist/ui/assets/index-cbc29fa8.js +0 -1
- package/dist/ui/assets/index-cd2b7d32.js +0 -1
- package/dist/ui/assets/index-cf3804f1.js +0 -19
- package/dist/ui/assets/index-d0ef2cc2.js +0 -1
- package/dist/ui/assets/index-d1145737.js +0 -7
- package/dist/ui/assets/index-d58fb185.js +0 -1
- package/dist/ui/assets/index-d5b5a7e1.js +0 -1
- package/dist/ui/assets/index-daeff047.js +0 -1
- package/dist/ui/assets/index-ded3b055.js +0 -1
- package/dist/ui/assets/index-ede23a2b.js +0 -1
- package/dist/ui/assets/index-f8144346.js +0 -1
- package/dist/ui/assets/index-fd68b510.js +0 -1
- package/dist/ui/assets/index-fe3409ae.js +0 -1
- package/dist/ui/assets/liveLocation-646eef95.js +0 -1
- package/dist/ui/assets/modeuls-setup-402f891e.js +0 -1
- package/dist/ui/assets/tableV3-3d2f4952.js +0 -1
- package/dist/ui/assets/ticketRequestDetails-f78147f7.js +0 -1
- package/dist/ui/assets/vendor-mui-69397583.js +0 -185
- package/dist/ui/menudata/menus.json +0 -606
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{A as E}from"./AdaptableCard-3d1e1f96.js";import{r as m,f as G}from"./vendor-react-ece1c85f.js";import{a as J,b as K,u as x,t as M,c as Q,g as V,r as W,s as X}from"./index-985cf3f6.js";import{a0 as h,a4 as w,B as N,E as S,F as A,k as P,D as Y,ax as D,l as ee,d as te}from"./index-3b5ce20a.js";import{A as se,T as b}from"./actioncell-6b5ebd6c.js";import{D as ne}from"./tableV2-99c808c0.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as I}from"./Drawer-4f97e662.js";import{a as g,F as ie}from"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{S as oe}from"./StickyFooter-3e569b80.js";import{d as y,c as re,a as k,F as le,b as ae}from"./index.esm-b2d342b5.js";import{a as ce}from"./index-0b08ce18.js";import{C as de}from"./ConfirmDialog-2838a642.js";import{u as pe}from"./usePermission-4689548c.js";import{P as me}from"./PageBreadcrumb-cf54a6e9.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./FileSaver.min-20f3f13a.js";import"./DensitySelector-5d2e901f.js";import"./NoData-4cc4af03.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";const ue=({touched:s,errors:i,values:a,setFieldValue:p})=>{const c=m.useRef(null);return m.useEffect(()=>{const o=()=>{if(!c.current)return;const r=new window.google.maps.places.Autocomplete(c.current,{types:["address"],componentRestrictions:{country:"us"}});r.addListener("place_changed",()=>{var u;const n=r.getPlace();let d={};(u=n.address_components)==null||u.forEach(l=>{l.types.includes("locality")&&(d.city=l.long_name),l.types.includes("administrative_area_level_1")&&(d.state=l.short_name),l.types.includes("postal_code")&&(d.zip=l.long_name)}),p("address",n.name||""),p("city",d.city||""),p("state",d.state||""),p("zip",d.zip||"")})};if(window.google&&window.google.maps)o();else{const r=setInterval(()=>{window.google&&window.google.maps&&(o(),clearInterval(r))},500);return()=>clearInterval(r)}},[]),e.jsxs(E,{className:"mb-4",children:[e.jsx(g,{label:"Entity Name",asterisk:!0,invalid:i.name&&s.name,errorMessage:i.name,children:e.jsx(y,{name:"name",component:h,placeholder:"Enter entity name"})}),e.jsx(g,{label:"Address",asterisk:!0,invalid:i.address&&s.address,errorMessage:i.address,children:e.jsx(y,{name:"address",children:({field:o})=>e.jsx(h,{...o,ref:c,placeholder:"Search address"})})}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsx(g,{label:"City",invalid:i.city&&s.city,errorMessage:i.city,children:e.jsx(y,{name:"city",component:h,placeholder:"City"})}),e.jsx(g,{label:"State",invalid:i.state&&s.state,errorMessage:i.state,children:e.jsx(y,{name:"state",component:h,placeholder:"State"})}),e.jsx(g,{label:"Zip",invalid:i.zip&&s.zip,errorMessage:i.zip,children:e.jsx(y,{name:"zip",component:h,placeholder:"Zip"})})]}),e.jsx("div",{className:"mt-6",children:e.jsx(y,{name:"trainingPortal",children:({field:o,value:r})=>e.jsx(w,{...o,onChange:n=>p("trainingPortal",n),checked:a==null?void 0:a.trainingPortal,children:"Training Portal"})})}),e.jsx("div",{className:"mt-6",children:e.jsx(y,{name:"electionMobileApp",children:({field:o,value:r})=>e.jsx(w,{...o,onChange:n=>p("electionMobileApp",n),checked:a==null?void 0:a.electionMobileApp,children:"Election Mobile App Management"})})})]})},fe=re().shape({name:k().required("name is required"),address:k().required("Address is required")}),L=m.forwardRef(({initialData:s,onFormSubmit:i,onDiscard:a},p)=>e.jsx(le,{innerRef:p,initialValues:{name:(s==null?void 0:s.name)??"",address:(s==null?void 0:s.address)??"",city:(s==null?void 0:s.city)??"",state:(s==null?void 0:s.state)??"",zip:(s==null?void 0:s.zip)??"",trainingPortal:(s==null?void 0:s.trainingPortal)??!1,electionMobileApp:(s==null?void 0:s.electionMobileApp)??!1},validationSchema:fe,onSubmit:(c,{setSubmitting:o})=>{i(c,o)},children:({touched:c,errors:o,isSubmitting:r,setFieldValue:n,values:d})=>e.jsx(ae,{children:e.jsxs(ie,{children:[e.jsx(ue,{touched:c,errors:o,values:d,setFieldValue:n}),e.jsx(oe,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(N,{size:"sm",type:"button",onClick:()=>a==null?void 0:a(),children:"Discard"}),e.jsx(N,{size:"sm",variant:"solid",loading:r,icon:e.jsx(ce,{}),type:"submit",children:"Save Entity"})]})})]})})}));L.displayName="CountyForm";const z=({onDrawerClose:s,course:i,refetch:a})=>{const p=async n=>{let d={title:n==null?void 0:n.name,address:n==null?void 0:n.address,city:(n==null?void 0:n.city)??"",state:(n==null?void 0:n.state)??"",zip:(n==null?void 0:n.zip)??"",trainingPortal:n==null?void 0:n.trainingPortal,electionMobileAppManagement:n==null?void 0:n.electionMobileApp};return i!=null&&i.id?await J(i.id,d):await K(d)},c=()=>{a()},o=async(n,d)=>{d(!0),p(n).then(u=>{u.success&&(s(),c(),S.push(e.jsx(A,{title:"Success",type:"success",duration:2500,children:i?"Entity updated successfully":"Entity created successfully"}),{placement:"top-center"}))}).catch(u=>{var C;console.error("course - error",u),c();const l=(C=u.response)==null?void 0:C.data;d(!1),S.push(e.jsx(A,{title:"Error",type:"danger",duration:2500,children:(l==null?void 0:l.message)||"Failed to save course"}),{placement:"top-center"})})},r=()=>{s()};return e.jsx(L,{type:i?"edit":"new",initialData:i,onFormSubmit:o,onDiscard:r})},ye=({fetchData:s})=>{const i=P(),a=x(r=>r.CountyData.data.deleteConfirmation),p=x(r=>r.CountyData.data.selectedRowData),c=()=>{i(M(!1))},o=async()=>{i(M(!1)),await Q(p.id)&&(s(),S.push(e.jsx(A,{title:"Deleted",type:"success",duration:2500,children:"Entity Successfully Deleted"}),{placement:"top-center"}))};return e.jsx(de,{isOpen:a,type:"danger",title:"Delete Entity",confirmButtonColor:"red-600",onClose:c,onRequestClose:c,onCancel:c,onConfirm:o,children:e.jsx("p",{children:"Are you sure you want to delete this Entity? This action cannot be undone."})})};Y("CountyData",W);const We=()=>{const[s,i]=m.useState([]);m.useState(!1),m.useState(!1);const[a,p]=m.useState(!1),[c,o]=m.useState(!1),[r,n]=m.useState(),[d,u]=m.useState(null),l=pe("Entities"),[C,he]=m.useState({name:"",company:"",status:"",registrationDate:null}),[ge,O]=m.useState(!1),q=()=>O(!0),_=()=>{p(!0)},v=()=>{p(!1),u(null)},T=G(),F=P();x(t=>t.CountyData.data.filterData),x(t=>t.CountyData.data.loading);const B=x(t=>{var f,R;return(R=(f=t==null?void 0:t.CountyData)==null?void 0:f.data)==null?void 0:R.CountyList});m.useState(!1),D.getState(),ee(),m.useEffect(()=>{j()},[C]);const j=()=>{const t=V();F(t)},U=t=>{T("/app/entity/"+t.id)},Z=t=>{navigator.clipboard.writeText(t),S.push(e.jsx(A,{title:"Copied!",type:"success",duration:1500,children:"copied to clipboard"}),{placement:"top-center"})},$=(t,f)=>{f===b.view&&U(t),f===b.edit&&(n(t.id),u({...t,name:t==null?void 0:t.title,electionMobileApp:t==null?void 0:t.electionMobileAppManagement}),o(!0)),f===b.delete&&(F(M(!0)),F(X(t))),f===b.affiliate&&Z(t==null?void 0:t.affiliateLink)},H=[{dataField:"Action",caption:"Action",width:"130",cellRender:t=>e.jsx("div",{"data-cname":"Action",className:"flex justify-start items-center",children:e.jsx(se,{row:t==null?void 0:t.data,actions:{view:!0,edit:l==null?void 0:l.isEdit,delete:l==null?void 0:l.isDelete},buttonClick:$})})},{dataField:"title",caption:"Name"},{dataField:"address",caption:"Address"},{dataField:"city",caption:"City"},{dataField:"state",caption:"State"},{dataField:"zip",caption:"ZIP"},{dataField:"createdByUserName",caption:"Created By"},{dataField:"createdDate",caption:"Created On",dataType:"date",format:"MM/dd/yyyy"},{dataField:"isActive",caption:"Status",cellRender:t=>t!=null&&t.value?e.jsx("div",{"data-cname":"Status",children:" Active "}):e.jsx("div",{"data-cname":"Status",children:" Inactive"})}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx(me,{items:[{label:"Entities"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Entities"}),e.jsx("div",{className:"flex flex-col lg:flex-row lg:items-center",children:e.jsx(N,{onClick:()=>_(),block:!0,variant:"solid",size:"sm",icon:e.jsx(te,{}),children:"Add Entity"})})]})]}),e.jsx(E,{className:"m-6 h-full bg-transparent",bodyClass:"h-full",children:e.jsx(E,{className:"borderless",children:e.jsx(ne,{columns:H,tableName:"County-table",data:B||[],height:"calc(100vh - 270px)",defaultHiddenColumn:[],fetchData:()=>{},id_label:"$id",selectedRowId:s,setSelectedRowId:i,setFilterValues:()=>{},filterValues:[],identity:"Lead-Listing",isColumnReorderReq:!0,setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"Lead-Listing-table",handleSearch:()=>{},isColumnResizing:!0,isPaginationReq:!0,isSelectionReq:!1,isFilterReq:!0,openFilter:q})})}),e.jsx(I,{title:"Add Entity",isOpen:a,onClose:v,onRequestClose:v,portalClassName:"w30",children:e.jsx(z,{onDrawerClose:v,refetch:j})}),e.jsx(I,{title:"Edit Entity",isOpen:c,onClose:()=>o(!1),onRequestClose:()=>o(!1),portalClassName:"w30",children:e.jsx(z,{onDrawerClose:()=>o(!1),course:d,refetch:j})}),e.jsx(ye,{fetchData:j})]})};export{We as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{D as T,k as F,B as W,d as q,ai as R,E as K,F as H,al as N,aD as J,et as Q}from"./index-3b5ce20a.js";import{A as o}from"./AdaptableCard-3d1e1f96.js";import{j as X,f as Z,r as t}from"./vendor-react-ece1c85f.js";import{P as k}from"./PageBreadcrumb-cf54a6e9.js";import{r as P,u as M,d as I,e as ee}from"./index-985cf3f6.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as S}from"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import{T as se,a as ae,b as E,c as te}from"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{C as le}from"./ConfirmDialog-2838a642.js";import{C as re}from"./tableV3-24eed052.js";import{A as ie,T as b}from"./actioncell-6b5ebd6c.js";import{U as ne}from"./UserNew-31fa258f.js";import{U as de}from"./UserEdit-1f8208f3.js";import{c as ce}from"./UserService-1b93ceb0.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-c8063ed6.js";import"./esm-c40433f8.js";import"./lodash-306e3f66.js";import"./DensitySelector-5d2e901f.js";import"./NoData-4cc4af03.js";import"./UserForm-e9b56aff.js";import"./index-b0ef7ac3.js";import"./StickyFooter-3e569b80.js";import"./index.esm-b2d342b5.js";import"./index-fc9f8c4b.js";import"./RoleService-2f9ed883.js";import"./PasswordInput-333c82ca.js";import"./index-88c52b97.js";import"./index-0fd6e996.js";import"./AccountServices-f68f471d.js";import"./ContactService-8afcaeb7.js";import"./index-0b08ce18.js";import"./strongPassword-6bc8786f.js";import"./validationPatterns-77446c46.js";import"./DoubleSidedImage-b4bd3915.js";T("CountyData",P);const oe=m=>{var w;let{id:a}=X();Z(),F();const[p,d]=t.useState(!1),[c,r]=t.useState([]),[u,i]=t.useState(!1),[n,j]=t.useState("Add"),[f,y]=t.useState(null),[B,C]=t.useState(!1),[O,v]=t.useState(""),[D,L]=t.useState(""),Y="Users",g=M(s=>{var l;return((l=s.auth.session)==null?void 0:l.permission)||[]});let U=((w=g==null?void 0:g.filter(s=>(s==null?void 0:s.defaultMenuName)===Y))==null?void 0:w[0])||{isDelete:!1,isEdit:!1,isManage:!1,isView:!1};const V={edit:U.isEdit,archive:U.isDelete,loginAsUser:!1},h=async()=>{var s;try{let l=await I(a);r((s=l==null?void 0:l.data)==null?void 0:s.$values)}catch{r([])}};t.useEffect(()=>{a&&h()},[a]);const A=s=>{d(!1)},_=s=>{window.open({}.VITE_CUSTOMER_PORTAL_URL+"/loginAsUser/"+s,"_blank","noreferrer")},G=(s,l)=>{l===b.edit&&(d(!0),L(s.id)),l===b.loginAsUser&&_(s.id),l===b.delete&&(v(s==null?void 0:s.id),y(s),C(!0))},$=[{dataField:"Action",caption:"Action",allowSorting:!1,allowFiltering:!1,allowSearch:!1,cellRender:s=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(ie,{row:s==null?void 0:s.data,actions:V,buttonClick:G})})},{dataField:"firstName",caption:"First Name",cellRender:s=>e.jsx("div",{"data-cname":"First Name",children:s.data.firstName})},{dataField:"lastName",caption:"Last Name",cellRender:s=>e.jsx("div",{"data-cname":"Last Name",children:s.data.lastName})},{dataField:"email",caption:"Email",cellRender:s=>e.jsx("div",{"data-cname":"Email",children:s.data.email})},{dataField:"phoneNumber",caption:"Phone No",cellRender:s=>e.jsx("div",{"data-cname":"Phone No",children:s.data.phoneNumber})},{dataField:"role",caption:"Role",cellRender:s=>e.jsx("div",{"data-cname":"Role",children:s.data.role})},{dataField:"createdByName",caption:"Created By",cellRender:s=>e.jsx("div",{"data-cname":"Created By",children:s.data.createdByName})},{dataField:"createdDate",caption:"Created On",width:"230",dataType:"date",format:"dd-MM-yyyy",cellRender:s=>{const l=R(s.value).format("MM/DD/YYYY");return e.jsx("div",{"data-cname":"Created On",children:l})}}],x=()=>{v(null),C(!1),y(null)},z=async()=>{const s=await ce(O);x(),s&&K.push(e.jsx(H,{title:"Archived",type:"success",duration:2500,children:"User Successfully Archived"}),{placement:"top-center"}),h()};return e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"h-full pt-0 bg-transparent",bodyClass:"h-full",children:e.jsxs(o,{className:"h-full bg-transparent",children:[e.jsxs("div",{className:"topbar border-gray-200 border-b dark:bg-[#292f3c] dark:text-white mb-2",children:[e.jsx(k,{items:[{label:"Entities"},{label:"Users"}]}),e.jsxs("div",{className:"lg:flex pb-2 items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Users"}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center",children:[e.jsx(W,{block:!0,variant:"solid",size:"sm",icon:e.jsx(q,{}),onClick:()=>i(!0),children:"Add User "}),e.jsx(S,{title:`${n} User`,isOpen:u,onClose:()=>i(!1),portalClassName:"w30",children:e.jsx(ne,{accountId:a,footerWidth:"w30",onClose:()=>i(!1),onAddNew:()=>{h(),i(!1)}})})]})]})]}),e.jsx(re,{tableName:"County-Users",dataSource:c,height:"calc(100vh - 400px)",columns:$,keyExpr:"$id",stateStorageKey:"documents"})]})}),e.jsx(le,{isOpen:B,type:"danger",title:"Archive User",confirmButtonColor:"red-600",onClose:x,onRequestClose:x,onCancel:x,onConfirm:z,children:e.jsx("p",{children:"Are you sure you want to archive this Users?"})}),D&&e.jsx(S,{title:"Edit User",isOpen:p,onClose:A,portalClassName:"w30",children:e.jsx(de,{footerWidth:"w30",userId:D,isAccountList:!0,onDrawerClose:A,fetchData:h})})]})};T("CountyData",P);const ns=()=>{const[m,a]=t.useState(""),p=F(),[d,c]=t.useState("Users"),r=location.pathname.substring(location.pathname.lastIndexOf("/")+1),u=M(n=>{var j,f;return((f=(j=n==null?void 0:n.CountyData)==null?void 0:j.data)==null?void 0:f.CountyDetails)||{}}),i=t.useCallback(()=>{if(r){const n=ee({id:r});p(n),a(r)}},[]);return t.useEffect(()=>{i()},[r]),t.useState("Vertical View"),t.useState(!0),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx(k,{items:[{label:"Entities"},{label:"Entity Details"}]}),e.jsx("div",{className:"lg:flex items-center justify-between",children:e.jsx("h3",{className:"mb-4 lg:mb-0 text-white",children:"Entity Details"})})]}),e.jsx(o,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:e.jsx(me,{programId:m,customerInformation:u,fetchData:i,currentTab:d,setCurrentTab:c})})]})},me=m=>{const{customerInformation:a,fetchData:p,programId:d,currentTab:c,setCurrentTab:r}=m;return e.jsxs(e.Fragment,{children:[e.jsx(N,{id:"hs_view",className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4",children:[e.jsxs("div",{className:"md:col-span-6 col-span-1",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Entity Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 pt-4",children:[e.jsx("div",{className:"md:col-span-4 col-span-1",children:e.jsxs("p",{className:"text-gray-700 dark:text-gray-200 text-sm space-y-1",children:[e.jsx("div",{className:"font-bold",children:a==null?void 0:a.title}),e.jsxs("div",{children:["Created Date –"," ",R(a==null?void 0:a.createdDate).format("MM-DD-YYYY")]})]})}),e.jsx("div",{className:"hidden md:block md:col-span-2"}),e.jsxs("div",{className:"md:col-span-6 col-span-1",children:[e.jsx("span",{className:"font-bold",children:"Address"}),e.jsxs("p",{className:"text-gray-700 dark:text-gray-200 text-sm",children:[(a==null?void 0:a.address)??"--",", ",a==null?void 0:a.city,", ",a==null?void 0:a.state,", ",a==null?void 0:a.zip]})]})]})]}),e.jsx("div",{className:"md:col-span-6 col-span-1",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs(N,{className:"p-4 bg-gray-100",children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Access"}),e.jsx("p",{className:"text-sm",children:a!=null&&a.trainingPortal?"Training Portal":""}),e.jsx("p",{className:"text-sm",children:a!=null&&a.electionMobileAppManagement?"Election Mobile App":""})]}),e.jsxs(N,{className:"p-4 bg-gray-100",children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Created By"}),e.jsx("p",{className:"text-sm",children:(a==null?void 0:a.createdByUser)??"--"})]})]})})]})}),e.jsx(se,{className:"opportunity-tabs",variant:"pill",value:c,onChange:r,children:e.jsxs(o,{className:"p-2 my-2",children:[e.jsxs(ae,{className:"flex flex-col sm:flex-row flex-wrap gap-2",children:[e.jsx(E,{icon:e.jsx(J,{}),className:"w-full sm:w-auto text-center",value:"Users",children:"Users"}),e.jsx(E,{icon:e.jsx(Q,{}),className:"w-full sm:w-auto text-center",value:"Tab 2",children:"Tab 2"})]}),e.jsx(o,{className:"borderless",children:e.jsx("div",{className:"grid grid-cols-12 gap-1 pt-2",children:e.jsx("div",{className:"col-span-12",children:e.jsxs(te,{value:"Users",children:[" ",e.jsx(oe,{})]})})})})]})})]})};export{me as CustomerSingleView,ns as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{bz as Ze,bA as Ve,cH as ce,cF as le,B as q,dk as es,a0 as U,r as ss,E as f,F as j,D as Pe,k as Fe,d as ts,al as se,aM as rs,dl as is,ai as ns}from"./index-3b5ce20a.js";import{A as de}from"./AdaptableCard-3d1e1f96.js";import{r as y}from"./vendor-react-ece1c85f.js";import{r as Oe,u as oe,a as os,b as cs}from"./index-62f95885.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as ae}from"./Drawer-4f97e662.js";import{F as Ae,a as $}from"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import{T as ls,a as ds,b as Ne,c as Ie}from"./index-289b3fd9.js";import{U as as}from"./Upload-be937eb6.js";import{C as De}from"./ConfirmDialog-2838a642.js";import{u as qe,S as Re,v as Ue,a as Me}from"./sortable.esm-0625cd17.js";import{C as $e,u as ps,a as us,P as xs,D as hs,c as ms}from"./core.esm-4386752a.js";import{c as te,a as z,F as pe,b as ue,d as D,h as ke,i as fs}from"./index.esm-b2d342b5.js";import{S as xe}from"./StickyFooter-3e569b80.js";import{s as js}from"./index-8045c5f0.js";import{g as ys,h as gs,i as bs,j as vs,k as ws,l as Ss,m as Cs,n as Ns,o as Ee,p as Is,q as Ms,r as ks}from"./CourseService-29ad460c.js";import{u as Es}from"./usePermission-4689548c.js";import{P as ze}from"./PageBreadcrumb-cf54a6e9.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";import"./ApiService-df126758.js";const Ps=({m:t,section:i,onEditMaterial:n,onDeleteMaterial:g})=>{const{attributes:o,listeners:d,setNodeRef:a,transform:x,transition:C}=qe({id:t.id,data:{type:"material",sectionId:i.id}}),b={transform:$e.Transform.toString(x),transition:C};return e.jsxs("div",{ref:a,style:b,...o,...d,className:"flex items-center pl-10 pr-6 py-3 mt-1 gap-4 bg-gray-50",children:[e.jsx(es,{size:22,className:"text-custom-500 shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"truncate text-[14px] leading-5 font-semibold",children:t.title})}),e.jsx("span",{className:"text-sm text-gray-600 shrink-0",children:t.duration}),e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-custom-600 hover:bg-custom-700 cursor-pointer",onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),n(t,i.id)},children:e.jsx(ce,{className:"text-white",size:14})}),e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-red-700 hover:bg-custom-700 cursor-pointer",onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),g(t.id,i.id)},children:e.jsx(le,{className:"text-white",size:14})})]})},Fs=({section:t,index:i,onAddMaterial:n,onEdit:g,onDelete:o,onEditMaterial:d,onDeleteMaterial:a,permissions:x,expanded:C,onToggleExpand:b})=>{var w;const{attributes:v,listeners:S,setNodeRef:T,transform:P,transition:u}=qe({id:t.id,data:{type:"section"}}),N={transform:$e.Transform.toString(P),transition:u},M=((w=t.materials)==null?void 0:w.$values)||[];return e.jsxs("div",{ref:T,style:N,className:"mb-2 border border-gray-200 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 bg-white hover:bg-gray-50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{...v,...S,className:"cursor-move p-1 text-gray-400 hover:text-gray-600",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("circle",{cx:"3",cy:"3",r:"1"}),e.jsx("circle",{cx:"3",cy:"8",r:"1"}),e.jsx("circle",{cx:"3",cy:"13",r:"1"}),e.jsx("circle",{cx:"8",cy:"3",r:"1"}),e.jsx("circle",{cx:"8",cy:"8",r:"1"}),e.jsx("circle",{cx:"8",cy:"13",r:"1"}),e.jsx("circle",{cx:"13",cy:"3",r:"1"}),e.jsx("circle",{cx:"13",cy:"8",r:"1"}),e.jsx("circle",{cx:"13",cy:"13",r:"1"})]})}),e.jsx("h4",{className:"font-semibold text-gray-900 text-[16px] truncate cursor-pointer",onClick:l=>{l.stopPropagation(),b()},children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-white-600",children:[e.jsx("span",{children:t==null?void 0:t.calculatedDuration}),e.jsx("div",{className:"cursor-pointer p-1",onClick:l=>{l.stopPropagation(),b()},children:C?e.jsx(Ze,{}):e.jsx(Ve,{})}),(x==null?void 0:x.isEdit)&&e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-custom-600 hover:bg-custom-700 cursor-pointer",onClick:l=>{l.stopPropagation(),g(t)},children:e.jsx(ce,{className:"text-white",size:16})}),(x==null?void 0:x.isDelete)&&e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-red-700 hover:bg-red-800 cursor-pointer",onClick:l=>{l.stopPropagation(),o(t.id)},children:e.jsx(le,{className:"text-white",size:16})}),(x==null?void 0:x.isEdit)&&e.jsx(q,{size:"sm",variant:"solid",onClick:l=>{l.stopPropagation(),n(t)},children:"+ Add Material"})]})]}),C&&e.jsx("div",{id:"subModule",className:"divide-y border-t border-gray-200",children:M.length?e.jsx(Re,{items:M.map(l=>l.id),strategy:Ue,children:M.map(l=>e.jsx(Ps,{m:l,section:t,onEditMaterial:d,onDeleteMaterial:a},l.id))}):e.jsx("p",{className:"px-10 py-3 text-sm text-gray-400",children:"No materials added yet."})})]})},Os=te().shape({title:z().required("Title is required"),description:z().required("Description is required"),duration:z().required("Duration is required").matches(/^([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$/,"Duration must be in HH:MM:SS format")}),As=({initialValues:t,onClose:i,onSubmit:n,open:g})=>e.jsx(ae,{title:t?"Edit Section":"Add Section",isOpen:g,onClose:i,onRequestClose:i,portalClassName:"w30",children:e.jsx(pe,{initialValues:t||{id:Date.now().toString(),title:"",description:"",duration:""},validationSchema:Os,onSubmit:o=>n(o),enableReinitialize:!0,children:({errors:o,touched:d})=>e.jsx(ue,{children:e.jsxs(Ae,{children:[e.jsx($,{label:"Title",invalid:!!o.title&&!!d.title,errorMessage:o.title,children:e.jsx(D,{name:"title",component:U,placeholder:"Enter title"})}),e.jsx($,{label:"Description",invalid:!!o.description&&!!d.description,errorMessage:o.description,children:e.jsx(D,{name:"description",component:U,placeholder:"Enter description"})}),e.jsx($,{label:"Duration",invalid:!!o.duration&&!!d.duration,errorMessage:o.duration,children:e.jsx(D,{name:"duration",component:U,placeholder:"e.g. 01:30:00"})}),e.jsxs(xe,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[e.jsx(q,{type:"button",onClick:i,children:"Cancel"}),e.jsx(q,{type:"submit",variant:"solid",children:t?"Update":"Save"})]})]})})})}),Ds=te().shape({sectionId:te().required("Section is required"),title:z().required("Title is required"),duration:z().required("Duration is required"),description:z(),video:ke().required("Video or Vimeo link is required").test("is-valid-video","Must be a valid Vimeo link or a video file",t=>t&&typeof t=="string"?/^(https?:\/\/)?(www\.)?(vimeo\.com\/(manage\/videos\/)?\d+|player\.vimeo\.com\/video\/\d+)(\?.*)?$/.test(t):!1),resources:fs().of(te().shape({title:z().when(["file","link"],{is:(t,i)=>!!t||!!i,then:t=>t.required("Title is required for this resource"),otherwise:t=>t.notRequired()}),link:z().nullable(),file:ke().nullable(),filePreview:z().nullable()}))});function qs(t){const i=Math.floor(t/3600),n=Math.floor(t%3600/60),g=Math.floor(t%60);return[i.toString().padStart(2,"0"),n.toString().padStart(2,"0"),g.toString().padStart(2,"0")].join(":")}const Rs=({sectionOptions:t,defaultSection:i,onClose:n,onSubmit:g,isOpen:o,loading:d,initialValues:a})=>{var S,T,P;const[x,C]=y.useState(null);async function b(u,N){const M=u.split("/").pop();try{const w=await ys(M),l=w==null?void 0:w.data;if(l!=null&&l.embedUrl){if(C(l==null?void 0:l.embedUrl),l!=null&&l.duration){const p=qs(l==null?void 0:l.durationInSeconds);N("duration",p)}}else console.log("No playable URL found. Check privacy settings.")}catch(w){console.error("Failed to fetch playback URL",w)}}const v=a?{id:a==null?void 0:a.id,sectionId:{value:a.sectionId,label:(S=t.find(u=>u.id===a.sectionId))==null?void 0:S.title},title:a.title||"",duration:a.duration||"",description:a.description||"",video:a.videoUrl||"",resources:((P=(T=a.resources)==null?void 0:T.$values)==null?void 0:P.map(u=>({title:u.title,link:u.resourceUrl,file:u.resourceFile,resourceId:u.resourceId,filePreview:u.resourceFile?`${u.resourceFile}`:""})))||[]}:{sectionId:i!=null&&i.id?{label:i==null?void 0:i.title,value:i==null?void 0:i.id}:"",title:"",duration:"",description:"",video:"",resources:[]};return e.jsx(ae,{title:a?"Edit Course Material":"Add Course Material",isOpen:o,onClose:n,onRequestClose:n,portalClassName:"w30",children:e.jsx(pe,{enableReinitialize:!0,initialValues:v,validationSchema:Ds,onSubmit:u=>{var N;return g((N=u==null?void 0:u.sectionId)==null?void 0:N.value,u)},children:({errors:u,touched:N,setFieldValue:M,values:w})=>e.jsx(ue,{children:e.jsxs(Ae,{className:"pb-32",children:[e.jsx($,{label:"Select Section",invalid:!!u.sectionId&&!!N.sectionId,errorMessage:u.sectionId,children:e.jsx(D,{name:"sectionId",children:({field:l,form:p})=>e.jsx(ss,{field:l,form:p,isDisabled:!!(i!=null&&i.id),options:t.map(m=>({value:m.id,label:m.title})),name:"sectionId",onChange:m=>{p.setFieldValue(l.name,m)}})})}),e.jsx($,{label:"Title",invalid:!!u.title&&!!N.title,errorMessage:u.title,children:e.jsx(D,{name:"title",component:U,placeholder:"Enter title"})}),e.jsxs($,{label:"Vimeo Link",invalid:!!u.video&&!!N.video,errorMessage:u.video,children:[e.jsx("div",{className:"flex flex-col gap-2",children:e.jsx(D,{name:"video",component:U,placeholder:"Paste Vimeo link",onBlur:l=>b(l.target.value,M)})}),(x||w.video)&&e.jsx("div",{className:"mt-2 aspect-video",children:e.jsx(js,{src:x||w.video,width:"100%",height:"300px",controls:!0})})]}),e.jsx($,{label:"Duration",invalid:!!u.duration&&!!N.duration,errorMessage:u.duration,children:e.jsx(D,{name:"duration",component:U,placeholder:"e.g. 01:30:00"})}),e.jsx($,{label:"Description",children:e.jsx(D,{name:"description",component:U,textArea:!0,placeholder:"Enter description"})}),e.jsxs($,{label:"Resources",children:[w.resources.map((l,p)=>e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(D,{name:`resources[${p}].title`,component:U,placeholder:"Resource title*"}),e.jsx(D,{name:`resources[${p}].link`,component:U,placeholder:"Resource link"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(as,{accept:".pdf,.doc,.docx,.xls,.xlsx,.xlsm,.png,.ppt,.PPT,.pptx,.PPTX",cropNeeded:!1,onChange:m=>{if(m&&m[0]){const X=m[0],J=URL.createObjectURL(X);M(`resources[${p}].file`,X),M(`resources[${p}].filePreview`,J)}}}),(l==null?void 0:l.filePreview)&&e.jsx("a",{href:l==null?void 0:l.filePreview,target:"_blank",rel:"noopener noreferrer",className:"text-custom-600 underline text-sm",children:"View"})]}),e.jsx(q,{type:"button",size:"sm",variant:"danger",onClick:()=>{const m=[...w.resources];m.splice(p,1),M("resources",m)},children:"Remove"})]},p)),e.jsx(q,{size:"sm",type:"button",className:"mt-2",onClick:()=>M("resources",[...w.resources,{title:"",link:"",file:null}]),children:"+ Add Resource"})]}),e.jsxs(xe,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[e.jsx(q,{type:"button",onClick:n,children:"Cancel"}),e.jsx(q,{type:"submit",loading:d,variant:"solid",children:a?"Update":"Save"})]})]})})})})},Us=({courseId:t,fetchData:i,initialSection:n=[]})=>{const g=ps(us(xs)),[o,d]=y.useState(n),[a,x]=y.useState(null),[C,b]=y.useState(!1),[v,S]=y.useState(!1),[T,P]=y.useState(!1),[u,N]=y.useState(!1),M=Es("Course"),[w,l]=y.useState(!1),[p,m]=y.useState(null),[X,J]=y.useState(!1),[L,he]=y.useState(null),[me,fe]=y.useState({}),je=(r,s)=>{he({type:r,id:s}),J(!0)},Te=async()=>{var c,h;if(!L)return;const{type:r,id:s}=L;try{let k;r==="section"?k=await gs(s):k=await bs(s),k.success&&(i(),f.push(e.jsx(j,{title:"Success",type:"success",children:r==="section"?"Section deleted successfully":"Material deleted successfully"}),{placement:"top-center"}))}catch(k){f.push(e.jsx(j,{title:"Error",type:"danger",children:((h=(c=k==null?void 0:k.response)==null?void 0:c.data)==null?void 0:h.message)||`Failed to delete ${L.type}`}),{placement:"top-center"})}J(!1),he(null)},Le=async r=>{var s,c;try{(await vs(t,r)).success&&(b(!1),i(),f.push(e.jsx(j,{title:"Success",type:"success",duration:2500,children:"Course section created successfully"}),{placement:"top-center"}))}catch(h){f.push(e.jsx(j,{title:"Error",type:"danger",duration:2500,children:((c=(s=h==null?void 0:h.response)==null?void 0:s.data)==null?void 0:c.message)||"Failed to add Sections"}),{placement:"top-center"})}};y.useEffect(()=>{d(n)},[n]);const Be=async(r,s)=>{var c,h,k;P(!0);try{const F={title:s==null?void 0:s.title,duration:s==null?void 0:s.duration,videoUrl:s==null?void 0:s.video,description:s==null?void 0:s.description,resources:((c=s==null?void 0:s.resources)==null?void 0:c.map(O=>({title:O.title,resourceUrl:O.link,file:O.resourceFile,resourceFile:O.file})))||[]};(await ws(r,F)).success&&(S(!1),i(),f.push(e.jsx(j,{title:"Success",type:"success",duration:2500,children:"Course Material added successfully"}),{placement:"top-center"}))}catch(F){f.push(e.jsx(j,{title:"Error",type:"danger",duration:2500,children:((k=(h=F==null?void 0:F.response)==null?void 0:h.data)==null?void 0:k.message)||"Failed to add Material"}),{placement:"top-center"})}P(!1)},He=async(r,s)=>{var c,h,k;P(!0);try{const F={title:s==null?void 0:s.title,duration:s==null?void 0:s.duration,videoUrl:s==null?void 0:s.video,description:s==null?void 0:s.description,resources:((c=s==null?void 0:s.resources)==null?void 0:c.map(O=>({title:O.title,resourceUrl:O.link,resourceFile:(O==null?void 0:O.file)||null,resourceId:O.resourceId})))||[]};(await Ss(p==null?void 0:p.id,F)).success&&(S(!1),l(!1),m(null),i(),f.push(e.jsx(j,{title:"Success",type:"success",duration:2500,children:"Course Material updated successfully"}),{placement:"top-center"}))}catch(F){f.push(e.jsx(j,{title:"Error",type:"danger",duration:2500,children:((k=(h=F==null?void 0:F.response)==null?void 0:h.data)==null?void 0:k.message)||"Failed to update Material"}),{placement:"top-center"})}P(!1)},Ye=async r=>{var s,c;try{(await Cs(r.id,r)).success&&(b(!1),N(!1),i(),f.push(e.jsx(j,{title:"Success",type:"success",children:"Section updated successfully"}),{placement:"top-center"}))}catch(h){f.push(e.jsx(j,{title:"Error",type:"danger",children:((c=(s=h==null?void 0:h.response)==null?void 0:s.data)==null?void 0:c.message)||"Failed to update section"}),{placement:"top-center"})}},_e=(r,s)=>{m({...r,sectionId:s}),l(!0),S(!0)},Ge=async r=>{var c;let s={courseId:r.courseId,items:(c=r==null?void 0:r.newOrder)==null?void 0:c.map(h=>({...h,displayOrder:h==null?void 0:h.order}))};return await Ns(s)},Xe=async r=>{let s={sourceSectionId:r.sectionId,destinationSectionId:r.sectionId,newSourceOrder:r==null?void 0:r.newOrder.map(c=>({...c,displayOrder:c==null?void 0:c.order})),newDestOrder:r==null?void 0:r.newOrder.map(c=>({...c,displayOrder:c==null?void 0:c.order}))};return await Ee(s)},Je=async r=>{let s={sourceSectionId:r.sourceSectionId,destinationSectionId:r==null?void 0:r.destinationSectionId,newSourceOrder:r==null?void 0:r.newSourceOrder.map(c=>({...c,displayOrder:c==null?void 0:c.order})),newDestOrder:r==null?void 0:r.newDestOrder.map(c=>({...c,displayOrder:c==null?void 0:c.order}))};return await Ee(s)},Ke=async r=>{var F,re,O,ye,ge,be,ve,we,Se,Ce;const{active:s,over:c}=r;if(!c||s.id===c.id)return;const h=(F=s.data.current)==null?void 0:F.type,k=(re=c.data.current)==null?void 0:re.type;if(h==="section"){const K=o.findIndex(E=>E.id===s.id),_=o.findIndex(E=>E.id===c.id);if(K===-1||_===-1)return;const B=o.map((E,I)=>({id:E.id,order:I})),H=o,R=Me(o,K,_),Q=R.map((E,I)=>({id:E.id,order:I}));d(R);const G={courseId:t,movedSectionId:String(s.id),previousOrder:B,newOrder:Q,sourceIndex:K,destinationIndex:_};try{(await Ge(G)).success?(f.push(e.jsx(j,{title:"Success",type:"success",children:"Sections reordered successfully"}),{placement:"top-center"}),await i()):(d(H),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to reorder sections"}),{placement:"top-center"}))}catch{d(H),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to reorder sections"}),{placement:"top-center"})}return}if(h==="material"){const K=(O=s.data.current)==null?void 0:O.sectionId,_=o;let B,H;if(k==="material"){B=(ye=c.data.current)==null?void 0:ye.sectionId;const I=o.findIndex(A=>A.id===B);H=(((be=(ge=o[I])==null?void 0:ge.materials)==null?void 0:be.$values)||[]).findIndex(A=>A.id===c.id)}else if(k==="section"){B=String(c.id);const I=o.findIndex(A=>A.id===B);H=(((we=(ve=o[I])==null?void 0:ve.materials)==null?void 0:we.$values)||[]).length}else return;const R=o.findIndex(I=>I.id===K),Q=o.findIndex(I=>I.id===B);if(R===-1||Q===-1)return;const G=[...((Se=o[R].materials)==null?void 0:Se.$values)||[]],E=G.findIndex(I=>I.id===s.id);if(E===-1)return;if(K===B){const I=G.map((W,ee)=>({id:W.id,order:ee})),A=Me(G,E,H),ne=A.map((W,ee)=>({id:W.id,order:ee})),ie=[...o];ie[R]={...o[R],materials:{$values:A}},d(ie);const V={sectionId:o[R].id,movedMaterialId:String(s.id),previousOrder:I,newOrder:ne,sourceIndex:E,destinationIndex:H};try{(await Xe(V)).success?(f.push(e.jsx(j,{title:"Success",type:"success",children:"Materials reordered successfully"}),{placement:"top-center"}),await i()):(d(_),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to reorder materials"}),{placement:"top-center"}))}catch{d(_),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to reorder materials"}),{placement:"top-center"})}}else{const[I]=G.splice(E,1),A=[...((Ce=o[Q].materials)==null?void 0:Ce.$values)||[]],ne=o[R].materials.$values.map((Y,Z)=>({id:Y.id,order:Z})),ie=o[Q].materials.$values.map((Y,Z)=>({id:Y.id,order:Z}));A.splice(H,0,I);const V=[...o];V[R]={...o[R],materials:{$values:G}},V[Q]={...o[Q],materials:{$values:A}};const W=G.map((Y,Z)=>({id:Y.id,order:Z})),ee=A.map((Y,Z)=>({id:Y.id,order:Z}));d(V);const We={movedMaterialId:String(s.id),sourceSectionId:K,destinationSectionId:B,sourceIndex:E,destinationIndex:H,previousSourceOrder:ne,previousDestOrder:ie,newSourceOrder:W,newDestOrder:ee};try{(await Je(We)).success?(f.push(e.jsx(j,{title:"Success",type:"success",children:"Material moved successfully"}),{placement:"top-center"}),await i()):(d(_),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to move material"}),{placement:"top-center"}))}catch{d(_),f.push(e.jsx(j,{title:"Error",type:"danger",children:"Failed to move material"}),{placement:"top-center"})}}}},Qe=()=>e.jsx(Re,{items:o.map(r=>r.id),strategy:Ue,children:e.jsx("div",{children:o.map((r,s)=>e.jsx(Fs,{section:r,permissions:M,index:s,onAddMaterial:c=>{x(c),S(!0)},onEdit:()=>{x(r),N(!0),b(!0)},onEditMaterial:_e,onDelete:()=>je("section",r.id),onDeleteMaterial:c=>je("material",c),expanded:me[r.id],onToggleExpand:()=>fe(c=>({...c,[r.id]:!c[r.id]}))},r.id))})});return y.useEffect(()=>(C||v?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"}),[C,v]),y.useEffect(()=>{const r={};o.forEach(s=>{r[s.id]=me[s.id]??!1}),fe(r)},[o]),e.jsxs(de,{className:"h-auto py-2 bg-transparent",children:[M.isEdit&&e.jsxs("div",{className:"topbar py-2 border-gray-200 border-b",children:[e.jsx(ze,{items:[{label:"Courses"},{label:"Course Items"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[e.jsx(q,{variant:"solid",size:"sm",onClick:()=>b(!0),children:"+ Add Section"}),e.jsx(q,{variant:"solid",size:"sm",onClick:()=>{x(null),S(!0)},children:"+ Add Course Material"})]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx(hs,{sensors:g,collisionDetection:ms,onDragEnd:Ke,children:e.jsx(Qe,{})})}),C&&e.jsx(As,{open:C,onClose:()=>{b(!1),N(!1)},onSubmit:u?Ye:Le,initialValues:u?a:null}),v&&e.jsx(Rs,{isOpen:v,sectionOptions:o,defaultSection:a,initialValues:w?p:null,onClose:()=>{S(!1),l(!1),m(null)},onSubmit:w?He:Be,loading:T}),e.jsx(De,{isOpen:X,type:"danger",title:(L==null?void 0:L.type)==="section"?"Delete Section":"Delete Material",confirmButtonColor:"red-600",onClose:()=>J(!1),onRequestClose:()=>J(!1),onCancel:()=>J(!1),onConfirm:Te,children:e.jsxs("p",{children:["Are you sure you want to delete this ",L==null?void 0:L.type,"? This action cannot be undone."]})})]})},$s=te().shape({title:z().required("Title is required"),description:z().required("Description is required")}),zs=({type:t,initialData:i,onFormSubmit:n,onDiscard:g})=>{const o={title:(i==null?void 0:i.title)||"",description:(i==null?void 0:i.description)||""};return e.jsx(pe,{initialValues:o,validationSchema:$s,onSubmit:(d,{setSubmitting:a})=>{n(d,a)},children:({errors:d,touched:a,isSubmitting:x})=>e.jsxs(ue,{children:[e.jsx($,{label:"Title",asterisk:!0,invalid:!!d.title&&!!a.title,errorMessage:d.title,children:e.jsx(D,{name:"title",placeholder:"Title",component:U,invalid:a.title&&d.title})}),e.jsx($,{label:"Description",asterisk:!0,invalid:!!d.description&&!!a.description,errorMessage:d.description,children:e.jsx(D,{name:"description",textArea:!0,placeholder:"Description",component:U})}),e.jsxs(xe,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:[e.jsx(q,{type:"button",size:"sm",onClick:g,children:"Cancel"}),e.jsx(q,{type:"submit",size:"sm",variant:"solid",loading:x,children:t==="edit"?"Update":"Save"})]})]})})},Ts=({pricingId:t,initialData:i,onDrawerClose:n,fetchData:g,courseId:o})=>{const d=async b=>await Is(o,b),a=async b=>await Ms(t,b),x=async(b,v)=>{v(!0);const S={title:b.title,description:b.description};(t?a:d)(S).then(P=>{P.success&&(f.push(e.jsxs(j,{title:"Success",type:"success",duration:2500,children:["Course option ",t?"updated":"added"," successfully"]}),{placement:"top-center"}),g(),n())}).catch(()=>{f.push(e.jsx(j,{title:"Error",type:"danger",duration:2500,children:"Something went wrong"}),{placement:"top-center"}),v(!1)})},C=()=>{n()};return e.jsx(zs,{type:t?"edit":"new",initialData:i,onFormSubmit:x,onDiscard:C})};Pe("CourseData",Oe);const Ls=({courseId:t})=>{const[i,n]=y.useState(!1),[g,o]=y.useState(null),[d,a]=y.useState(null),x=Fe(),C=oe(p=>{var m,X;return(X=(m=p==null?void 0:p.CourseData)==null?void 0:m.data)==null?void 0:X.CourseOptionList}),b=oe(p=>{var m;return((m=p==null?void 0:p.CourseData)==null?void 0:m.data)||{}});console.log(C,b);const[v,S]=y.useState(!1),[T,P]=y.useState(null),u=()=>{if(t){const m=os({id:t});x(m)}};y.useEffect(()=>{u()},[t]);const N=()=>{o(null),a(null),n(!0)},M=p=>{o(p.id),a(p),n(!0)},w=()=>{n(!1)},l=async()=>{if(T){try{(await ks(T)).success&&(f.push(e.jsx(j,{title:"Deleted",type:"success",duration:2500,children:"Course option deleted successfully"}),{placement:"top-center"}),u())}catch{f.push(e.jsx(j,{title:"Error",type:"danger",duration:2500,children:"Failed to delete course option"}),{placement:"top-center"})}S(!1),P(null)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-2 px-2 border-gray-200",children:[e.jsx(ze,{items:[{label:"Courses"},{label:"Course Prices"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"lg:mb-0"}),e.jsx("div",{className:"flex flex-col lg:flex-row lg:items-center",children:e.jsx(q,{onClick:N,block:!0,variant:"solid",size:"sm",icon:e.jsx(ts,{}),children:"Add Option"})})]})]}),e.jsx(de,{className:"h-auto py-4 px-6 bg-transparent",bodyClass:"h-auto",children:e.jsx("div",{className:"grid md:grid-cols-3 grid-cols-1 gap-4",children:C==null?void 0:C.map(p=>e.jsxs(se,{className:"p-6 flex flex-col justify-between h-full bg-white rounded-lg shadow-md",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4 text-gray-900",children:p.title}),e.jsx("p",{className:"text-gray-700 mb-4 leading-relaxed",children:p.description})]}),e.jsxs("div",{className:"mt-2 pt-4 border-gray-200 flex items-center justify-between",children:[e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-custom-600 hover:bg-custom-700 cursor-pointer",onClick:()=>M(p),children:e.jsx(ce,{className:"text-white",size:16})}),e.jsx("div",{className:"w-8 h-8 flex items-center justify-center rounded-full bg-red-700 hover:bg-custom-700 cursor-pointer",onClick:()=>{P(p.id),S(!0)},children:e.jsx(le,{className:"text-white",size:16})})]})]},p.id))})}),e.jsx(ae,{title:g?"Edit Option":"Add Option",isOpen:i,onClose:w,onRequestClose:w,portalClassName:"w30",children:e.jsx(Ts,{pricingId:g,initialData:d,courseId:t,onDrawerClose:w,fetchData:u})}),e.jsx(De,{isOpen:v,type:"danger",title:"Delete Course Option",confirmButtonColor:"red-600",onClose:()=>S(!1),onRequestClose:()=>S(!1),onCancel:()=>S(!1),onConfirm:l,children:e.jsx("p",{children:"Are you sure you want to delete this Course Option? This action cannot be undone."})})]})};Pe("CourseData",Oe);const gt=()=>{var o;y.useState("");const t=Fe(),i=location.pathname.substring(location.pathname.lastIndexOf("/")+1),n=oe(d=>{var a,x;return(x=(a=d==null?void 0:d.CourseData)==null?void 0:a.data)==null?void 0:x.CourseDetails}),g=()=>{if(i){const a=cs({id:i});t(a)}};return y.useEffect(()=>{g()},[i]),e.jsx(e.Fragment,{children:e.jsx("div",{className:"grid grid-cols-12 gap-1 pt-2",children:e.jsx("div",{className:"col-span-12",children:e.jsxs(ls,{defaultValue:"Course Details",children:[e.jsxs(ds,{className:"bg-white pl-4",children:[e.jsx(Ne,{icon:e.jsx(rs,{}),value:"Course Details",children:"Course Details"}),e.jsx(Ne,{icon:e.jsx(is,{}),value:"Course Price",children:"Course Options"})]}),e.jsx(Ie,{value:"Course Details",className:"bg-transparent",children:e.jsxs(de,{className:"h-full py-2 px-6 bg-transparent",bodyClass:"h-full",children:[e.jsx(se,{children:e.jsxs("div",{className:"grid auto-rows-fr lg:grid-cols-3 sm:grid-cols-1 xs:grid-cols-1 gap-2",children:[e.jsx("div",{className:"col",children:e.jsxs(se,{className:"p-1 bg-zinc-100 mx-2 h-full",children:[e.jsx("h3",{children:"Course Details"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-bold",children:`${n==null?void 0:n.title}`}),e.jsx("p",{className:"text-gray-700 dark:text-gray-200",children:e.jsx("div",{children:n==null?void 0:n.description})})]})]})}),e.jsx("div",{className:"col",children:e.jsxs(se,{className:"p-4 bg-zinc-700 text-white mx-2 h-full",children:[e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-1/2 font-bold",children:"Author :"}),e.jsx("div",{className:"w-1/2",children:n==null?void 0:n.author})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-1/2 font-bold",children:"Duration :"}),e.jsx("div",{className:"w-1/2",children:n==null?void 0:n.calculatedDuration})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-1/2 font-bold",children:"Language :"}),e.jsx("div",{className:"w-1/2",children:n==null?void 0:n.language})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-1/2 font-bold",children:"Created By :"}),e.jsx("div",{className:"w-1/2",children:n==null?void 0:n.author})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-1/2 font-bold",children:"Created At :"}),e.jsx("div",{className:"w-1/2",children:ns(n==null?void 0:n.createdDate).format("MM/DD/YYYY")})]})]})}),e.jsx("div",{className:"col",children:e.jsx(se,{className:"p-4 bg-zinc-900 text-white mx-2 h-full",children:e.jsx("div",{className:"flex h-full",children:n==null?void 0:n.shortDescription})})})]})}),e.jsx(Us,{courseId:i,fetchData:g,initialSection:((o=n==null?void 0:n.sections)==null?void 0:o.$values)||[]})]})}),e.jsx(Ie,{value:"Course Price",children:e.jsx(Ls,{courseId:i})})]})})})})};export{gt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{A as D}from"./AdaptableCard-3d1e1f96.js";import{r as n,f as Z}from"./vendor-react-ece1c85f.js";import{u as b,t as E,g as ee,r as te,s as se}from"./index-62f95885.js";import{a0 as j,B as M,E as k,F as q,k as B,D as P,l as re,r as oe,d as ae,U as ne}from"./index-3b5ce20a.js";import{A as ie,T as A}from"./actioncell-6b5ebd6c.js";import{D as le}from"./tableV2-99c808c0.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as T}from"./Drawer-4f97e662.js";import{a as C,F as ce}from"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import{U as de}from"./Upload-be937eb6.js";import{S as ue}from"./StickyFooter-3e569b80.js";import{d as y,c as pe,a as g,F as me,b as he}from"./index.esm-b2d342b5.js";import{a as fe}from"./index-0b08ce18.js";import{b as Ce,c as ge,d as be}from"./CourseService-29ad460c.js";import{C as xe}from"./ConfirmDialog-2838a642.js";import{u as je}from"./usePermission-4689548c.js";import{g as ye,r as Se}from"./index-985cf3f6.js";import{P as Fe}from"./PageBreadcrumb-cf54a6e9.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./FileSaver.min-20f3f13a.js";import"./DensitySelector-5d2e901f.js";import"./NoData-4cc4af03.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";import"./ApiService-df126758.js";const Ne=({touched:t,errors:r,values:o,setFieldValue:c})=>e.jsxs(D,{className:"mb-4",children:[e.jsx(C,{label:"Course Title",asterisk:!0,invalid:r.title&&t.title,errorMessage:r.title,children:e.jsx(y,{name:"title",component:j,placeholder:"Enter course title"})}),e.jsx(C,{label:"Author",asterisk:!0,invalid:r.author&&t.author,errorMessage:r.author,children:e.jsx(y,{name:"author",component:j,placeholder:"Enter author name"})}),e.jsx(C,{label:"Duration",asterisk:!0,invalid:r.duration&&t.duration,errorMessage:r.duration,children:e.jsx(y,{name:"duration",component:j,placeholder:"e.g. 01:30:00"})}),e.jsx(C,{label:"Language",asterisk:!0,invalid:r.language&&t.language,errorMessage:r.language,children:e.jsx(y,{name:"language",component:j,placeholder:"e.g. English"})}),e.jsx(C,{label:"Short Description",asterisk:!0,invalid:r.shortDescription&&t.shortDescription,errorMessage:r.shortDescription,children:e.jsx(y,{name:"shortDescription",component:j,placeholder:"Enter short description"})}),e.jsx(C,{label:"Description",asterisk:!0,invalid:r.description&&t.description,errorMessage:r.description,children:e.jsx(y,{name:"description",as:"textarea",component:j,textArea:!0,rows:4,placeholder:"Enter full description"})}),e.jsx("div",{className:"block mb-6",children:e.jsxs(C,{label:"Course Banner",asterisk:!0,invalid:r.banner&&t.banner,errorMessage:r.banner,children:[e.jsx(de,{draggable:!0,accept:"image/*",cropNeeded:!1,onChange:a=>{if(a&&a[0]){const i=a[0];c("banner",i)}}}),o.banner&&e.jsx("div",{className:"mb-6",children:e.jsx("img",{src:(o==null?void 0:o.banner)instanceof File?URL.createObjectURL(o==null?void 0:o.banner):o==null?void 0:o.banner,alt:"Course Banner Preview",className:"w-full h-40 object-cover rounded-md border"})})]})})]}),we=pe().shape({title:g().required("Course title is required"),author:g().required("Author is required"),duration:g().required("Duration is required").matches(/^([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$/,"Duration must be in HH:MM:SS format"),language:g().required("Language is required"),shortDescription:g().required("Short description is required"),description:g().required("Description is required"),banner:g().required("Course banner is required")}),$=n.forwardRef(({initialData:t,onFormSubmit:r,onDiscard:o},c)=>e.jsx(me,{innerRef:c,initialValues:{title:(t==null?void 0:t.title)??"",author:(t==null?void 0:t.author)??"",duration:(t==null?void 0:t.duration)??"",language:(t==null?void 0:t.language)??"",shortDescription:(t==null?void 0:t.shortDescription)??"",description:(t==null?void 0:t.description)??"",banner:(t==null?void 0:t.banner)??""},validationSchema:we,onSubmit:(a,{setSubmitting:i})=>{r(a,i)},children:({touched:a,errors:i,isSubmitting:p,setFieldValue:h,values:m})=>e.jsx(he,{children:e.jsxs(ce,{children:[e.jsx(Ne,{touched:a,errors:i,values:m,setFieldValue:h}),e.jsx(ue,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(M,{size:"sm",className:"ltr:mr-3 rtl:ml-3",type:"button",onClick:()=>o==null?void 0:o(),children:"Discard"}),e.jsx(M,{size:"sm",variant:"solid",loading:p,icon:e.jsx(fe,{}),type:"submit",children:"Save Course"})]})})]})})}));$.displayName="CourseForm";const U=({onDrawerClose:t,course:r,refetch:o})=>{const c=async h=>{let{title:m,author:d,duration:l,language:f,shortDescription:F,description:N,banner:x}=h;return r!=null&&r.id?await Ce(r.id,m,d,f,F,N,l,void 0,x!=null&&x.name?x:void 0):await ge(m,d,f,F,N,l,x)},a=()=>{o()},i=async(h,m)=>{m(!0),c(h).then(d=>{d.success&&(t(),a(),k.push(e.jsx(q,{title:"Success",type:"success",duration:2500,children:r?"Course updated successfully":"Course created successfully"}),{placement:"top-center"}))}).catch(d=>{var f;console.error("course - error",d),a();const l=(f=d.response)==null?void 0:f.data;m(!1),k.push(e.jsx(q,{title:"Error",type:"danger",duration:2500,children:(l==null?void 0:l.message)||"Failed to save course"}),{placement:"top-center"})})},p=()=>{t()};return e.jsx($,{type:r?"edit":"new",initialData:r,onFormSubmit:i,onDiscard:p})},ve=({fetchData:t})=>{const r=B(),o=b(p=>p.CourseData.data.deleteConfirmation),c=b(p=>p.CourseData.data.selectedRowData),a=()=>{r(E(!1))},i=async()=>{r(E(!1)),await be(c.id)&&(t(),k.push(e.jsx(q,{title:"Deleted",type:"success",duration:2500,children:"Course Successfully Deleted"}),{placement:"top-center"}))};return e.jsx(xe,{isOpen:o,type:"danger",title:"Delete Course",confirmButtonColor:"red-600",onClose:a,onRequestClose:a,onCancel:a,onConfirm:i,children:e.jsx("p",{children:"Are you sure you want to delete this Course? This action cannot be undone."})})};P("CourseData",te);P("CountyData",Se);const ct=()=>{const[t,r]=n.useState([]);n.useState(!1),n.useState(!1);const[o,c]=n.useState(!1),[a,i]=n.useState(!1),[p,h]=n.useState(),[m,d]=n.useState(null),l=je("Course"),[f,F]=n.useState(null),[N,x]=n.useState({name:"",company:"",status:"",registrationDate:null}),[Ae,V]=n.useState(!1),z=()=>V(!0),H=()=>{c(!0)},L=()=>{c(!1),d(null)},_=Z(),w=B();b(s=>s.CourseData.data.filterData);const G=b(s=>s.CourseData.data.loading),J=b(s=>{var u,S;return(S=(u=s==null?void 0:s.CourseData)==null?void 0:u.data)==null?void 0:S.CourseList});n.useState(!1),n.useState("approve"),n.useState(null);const R=b(s=>s.auth.user),K=b(s=>{var u,S,I;return(I=(S=(u=s==null?void 0:s.CountyData)==null?void 0:u.data)==null?void 0:S.CountyList)==null?void 0:I.map(O=>({value:O.id,label:O.title}))});re(),n.useEffect(()=>{v(),w(ye())},[N]);const v=()=>{const s=ee();w(s)},Q=s=>{_("/app/course-detail/"+s.id)},W=s=>{navigator.clipboard.writeText(s),k.push(e.jsx(q,{title:"Copied!",type:"success",duration:1500,children:"copied to clipboard"}),{placement:"top-center"})},X=(s,u)=>{u===A.view&&Q(s),u===A.edit&&(h(s.id),d({...s,banner:`${ne.apiBaseUrl}/${s.banner}`}),i(!0)),u===A.delete&&(w(E(!0)),w(se(s))),u===A.affiliate&&W(s==null?void 0:s.affiliateLink)},Y=[{dataField:"Action",caption:"Action",width:"130",cellRender:s=>e.jsx("div",{"data-cname":"Action",className:"flex justify-start items-center",children:e.jsx(ie,{row:s==null?void 0:s.data,actions:{view:!0,edit:l==null?void 0:l.isEdit,delete:l==null?void 0:l.isDelete,affiliate:!0},buttonClick:X})})},{dataField:"title",caption:"Title"},{dataField:"author",caption:"Author"},{dataField:"duration",caption:"Duration"},{dataField:"language",caption:"Language"},{dataField:"shortDescription",caption:"Short Description",width:"20%",cssClass:"truncate-cell"},{dataField:"description",caption:"Description",width:"30%",cssClass:"truncate-cell"},{dataField:"createdDate",caption:"Created Date",dataType:"date",format:"MM/dd/yyyy"}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx(Fe,{items:[{label:"Courses"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("div",{className:"basis-3/4",children:e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Courses"})}),e.jsxs("div",{className:"basis-1/4 flex items-center justify-between gap-2",children:[e.jsx("div",{className:"basis-3/4",children:(R==null?void 0:R.roleName)==="Super Admin"&&e.jsx(oe,{value:f,placeholder:"Select Entity",isClearable:!0,onChange:s=>F(s),options:K,styles:{input:s=>({...s,color:"black"})}})}),e.jsx("div",{className:"basis-1/4",children:e.jsx(M,{onClick:()=>H(),block:!0,variant:"solid",size:"sm",icon:e.jsx(ae,{}),children:"Add Course"})})]})]})]}),e.jsx(D,{className:"m-6 h-full bg-transparent",bodyClass:"h-full",children:e.jsx(D,{className:"borderless",children:e.jsx(le,{columns:Y,tableName:"Course-table",data:J||[],height:"calc(100vh - 270px)",defaultHiddenColumn:[],fetchData:()=>{},id_label:"$id",selectedRowId:t,setSelectedRowId:r,setFilterValues:()=>{},filterValues:[],identity:"Lead-Listing",isColumnReorderReq:!0,setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"Lead-Listing-table",handleSearch:()=>{},isColumnResizing:!0,isPaginationReq:!0,isSelectionReq:!1,isFilterReq:!0,openFilter:z,isLoading:G})})}),e.jsx(T,{title:"Add Course",isOpen:o,onClose:L,onRequestClose:L,portalClassName:"w30",children:e.jsx(U,{onDrawerClose:L,refetch:v})}),e.jsx(T,{title:"Edit Course",isOpen:a,onClose:()=>i(!1),onRequestClose:()=>i(!1),portalClassName:"w30",children:e.jsx(U,{onDrawerClose:()=>i(!1),course:m,refetch:v})}),e.jsx(ve,{fetchData:v})]})};export{ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d1 as t,U as d}from"./index-3b5ce20a.js";import{A as l}from"./ApiService-df126758.js";async function m(s,e,o,u,n,i,c){return(await t.apiV10CourseAddCoursePost(s,e,o,u,n,i,c)).data}async function w(s){return(await t.apiV10CourseGetCoursePost()).data}async function U(s){return(await t.apiV10CourseGetCourseByIdIdGet(s)).data}async function v(s,e,o,u,n,i,c,p,r){return(await t.apiV10CourseUpdateCourseCourseIdPost(s,e,o,u,n,i,c,p,r)).data}async function y(s){return(await t.apiV10CourseDeleteCourseCourseIdPost(s)).data}async function I(s,e){return(await t.apiV10CourseAddCourseSectionCourseIdPost(s,e)).data}async function V(s,e){var p;const o=new FormData;o.append("Title",e.title),e.duration&&o.append("Duration",e.duration),e.videoUrl&&o.append("VideoUrl",e.videoUrl),e.description&&o.append("Description",e.description);const u=/(?:https?:\/\/)?(?:www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i,n=e.videoUrl.match(u),i=n?n[1]:(p=e.videoUrl.match(/(\d+)/))==null?void 0:p[1];return i&&o.append("videoId",i),e.resources&&e.resources.length>0&&e.resources.forEach((r,a)=>{r.title&&o.append(`Resources[${a}].Title`,r.title),r.resourceUrl&&o.append(`Resources[${a}].ResourceUrl`,r.resourceUrl),r.resourceFile instanceof File&&o.append(`Resources[${a}].ResourceFile`,r.resourceFile),r.resourceId&&o.append(`Resources[${a}].ResourceId`,r.resourceId)}),(await l.fetchData({url:`${d.apiBaseUrl}/api/v1.0/Course/AddCourseMaterial/${s}`,method:"POST",headers:{"Content-Type":"multipart/form-data"},data:o})).data}async function h(s,e){return(await t.apiV10CourseUpdateCourseSectionSectionIdPost(s,e)).data}async function R(s){return(await t.apiV10CourseDeleteCourseSectionSectionIdPost(s)).data}async function D(s,e){var p;const o=new FormData;o.append("Title",e.title),e.duration&&o.append("Duration",e.duration),e.videoUrl&&o.append("VideoUrl",e.videoUrl),e.description&&o.append("Description",e.description);const u=/(?:https?:\/\/)?(?:www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i,n=e.videoUrl.match(u),i=n?n[1]:(p=e.videoUrl.match(/(\d+)/))==null?void 0:p[1];return i&&o.append("videoId",i),e.resources&&e.resources.length>0&&e.resources.forEach((r,a)=>{r.title&&o.append(`Resources[${a}].Title`,r.title),r.resourceUrl&&o.append(`Resources[${a}].ResourceUrl`,r.resourceUrl),r.resourceFile instanceof File&&o.append(`Resources[${a}].ResourceFile`,r.resourceFile),r.resourceId&&o.append(`Resources[${a}].ResourceId`,r.resourceId)}),(await l.fetchData({url:`${d.apiBaseUrl}/api/v1.0/Course/UpdateCourseMaterial/${s}`,method:"POST",headers:{"Content-Type":"multipart/form-data"},data:o})).data}async function P(s){return(await t.apiV10CourseDeleteCourseMaterialMaterialIdPost(s)).data}async function S(s){return(await t.apiV10CourseGetVimeoDetailVideoIdGet(s)).data}async function A(s){return(await t.apiV10CourseReorderCourseSectionsPost(s)).data}async function O(s){return(await t.apiV10CourseReorderCourseMaterialsPost(s)).data}async function $(s){return(await t.apiV10CourseGetCourseOptionsCourseIdGet(s)).data}async function G(s,e){return(await t.apiV10CourseAddCourseOptionCourseIdPost(s,e)).data}async function F(s,e){return(await t.apiV10CourseUpdateCourseOptionOptionIdPost(s,e)).data}async function M(s){return(await t.apiV10CourseDeleteCourseOptionsOptionIdPost(s)).data}export{w as a,v as b,m as c,y as d,U as e,$ as f,S as g,R as h,P as i,I as j,V as k,D as l,h as m,A as n,O as o,G as p,F as q,M as r};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{r as s,k as v}from"./vendor-react-ece1c85f.js";import{S as w}from"./index-8677acd1.js";import"./Alert-59d09a99.js";import{B as m}from"./index-3b5ce20a.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{p as a}from"./Notify-8fb74d48.js";import{a as S}from"./DigitalSignature-69eaf80c.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";function G(){const r=s.useRef(null),[p,l]=s.useState(!1),[x,c]=s.useState(null),[n,u]=s.useState(!1),[d]=v(),g=d.get("token"),h=d.get("type")||"signature",[j,f]=s.useState(500);s.useEffect(()=>{const t=()=>{const i=window.innerHeight*.7;f(i)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const b=()=>{var t;return(t=r.current)==null?void 0:t.clear()},y=async()=>{var i;if((i=r.current)!=null&&i.isEmpty()){a("Please sign before submitting.","Signature can't be Empty","warning");return}const t=r.current.getTrimmedCanvas().toDataURL("image/png");if(c(t),!g){a("Invalid or missing token.","Error","danger");return}try{u(!0);const o=await S(g,{signatureValue:t});o.success?(a("Signature submitted successfully.","Success","success"),l(!0)):a(o.message||"Failed to submit signature.","Error","danger")}catch{a("Something went wrong. Please try again.","Error","danger")}finally{u(!1)}};return p?e.jsxs("div",{className:"flex flex-col min-h-[85vh] bg-gray-50 px-3 items-center justify-center text-center",children:[e.jsx("div",{className:"text-4xl mb-2",children:" 🎊"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Signature Saved Successfully"}),e.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Thank you for confirming your signature."}),e.jsx("img",{src:x,alt:"Signature preview",className:"rounded-md bg-white p-2 max-h-64 border shadow-sm"}),e.jsx("p",{className:"text-sm text-gray-600 mt-6",children:"You may now safely close this tab."}),e.jsx(m,{onClick:()=>{l(!1),c(null),setTimeout(()=>{var t;return(t=r.current)==null?void 0:t.clear()},50)},variant:"plain",size:"sm",className:"mt-3 text-gray-500",children:"Sign Again"})]}):e.jsxs("div",{className:"flex flex-col items-center min-h-screen bg-gray-50 px-3 pt-4",children:[e.jsx("h1",{className:"text-lg sm:text-xl font-semibold text-gray-800 text-center",children:h==="initials"?"Draw Your Initials":"Draw Your Signature"}),e.jsx("p",{className:"text-sm text-gray-500 mb-3 text-center",children:"Sign inside the box below"}),e.jsx("div",{className:`\r
|
|
2
|
+
bg-white border border-gray-300 rounded-md shadow-sm\r
|
|
3
|
+
mx-auto \r
|
|
4
|
+
w-[90%] sm:w-[90%] lg:w-[60vw]\r
|
|
5
|
+
h-[65vh] /* <- updated from 70vh to 65vh */\r
|
|
6
|
+
flex items-center justify-center\r
|
|
7
|
+
`,children:e.jsx(w,{ref:r,penColor:"black",minWidth:1.8,maxWidth:3.5,velocityFilterWeight:.7,canvasProps:{className:"w-full h-full rounded-md touch-none"}})}),e.jsxs("div",{className:"flex justify-center gap-4 mt-5 pb-5",children:[e.jsx(m,{onClick:b,disabled:n,size:"sm",className:"px-5 py-2 bg-gray-200 text-gray-700 rounded-md",children:"Clear"}),e.jsx(m,{onClick:y,disabled:n,variant:"solid",size:"sm",className:"px-5 py-2 text-white rounded-md",children:n?"Submitting...":"Submit"})]})]})}export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-mui-
|
|
1
|
+
import{j as s}from"./vendor-mui-98daa63f.js";const n=({title:t,value:e})=>s.jsxs("div",{children:[s.jsx("span",{children:t}),s.jsx("p",{className:"text-gray-700 dark:text-gray-400 font-semibold text-md",children:e})]});export{n as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-mui-98daa63f.js";import{u as f,M as j,U as v,s as y,H as g}from"./ClassicLayout-a9866742.js";import{H as M,a as E}from"./HorizontalMenuContent-fd559f4d.js";import{c as m,g as p,N,P as H,b as S}from"./index-3b5ce20a.js";import{V as w}from"./Views-1359da48.js";import{c as l,r as d}from"./vendor-react-ece1c85f.js";import{L as C}from"./Logo-dd6f7656.js";import"./withHeaderItem-df2cc5d9.js";import"./index-8d5b6a1f.js";import"./index-0b08ce18.js";import"./index-00a8eb64.js";import"./index-a14e51de.js";import"./useDidUpdate-de319a18.js";import"./useControllableState-d0909575.js";import"./ApiService-df126758.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import"./vendor-devex-4076ffeb.js";import"./vendor-pdf-3c29882d.js";import"./vendor-i18n-b89304ef.js";import"./index-359d245d.js";import"./vendor-redux-a1f00e6b.js";import"./WidgetLayoutsService-49730609.js";import"./usePermission-4689548c.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";const L=r=>{const{className:s,contained:i,menus:n}=r,t=m(o=>o.theme.navMode),a=m(o=>o.theme.themeColor),c=m(o=>o.theme.primaryColorLevel),u=m(o=>o.auth.user.authority),{larger:x}=f(),h=()=>t===N?`bg-${a}-${c} secondary-header-${t}`:`secondary-header-${t}`;return e.jsx(e.Fragment,{children:x.md&&e.jsx("div",{className:p("h-16 flex items-center",h(),s),children:e.jsx("div",{className:p("flex items-center px-4",i&&"container mx-auto"),children:e.jsx(M,{menus:n,manuVariant:t,userAuthority:u})})})})},A=l.memo(r=>{const{menus:s}=r;return e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsx(C,{type:"streamline",imgClass:"mx-auto mobile-only"}),e.jsx(j,{menus:s})]})}),R=l.memo(()=>e.jsx(e.Fragment,{children:e.jsx(v,{hoverable:!1})})),$=()=>{const[r,s]=d.useState([]);d.useEffect(()=>{i()},[]);const i=async()=>{var t;const n=localStorage.getItem(H);if(n){const a=await S(n,"default");let c=y((t=a==null?void 0:a.data)==null?void 0:t.$values);s(c??[])}};return e.jsx("div",{className:"app-layout-simple flex flex-auto flex-col min-h-screen",children:e.jsx("div",{className:"flex flex-auto min-w-0",children:e.jsxs("div",{className:"flex flex-col flex-auto min-h-screen min-w-0 relative w-full",children:[e.jsx(g,{container:!0,className:"shadow dark:shadow-2xl",headerStart:e.jsx(A,{menus:r}),headerEnd:e.jsx(R,{})}),e.jsx(L,{contained:!0,menus:r}),e.jsx(w,{pageContainerType:"contained"})]})})})},ce=l.memo($);export{ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,T as m,I as x,n as u,o as j,s as h,i as p}from"./vendor-mui-98daa63f.js";import{r as D}from"./vendor-react-ece1c85f.js";import{aV as I,cZ as f,ad as C,c_ as y}from"./index-3b5ce20a.js";const P=({density:a,setDensity:c})=>{const[t,n]=D.useState(null),r=!!t,l=e=>{n(e.currentTarget)},o=()=>{n(null)},i=e=>{c(e),o()},d={compact:s.jsx(f,{}),standard:s.jsx(C,{}),comfortable:s.jsx(y,{})};return s.jsxs(s.Fragment,{children:[s.jsx(m,{title:"Density",children:s.jsx(x,{onClick:l,children:s.jsx(I,{style:{fontSize:15}})})}),s.jsx(u,{anchorEl:t,open:r,onClose:o,children:["compact","standard","comfortable"].map(e=>s.jsxs(j,{selected:a===e,onClick:()=>i(e),children:[s.jsx(h,{children:d[e]}),s.jsx(p,{primary:e.charAt(0).toUpperCase()+e.slice(1)})]},e))})]})};export{P as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d2 as a,d3 as n}from"./index-3b5ce20a.js";async function i(t){return(await a.apiV10ContactPosistionAddContactPosistionPost(t)).data}async function r(){return(await a.apiV10ContactPosistionGetContactPosistionPost()).data}async function p(t,e){return(await a.apiV10ContactPosistionUpdateContactPosistionIdPut(t,e)).data}async function c(t){return(await a.apiV10ContactPosistionDeleteContactPosistionIdDelete(t)).data}async function d(t){return(await n.apiV10DepartmentAddDepartmentPost(t)).data}async function D(){return(await n.apiV10DepartmentGetDepartmentPost()).data}async function P(t,e){return(await n.apiV10DepartmentUpdateDepartmentIdPut(t,e)).data}async function u(t){return(await n.apiV10DepartmentDeleteDepartmentIdDelete(t)).data}export{r as a,D as b,p as c,i as d,c as e,u as f,P as g,d as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c9 as t,ca as a,cb as o}from"./index-3b5ce20a.js";async function c(){return(await t.apiV10SignedDocumentDocumentsGet()).data}async function p(e,n,s){return(await t.apiV10SignedDocumentUploadPost(e,n,s)).data}async function u(e){return(await t.apiV10SignedDocumentPreviewDocumentIdGet(e,{responseType:"blob"})).data}async function d(e){return(await t.apiV10SignedDocumentIdDelete(e)).data}async function m(e,n){return(await t.apiV10SignedDocumentDocumentIdPartiesPost(e,n)).data}async function D(e){return(await t.apiV10SignedDocumentDocumentIdPartiesGet(e)).data}async function g(e,n){return(await t.apiV10SignedDocumentDocumentIdFieldsPost(e,n)).data}async function l(e){return(await t.apiV10SignedDocumentDocumentIdFieldsGet(e)).data}async function S(e){return(await t.apiV10SignedDocumentPartyIdPartyDelete(e)).data}async function y(e,n){return(await t.apiV10SignedDocumentDocumentIdSaveSigningOrderPost(e,n)).data}async function w(e){return(await t.apiV10SignedDocumentDocumentIdSendEmailPost(e)).data}async function f(e){return(await t.apiV10SignedDocumentDocumentIdGenerateSigningUrlPost(e)).data}async function V(e){return(await a.apiV10SigningAccessTokenDocumentGet(e)).data}async function T(e){return(await a.apiV10SigningAccessTokenPreviewGet(e,{responseType:"blob"})).data}async function G(e,n){return(await a.apiV10SigningSigningTokenSubmitSignaturePost(e,n)).data}async function P(e,n){return(await a.apiV10SigningAccessTokenSignPost(e,n)).data}async function I(e){return await a.apiV10SigningAccessTokenDownloadGet(e,{responseType:"blob"})}async function b(e){return await t.apiV10SignedDocumentDownloadDocumentIdGet(e,{responseType:"blob"})}async function A(e){return await t.apiV10SignedDocumentDocumentIdAuditTrailGet(e)}async function F(){return await t.apiV10SignedDocumentTemplatesGet()}async function k(e,n,s){return await t.apiV10SignedDocumentSaveAsTemplatePost(e,n,s)}async function v(){return(await o.apiV10TemplatesGet()).data}async function U(e,n,s){return(await o.apiV10TemplatesPost(e,n,s)).data}async function B(e){return(await o.apiV10TemplatesIdDelete(e)).data}export{G as a,I as b,V as c,T as d,P as e,f,y as g,w as h,S as i,g as j,m as k,D as l,u as m,l as n,A as o,c as p,v as q,F as r,U as s,B as t,b as u,p as v,k as w,d as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dH as n}from"./index-
|
|
1
|
+
import{dH as n}from"./index-3b5ce20a.js";async function u(e){return(await n.apiV10DocumentManagementGetDocumentFolderFilesPost(e)).data}async function m(e){return(await n.apiV10DocumentManagementGetAllDocumentFilesPost(e)).data}async function D(e){return(await n.apiV10DocumentManagementGetCategoriesGet(e)).data}async function l(e){return(await n.apiV10DocumentManagementCreateCategoryPost(e)).data}async function d(e,a){return console.log("categoryId",e,a),(await n.apiV10DocumentManagementGetSubCategoriesCategoryIdGet(e,a)).data}async function y(e){return(await n.apiV10DocumentManagementCreateSubCategoryPost(e)).data}async function g(e){return(await n.apiV10DocumentManagementGetHierarchyGet(e)).data}async function w(e){return(await n.apiV10DocumentManagementCreateHierarchyPost(e)).data}async function C(e,a,t,s,o,r,c){return(await n.apiV10DocumentManagementCreateFilePost(e,a,t,s,o,r,c)).data}async function f(e){return(await n.apiV10DocumentManagementDeleteDocumentFileIdDelete(e)).data}async function G(e){return(await n.apiV10DocumentManagementDeleteDocumentFolderIdDelete(e)).data}async function M(){return(await n.apiV10DocumentManagementGetAnalyzedDocumentsGet()).data}async function V(e,a){return(await n.apiV10DocumentManagementAnalyzeDocumentPost(e,a)).data}async function F(e){return await n.apiV10DocumentManagementDownloadAnalyzedDocumentAnalyzedFileIdGet(e,{responseType:"blob"})}async function A(e,a,t){return(await n.apiV10DocumentManagementEditAnalyzeDocumentFileIdPut(e,a,t)).data}async function z(e){return(await n.apiV10DocumentManagementDeleteAnalyzedDocumentFileIdDelete(e)).data}export{D as a,g as b,d as c,m as d,u as e,C as f,w as g,y as h,l as i,f as j,G as k,F as l,z as m,M as n,A as o,V as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./vendor-mui-98daa63f.js";import{r as c}from"./vendor-react-ece1c85f.js";import{ai as h}from"./index-3b5ce20a.js";import{A as f}from"./AdaptableCard-3d1e1f96.js";import{o as p}from"./DigitalSignature-69eaf80c.js";import{f as v}from"./DateDifference-e47d2393.js";const u=({documentId:r})=>{const[a,x]=c.useState([]),[l,o]=c.useState(!0);return c.useEffect(()=>{if(!r)return;(async()=>{var i,d,m,n;try{o(!0);const e=await p(r);(d=(i=e==null?void 0:e.data)==null?void 0:i.data)!=null&&d.$values&&x(((n=(m=e==null?void 0:e.data)==null?void 0:m.data)==null?void 0:n.$values)??[])}catch(e){console.error("Failed to load activity logs",e)}finally{o(!1)}})()},[r]),s.jsx(f,{className:"shadow-sm rounded-lg activity-card-header",children:s.jsx("div",{className:"p-4",children:s.jsxs("div",{className:"relative pl-4",children:[l&&s.jsx("p",{className:"text-white text-sm",children:"Loading activity..."}),!l&&a.length===0&&s.jsx("p",{className:"text-white text-sm",children:"No activity found."}),s.jsx("div",{className:"space-y-3",children:a==null?void 0:a.map(t=>{var i;return s.jsxs("div",{className:"ticket-activity",children:[s.jsx("div",{className:"t-activity absolute -left-4 top-0 w-3 h-3 rounded-full bg-custom-500 ring-2 ring-white"}),s.jsxs("div",{className:"pl-2",children:[s.jsxs("div",{className:"text-sm text-white",children:[s.jsx("span",{className:"font-bold",children:!(t!=null&&t.partyName)&&(t==null?void 0:t.createdByUserName)})," ",t==null?void 0:t.details]}),s.jsxs("div",{className:"text-xs text-white mt-1",children:[v(t==null?void 0:t.timestamp)," (",(i=h.utc(t==null?void 0:t.timestamp))==null?void 0:i.local().format("DD MMM YY h:mm A"),")"]})]})]},t.id)})})]})})})},L=u;export{L as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./vendor-mui-98daa63f.js";import{c}from"./index-3b5ce20a.js";import{L as l}from"./Logo-dd6f7656.js";import a from"./DocumentUserSigned-f7371fc5.js";import d from"./CreateSignature-c22e4a71.js";import{u as x}from"./vendor-react-ece1c85f.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./index-2dae59b1.js";import"./index-8677acd1.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./useControllableState-d0909575.js";import"./index-a14e51de.js";import"./useDidUpdate-de319a18.js";import"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import"./index-533fd007.js";import"./index-0ec48d3d.js";import"./Notify-8fb74d48.js";import"./DigitalSignature-69eaf80c.js";import"./ConfirmDialog-2838a642.js";function u(t,i){if(!i)return"/img/others/auth-background.jpg";const n=i.replace(/\\/g,"/").split("/").map(encodeURIComponent).join("/");return`${t}/${n}`}function f(t){const i=[".jpg",".jpeg",".png",".gif",".webp"],o=[".mp4",".webm",".ogg"],n=t.slice(t.lastIndexOf(".")).toLowerCase();return i.includes(n)?"img":o.includes(n)?".mp4":"img"}const $=()=>{const t=x(),i=c(e=>{var m;return((m=e==null?void 0:e.theme)==null?void 0:m.coverLayout)||{}}),o=c(e=>{var m;return((m=e==null?void 0:e.theme)==null?void 0:m.productsLayout)||i}),n=u(window.RUNTIME_CONFIG.VITE_API_BASE_URL,(o==null?void 0:o.settingFilePath)||"/img/others/auth-background.jpg");f(n);let p={primaryText:"Your Journey to Exceptional Service",secondaryText:"ContentActive",description:"Elevate Your Client Relationships and Deliver Excellence Every Step of the Way"};try{if(o!=null&&o.moreInformation){const e=JSON.parse(o.moreInformation);p={...p,...e==null?void 0:e.themeText}}}catch(e){console.error("Error parsing themeText:",e)}const s=()=>t.pathname.includes("/sign-document")?r.jsx(a,{}):r.jsx(d,{});return r.jsxs("div",{className:"app-layout-blank flex flex-col min-h-screen bg-white dark:bg-gray-900",children:[r.jsx("div",{className:"flex justify-center py-4",children:r.jsx(l,{mode:"light",logoWidth:140})}),r.jsx("div",{className:"flex flex-col items-center justify-center flex-grow px-2 md:px-6 md:px-12",children:r.jsx("div",{className:"w-full max-w-[98%] md:max-w-[70vw]",children:s()})})]})};export{$ as default};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{j as i}from"./vendor-mui-98daa63f.js";import{r as z,a as ye,u as Ae,f as Oe}from"./vendor-react-ece1c85f.js";import{D as _e,G as Fe,v as Be,P as Ue}from"./vendor-pdf-3c29882d.js";import{D as Ie,H as $e}from"./index-2dae59b1.js";import"./index-8677acd1.js";import{D as Ge}from"./cjs-998de55c.js";import"./Alert-59d09a99.js";import{H as Xe,a0 as le,B as J,E as q,Z as Ye,db as qe,cF as ce,F as Z}from"./index-3b5ce20a.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as Ve}from"./Drawer-4f97e662.js";import"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import"./Upload-be937eb6.js";import{f as Ze,g as Je,h as Ke,i as Qe,j as et,k as tt,l as ue,m as st,n as it}from"./DigitalSignature-69eaf80c.js";import"./index-0ec48d3d.js";import{F as rt,a as at}from"./index-49016ad0.js";import{A as nt}from"./DocumentActivity-bc938c61.js";import{u as ot,a as lt}from"./useDrop-8f0d11a7.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";import"./AdaptableCard-3d1e1f96.js";import"./DateDifference-e47d2393.js";var H=globalThis&&globalThis.__assign||function(){return H=Object.assign||function(s){for(var a,t=1,e=arguments.length;t<e;t++){a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},H.apply(this,arguments)},fe={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},ge={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},te={width:"20px",height:"20px",position:"absolute",zIndex:1},ht={top:H(H({},fe),{top:"-5px"}),right:H(H({},ge),{left:void 0,right:"-5px"}),bottom:H(H({},fe),{top:void 0,bottom:"-5px"}),left:H(H({},ge),{left:"-5px"}),topRight:H(H({},te),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:H(H({},te),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:H(H({},te),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:H(H({},te),{left:"-10px",top:"-10px",cursor:"nw-resize"})},dt=z.memo(function(s){var a=s.onResizeStart,t=s.direction,e=s.children,r=s.replaceStyles,l=s.className,n=z.useCallback(function(h){a(h,t)},[a,t]),o=z.useCallback(function(h){a(h,t)},[a,t]),p=z.useMemo(function(){return H(H({position:"absolute",userSelect:"none"},ht[t]),r??{})},[r,t]);return i.jsx("div",{className:l||void 0,style:p,onMouseDown:n,onTouchStart:o,children:e})}),pt=globalThis&&globalThis.__extends||function(){var s=function(a,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])},s(a,t)};return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");s(a,t);function e(){this.constructor=a}a.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Y=globalThis&&globalThis.__assign||function(){return Y=Object.assign||function(s){for(var a,t=1,e=arguments.length;t<e;t++){a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},Y.apply(this,arguments)},ct={width:"auto",height:"auto"},se=function(s,a,t){return Math.max(Math.min(s,t),a)},me=function(s,a,t){var e=Math.round(s/a);return e*a+t*(e-1)},ee=function(s,a){return new RegExp(s,"i").test(a)},ie=function(s){return!!(s.touches&&s.touches.length)},ut=function(s){return!!((s.clientX||s.clientX===0)&&(s.clientY||s.clientY===0))},xe=function(s,a,t){t===void 0&&(t=0);var e=a.reduce(function(l,n,o){return Math.abs(n-s)<Math.abs(a[l]-s)?o:l},0),r=Math.abs(a[e]-s);return t===0||r<t?a[e]:s},ne=function(s){return s=s.toString(),s==="auto"||s.endsWith("px")||s.endsWith("%")||s.endsWith("vh")||s.endsWith("vw")||s.endsWith("vmax")||s.endsWith("vmin")?s:"".concat(s,"px")},re=function(s,a,t,e){if(s&&typeof s=="string"){if(s.endsWith("px"))return Number(s.replace("px",""));if(s.endsWith("%")){var r=Number(s.replace("%",""))/100;return a*r}if(s.endsWith("vw")){var r=Number(s.replace("vw",""))/100;return t*r}if(s.endsWith("vh")){var r=Number(s.replace("vh",""))/100;return e*r}}return s},ft=function(s,a,t,e,r,l,n){return e=re(e,s.width,a,t),r=re(r,s.height,a,t),l=re(l,s.width,a,t),n=re(n,s.height,a,t),{maxWidth:typeof e>"u"?void 0:Number(e),maxHeight:typeof r>"u"?void 0:Number(r),minWidth:typeof l>"u"?void 0:Number(l),minHeight:typeof n>"u"?void 0:Number(n)}},gt=function(s){return Array.isArray(s)?s:[s,s]},mt=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],ve="__resizable_base__",xt=function(s){pt(a,s);function a(t){var e,r,l,n,o=s.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.delta={width:0,height:0},o.appendBase=function(){if(!o.resizable||!o.window)return null;var p=o.parentNode;if(!p)return null;var h=o.window.document.createElement("div");return h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.transform="scale(0, 0)",h.style.left="0",h.style.flex="0 0 100%",h.classList?h.classList.add(ve):h.className+=ve,p.appendChild(h),h},o.removeBase=function(p){var h=o.parentNode;h&&h.removeChild(p)},o.state={isResizing:!1,width:(r=(e=o.propsSize)===null||e===void 0?void 0:e.width)!==null&&r!==void 0?r:"auto",height:(n=(l=o.propsSize)===null||l===void 0?void 0:l.height)!==null&&n!==void 0?n:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return Object.defineProperty(a.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ct},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var r=this.resizable.offsetWidth,l=this.resizable.offsetHeight,n=this.resizable.style.position;n!=="relative"&&(this.resizable.style.position="relative"),t=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:r,e=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:l,this.resizable.style.position=n}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,r=function(o){var p;if(typeof t.state[o]>"u"||t.state[o]==="auto")return"auto";if(t.propsSize&&t.propsSize[o]&&(!((p=t.propsSize[o])===null||p===void 0)&&p.toString().endsWith("%"))){if(t.state[o].toString().endsWith("%"))return t.state[o].toString();var h=t.getParentSize(),v=Number(t.state[o].toString().replace("px","")),u=v/h[o]*100;return"".concat(u,"%")}return ne(t.state[o])},l=e&&typeof e.width<"u"&&!this.state.isResizing?ne(e.width):r("width"),n=e&&typeof e.height<"u"&&!this.state.isResizing?ne(e.height):r("height");return{width:l,height:n}},enumerable:!1,configurable:!0}),a.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,r=this.parentNode.style.flexWrap;r!=="wrap"&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var l={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=r),this.removeBase(t),l},a.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},a.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},a.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:t.flexBasis!=="auto"?t.flexBasis:void 0})}},a.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},a.prototype.createSizeForCssProperty=function(t,e){var r=this.propsSize&&this.propsSize[e];return this.state[e]==="auto"&&this.state.original[e]===t&&(typeof r>"u"||r==="auto")?"auto":t},a.prototype.calculateNewMaxFromBoundary=function(t,e){var r=this.props.boundsByDirection,l=this.state.direction,n=r&&ee("left",l),o=r&&ee("top",l),p,h;if(this.props.bounds==="parent"){var v=this.parentNode;v&&(p=n?this.resizableRight-this.parentLeft:v.offsetWidth+(this.parentLeft-this.resizableLeft),h=o?this.resizableBottom-this.parentTop:v.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(p=n?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=o?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(p=n?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=o?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return p&&Number.isFinite(p)&&(t=t&&t<p?t:p),h&&Number.isFinite(h)&&(e=e&&e<h?e:h),{maxWidth:t,maxHeight:e}},a.prototype.calculateNewSizeFromDirection=function(t,e){var r=this.props.scale||1,l=gt(this.props.resizeRatio||1),n=l[0],o=l[1],p=this.state,h=p.direction,v=p.original,u=this.props,m=u.lockAspectRatio,x=u.lockAspectRatioExtraHeight,b=u.lockAspectRatioExtraWidth,D=v.width,M=v.height,k=x||0,T=b||0;return ee("right",h)&&(D=v.width+(t-v.x)*n/r,m&&(M=(D-T)/this.ratio+k)),ee("left",h)&&(D=v.width-(t-v.x)*n/r,m&&(M=(D-T)/this.ratio+k)),ee("bottom",h)&&(M=v.height+(e-v.y)*o/r,m&&(D=(M-k)*this.ratio+T)),ee("top",h)&&(M=v.height-(e-v.y)*o/r,m&&(D=(M-k)*this.ratio+T)),{newWidth:D,newHeight:M}},a.prototype.calculateNewSizeFromAspectRatio=function(t,e,r,l){var n=this.props,o=n.lockAspectRatio,p=n.lockAspectRatioExtraHeight,h=n.lockAspectRatioExtraWidth,v=typeof l.width>"u"?10:l.width,u=typeof r.width>"u"||r.width<0?t:r.width,m=typeof l.height>"u"?10:l.height,x=typeof r.height>"u"||r.height<0?e:r.height,b=p||0,D=h||0;if(o){var M=(m-b)*this.ratio+D,k=(x-b)*this.ratio+D,T=(v-D)/this.ratio+b,R=(u-D)/this.ratio+b,C=Math.max(v,M),E=Math.min(u,k),g=Math.max(m,T),S=Math.min(x,R);t=se(t,C,E),e=se(e,g,S)}else t=se(t,v,u),e=se(e,m,x);return{newWidth:t,newHeight:e}},a.prototype.setBoundingClientRect=function(){var t=1/(this.props.scale||1);if(this.props.bounds==="parent"){var e=this.parentNode;if(e){var r=e.getBoundingClientRect();this.parentLeft=r.left*t,this.parentTop=r.top*t}}if(this.props.bounds&&typeof this.props.bounds!="string"){var l=this.props.bounds.getBoundingClientRect();this.targetLeft=l.left*t,this.targetTop=l.top*t}if(this.resizable){var n=this.resizable.getBoundingClientRect(),o=n.left,p=n.top,h=n.right,v=n.bottom;this.resizableLeft=o*t,this.resizableRight=h*t,this.resizableTop=p*t,this.resizableBottom=v*t}},a.prototype.onResizeStart=function(t,e){if(!(!this.resizable||!this.window)){var r=0,l=0;if(t.nativeEvent&&ut(t.nativeEvent)?(r=t.nativeEvent.clientX,l=t.nativeEvent.clientY):t.nativeEvent&&ie(t.nativeEvent)&&(r=t.nativeEvent.touches[0].clientX,l=t.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var n=this.props.onResizeStart(t,e,this.resizable);if(n===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var o,p=this.window.getComputedStyle(this.resizable);if(p.flexBasis!=="auto"){var h=this.parentNode;if(h){var v=this.window.getComputedStyle(h).flexDirection;this.flexDir=v.startsWith("row")?"row":"column",o=p.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var u={original:{x:r,y:l,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Y(Y({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:o};this.setState(u)}},a.prototype.onMouseMove=function(t){var e=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ie(t))try{t.preventDefault(),t.stopPropagation()}catch{}var r=this.props,l=r.maxWidth,n=r.maxHeight,o=r.minWidth,p=r.minHeight,h=ie(t)?t.touches[0].clientX:t.clientX,v=ie(t)?t.touches[0].clientY:t.clientY,u=this.state,m=u.direction,x=u.original,b=u.width,D=u.height,M=this.getParentSize(),k=ft(M,this.window.innerWidth,this.window.innerHeight,l,n,o,p);l=k.maxWidth,n=k.maxHeight,o=k.minWidth,p=k.minHeight;var T=this.calculateNewSizeFromDirection(h,v),R=T.newHeight,C=T.newWidth,E=this.calculateNewMaxFromBoundary(l,n);this.props.snap&&this.props.snap.x&&(C=xe(C,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(R=xe(R,this.props.snap.y,this.props.snapGap));var g=this.calculateNewSizeFromAspectRatio(C,R,{width:E.maxWidth,height:E.maxHeight},{width:o,height:p});if(C=g.newWidth,R=g.newHeight,this.props.grid){var S=me(C,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),j=me(R,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),N=this.props.snapGap||0,W=N===0||Math.abs(S-C)<=N?S:C,L=N===0||Math.abs(j-R)<=N?j:R;C=W,R=L}var P={width:C-x.width,height:R-x.height};if(this.delta=P,b&&typeof b=="string"){if(b.endsWith("%")){var B=C/M.width*100;C="".concat(B,"%")}else if(b.endsWith("vw")){var I=C/this.window.innerWidth*100;C="".concat(I,"vw")}else if(b.endsWith("vh")){var U=C/this.window.innerHeight*100;C="".concat(U,"vh")}}if(D&&typeof D=="string"){if(D.endsWith("%")){var B=R/M.height*100;R="".concat(B,"%")}else if(D.endsWith("vw")){var I=R/this.window.innerWidth*100;R="".concat(I,"vw")}else if(D.endsWith("vh")){var U=R/this.window.innerHeight*100;R="".concat(U,"vh")}}var _={width:this.createSizeForCssProperty(C,"width"),height:this.createSizeForCssProperty(R,"height")};this.flexDir==="row"?_.flexBasis=_.width:this.flexDir==="column"&&(_.flexBasis=_.height);var X=this.state.width!==_.width,K=this.state.height!==_.height,F=this.state.flexBasis!==_.flexBasis,$=X||K||F;$&&ye.flushSync(function(){e.setState(_)}),this.props.onResize&&$&&this.props.onResize(t,m,this.resizable,P)}},a.prototype.onMouseUp=function(t){var e,r,l=this.state,n=l.isResizing,o=l.direction;l.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(t,o,this.resizable,this.delta),this.props.size&&this.setState({width:(e=this.props.size.width)!==null&&e!==void 0?e:"auto",height:(r=this.props.size.height)!==null&&r!==void 0?r:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Y(Y({},this.state.backgroundStyle),{cursor:"auto"})}))},a.prototype.updateSize=function(t){var e,r;this.setState({width:(e=t.width)!==null&&e!==void 0?e:"auto",height:(r=t.height)!==null&&r!==void 0?r:"auto"})},a.prototype.renderResizer=function(){var t=this,e=this.props,r=e.enable,l=e.handleStyles,n=e.handleClasses,o=e.handleWrapperStyle,p=e.handleWrapperClass,h=e.handleComponent;if(!r)return null;var v=Object.keys(r).map(function(u){return r[u]!==!1?i.jsx(dt,{direction:u,onResizeStart:t.onResizeStart,replaceStyles:l&&l[u],className:n&&n[u],children:h&&h[u]?h[u]:null},u):null});return i.jsx("div",{className:p,style:o,children:v})},a.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce(function(n,o){return mt.indexOf(o)!==-1||(n[o]=t.props[o]),n},{}),r=Y(Y(Y({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var l=this.props.as||"div";return i.jsxs(l,Y({style:r,className:this.props.className},e,{ref:function(n){n&&(t.resizable=n)},children:[this.state.isResizing&&i.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},a.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},a}(z.PureComponent);/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */var he=function(s,a){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},he(s,a)};function vt(s,a){he(s,a);function t(){this.constructor=s}s.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}var O=function(){return O=Object.assign||function(a){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(a[l]=t[l])}return a},O.apply(this,arguments)};function bt(s,a){var t={};for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&a.indexOf(e)<0&&(t[e]=s[e]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(s);r<e.length;r++)a.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(s,e[r])&&(t[e[r]]=s[e[r]]);return t}var yt={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},wt=function(s){return{bottom:s,bottomLeft:s,bottomRight:s,left:s,right:s,top:s,topLeft:s,topRight:s}},zt=function(s){vt(a,s);function a(t){var e=s.call(this,t)||this;return e.resizingPosition={x:0,y:0},e.offsetFromParent={left:0,top:0},e.resizableElement={current:null},e.originalPosition={x:0,y:0},e.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},e.onResizeStart=e.onResizeStart.bind(e),e.onResize=e.onResize.bind(e),e.onResizeStop=e.onResizeStop.bind(e),e.onDragStart=e.onDragStart.bind(e),e.onDrag=e.onDrag.bind(e),e.onDragStop=e.onDragStop.bind(e),e.getMaxSizesFromProps=e.getMaxSizesFromProps.bind(e),e}return a.prototype.componentDidMount=function(){this.updateOffsetFromParent();var t=this.offsetFromParent,e=t.left,r=t.top,l=this.getDraggablePosition(),n=l.x,o=l.y;this.draggable.setState({x:n-e,y:o-r}),this.forceUpdate()},a.prototype.getDraggablePosition=function(){var t=this.draggable.state,e=t.x,r=t.y;return{x:e,y:r}},a.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},a.prototype.getParentSize=function(){return this.resizable.getParentSize()},a.prototype.getMaxSizesFromProps=function(){var t=typeof this.props.maxWidth>"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,e=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:t,maxHeight:e}},a.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},a.prototype.getOffsetHeight=function(t){var e=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/e;case"body":return document.body.offsetHeight/e;default:return t.offsetHeight}},a.prototype.getOffsetWidth=function(t){var e=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/e;case"body":return document.body.offsetWidth/e;default:return t.offsetWidth}},a.prototype.onDragStart=function(t,e){if(this.props.onDragStart&&this.props.onDragStart(t,e)===!1)return!1;var r=this.getDraggablePosition();if(this.originalPosition=r,!!this.props.bounds){var l=this.getParent(),n=this.props.scale,o;if(this.props.bounds==="parent")o=l;else if(this.props.bounds==="body"){var p=l.getBoundingClientRect(),h=p.left,v=p.top,u=document.body.getBoundingClientRect(),m=-(h-l.offsetLeft*n-u.left)/n,x=-(v-l.offsetTop*n-u.top)/n,b=(document.body.offsetWidth-this.resizable.size.width*n)/n+m,D=(document.body.offsetHeight-this.resizable.size.height*n)/n+x;return this.setState({bounds:{top:x,right:b,bottom:D,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var M=l.getBoundingClientRect(),k=M.left,T=M.top,R=-(k-l.offsetLeft*n)/n,C=-(T-l.offsetTop*n)/n,b=(window.innerWidth-this.resizable.size.width*n)/n+R,D=(window.innerHeight-this.resizable.size.height*n)/n+C;return this.setState({bounds:{top:C,right:b,bottom:D,left:R}})}else typeof this.props.bounds=="string"?o=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(o=this.props.bounds);if(!(!(o instanceof HTMLElement)||!(l instanceof HTMLElement))){var E=o.getBoundingClientRect(),g=E.left,S=E.top,j=l.getBoundingClientRect(),N=j.left,W=j.top,L=(g-N)/n,P=S-W;if(this.resizable){this.updateOffsetFromParent();var B=this.offsetFromParent;this.setState({bounds:{top:P-B.top,right:L+(o.offsetWidth-this.resizable.size.width)-B.left/n,bottom:P+(o.offsetHeight-this.resizable.size.height)-B.top,left:L-B.left/n}})}}}},a.prototype.onDrag=function(t,e){if(this.props.onDrag){var r=this.offsetFromParent,l=r.left,n=r.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(t,O(O({},e),{x:e.x+l,y:e.y+n}));if(this.props.dragAxis==="x")return this.props.onDrag(t,O(O({},e),{x:e.x+l,y:this.originalPosition.y+n,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(t,O(O({},e),{x:this.originalPosition.x+l,y:e.y+n,deltaX:0}))}},a.prototype.onDragStop=function(t,e){if(this.props.onDragStop){var r=this.offsetFromParent,l=r.left,n=r.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(t,O(O({},e),{x:e.x+l,y:e.y+n}));if(this.props.dragAxis==="x")return this.props.onDragStop(t,O(O({},e),{x:e.x+l,y:this.originalPosition.y+n,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(t,O(O({},e),{x:this.originalPosition.x+l,y:e.y+n,deltaX:0}))}},a.prototype.onResizeStart=function(t,e,r){if(this.props.onResizeStart&&this.props.onResizeStart(t,e,r)===!1)return!1;t.stopPropagation(),this.setState({resizing:!0});var l=this.props.scale,n=this.offsetFromParent,o=this.getDraggablePosition();if(this.resizingPosition={x:o.x+n.left,y:o.y+n.top},this.originalPosition=o,this.props.bounds){var p=this.getParent(),h=void 0;this.props.bounds==="parent"?h=p:this.props.bounds==="body"?h=document.body:this.props.bounds==="window"?h=window:typeof this.props.bounds=="string"?h=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(h=this.props.bounds);var v=this.getSelfElement();if(v instanceof Element&&(h instanceof HTMLElement||h===window)&&p instanceof HTMLElement){var u=this.getMaxSizesFromProps(),m=u.maxWidth,x=u.maxHeight,b=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var D=Number(m.replace("%",""))/100;m=b.width*D}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(x&&typeof x=="string")if(x.endsWith("%")){var D=Number(x.replace("%",""))/100;x=b.height*D}else x.endsWith("px")&&(x=Number(x.replace("px","")));var M=v.getBoundingClientRect(),k=M.left,T=M.top,R=this.props.bounds==="window"?{left:0,top:0}:h.getBoundingClientRect(),C=R.left,E=R.top,g=this.getOffsetWidth(h),S=this.getOffsetHeight(h),j=e.toLowerCase().endsWith("left"),N=e.toLowerCase().endsWith("right"),W=e.startsWith("top"),L=e.startsWith("bottom");if((j||W)&&this.resizable){var P=(k-C)/l+this.resizable.size.width;this.setState({maxWidth:P>Number(m)?m:P})}if(N||this.props.lockAspectRatio&&!j&&!W){var P=g+(C-k)/l;this.setState({maxWidth:P>Number(m)?m:P})}if((W||j)&&this.resizable){var P=(T-E)/l+this.resizable.size.height;this.setState({maxHeight:P>Number(x)?x:P})}if(L||this.props.lockAspectRatio&&!W&&!j){var P=S+(E-T)/l;this.setState({maxHeight:P>Number(x)?x:P})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},a.prototype.onResize=function(t,e,r,l){var n=this,o={x:this.originalPosition.x,y:this.originalPosition.y},p=-l.width,h=-l.height,v=["top","left","topLeft","bottomLeft","topRight"];v.includes(e)&&(e==="bottomLeft"?o.x+=p:(e==="topRight"||(o.x+=p),o.y+=h));var u=this.draggable.state;(o.x!==u.x||o.y!==u.y)&&ye.flushSync(function(){n.draggable.setState(o)}),this.updateOffsetFromParent();var m=this.offsetFromParent,x=this.getDraggablePosition().x+m.left,b=this.getDraggablePosition().y+m.top;this.resizingPosition={x,y:b},this.props.onResize&&this.props.onResize(t,e,r,l,{x,y:b})},a.prototype.onResizeStop=function(t,e,r,l){this.setState({resizing:!1});var n=this.getMaxSizesFromProps(),o=n.maxWidth,p=n.maxHeight;this.setState({maxWidth:o,maxHeight:p}),this.props.onResizeStop&&this.props.onResizeStop(t,e,r,l,this.resizingPosition)},a.prototype.updateSize=function(t){this.resizable&&this.resizable.updateSize({width:t.width,height:t.height})},a.prototype.updatePosition=function(t){this.draggable.setState(t)},a.prototype.updateOffsetFromParent=function(){var t=this.props.scale,e=this.getParent(),r=this.getSelfElement();if(!e||r===null)return{top:0,left:0};var l=e.getBoundingClientRect(),n=l.left,o=l.top,p=r.getBoundingClientRect(),h=this.getDraggablePosition(),v=e.scrollLeft,u=e.scrollTop;this.offsetFromParent={left:p.left-n+v-h.x*t,top:p.top-o+u-h.y*t}},a.prototype.render=function(){var t=this,e=this.props,r=e.disableDragging,l=e.style,n=e.dragHandleClassName,o=e.position,p=e.onMouseDown,h=e.onMouseUp,v=e.dragAxis,u=e.dragGrid,m=e.bounds,x=e.enableUserSelectHack,b=e.cancel,D=e.children;e.onResizeStart,e.onResize,e.onResizeStop,e.onDragStart,e.onDrag,e.onDragStop;var M=e.resizeHandleStyles,k=e.resizeHandleClasses,T=e.resizeHandleComponent,R=e.enableResizing,C=e.resizeGrid,E=e.resizeHandleWrapperClass,g=e.resizeHandleWrapperStyle,S=e.scale,j=e.allowAnyClick,N=e.dragPositionOffset,W=bt(e,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),L=this.props.default?O({},this.props.default):void 0;delete W.default;var P=r||n?{cursor:"auto"}:{cursor:"move"},B=O(O(O({},yt),P),l),I=this.offsetFromParent,U=I.left,_=I.top,X;o&&(X={x:o.x-U,y:o.y-_});var K=this.state.resizing?void 0:X,F=this.state.resizing?"both":v;return z.createElement(Ge,{ref:function($){$&&(t.draggable=$)},handle:n?".".concat(n):void 0,defaultPosition:L,onMouseDown:p,onMouseUp:h,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:F,disabled:r,grid:u,bounds:m?this.state.bounds:void 0,position:K,enableUserSelectHack:x,cancel:b,scale:S,allowAnyClick:j,nodeRef:this.resizableElement,positionOffset:N},z.createElement(xt,O({},W,{ref:function($){$&&(t.resizable=$,t.resizableElement.current=$.resizable)},defaultSize:L,size:this.props.size,enable:typeof R=="boolean"?wt(R):R,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:B,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:C,handleWrapperClass:E,handleWrapperStyle:g,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:M,handleClasses:k,handleComponent:T,scale:this.props.scale}),D))},a.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},a}(z.PureComponent);const St=({isOpen:s,onClose:a,expiryDate:t,documentId:e})=>{const[r,l]=z.useState([]),[n,o]=z.useState(!1),[p,h]=z.useState(null);z.useState(t||""),z.useEffect(()=>{s&&v()},[s]);const v=async()=>{var m,x;o(!0),h(null);try{const b=await Ze(e);(m=b==null?void 0:b.data)!=null&&m.$values&&l((x=b==null?void 0:b.data)==null?void 0:x.$values)}catch(b){console.error(b),h("Failed to load sign links. Please try again."),l([])}finally{o(!1)}},u=m=>{navigator.clipboard.writeText(m),q.success("Link copied to clipboard!")};return i.jsx(Xe,{isOpen:s,onClose:a,closable:!0,width:"70vw",height:"80vh",contentClassName:"p-6",children:i.jsxs("div",{className:"space-y-6 mx-auto",children:[i.jsx("h3",{className:"text-xl font-semibold mb-1",children:"Sign Links"}),i.jsx("p",{className:"text-gray-600",children:"Copy each sign link and share with the respective parties:"}),n&&i.jsx("p",{className:"text-gray-500",children:"Loading sign links..."}),p&&i.jsx("p",{className:"text-red-500",children:p}),!n&&!p&&r.length>0&&i.jsx("div",{className:"space-y-6",children:r.map((m,x)=>i.jsxs("div",{className:"border-b pb-4",children:[i.jsxs("p",{className:"custom-text-600 mb-2",children:[x+1,"st Party:"," ",i.jsx("span",{className:"font-normal",children:m.name||"-"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(le,{type:"text",prefix:i.jsx("span",{className:"ml-4",children:"Sign link:"}),suffix:i.jsx(J,{size:"sm",variant:"solid",icon:i.jsx(rt,{}),onClick:()=>u(m.signingUrl),children:"Copy link"}),readOnly:!0,value:m.signingUrl,className:"flex-1 border rounded-md px-3 py-2 text-sm bg-gray-50"})})]},m.id||x))})]})})},jt=St;Fe.workerSrc=`https://unpkg.com/pdfjs-dist@${Be}/build/pdf.worker.min.mjs`;const Nt=[{type:"text",label:"Text Field"},{type:"signature",label:"Signature"},{type:"date",label:"Date"},{type:"initials",label:"Initials"}],oe={text:1,initials:2,signature:3,date:4},Dt=({field:s})=>{const[,a]=ot(()=>({type:"FIELD",item:{fieldType:s.type}}));return i.jsx("div",{ref:a,className:"cursor-move px-3 py-2 mb-2 rounded-md border text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100 bg-white",children:s.label})},Rt=({field:s,scale:a,onMove:t,onResize:e,onRequestOpenAssignMenu:r,onRemoveField:l,onSign:n,onEditText:o})=>{var v;const p=z.useRef(null),h=()=>{const u=Math.max(10,Math.round(s.height*a/3)),m=Math.max(.4,Math.min(1.2,s.height/40));if(s.fieldType==="signature"&&s.signatureData)return i.jsx("img",{src:s.signatureData,alt:"Signature",style:{maxHeight:`${s.height*a*.9}px`,maxWidth:`${s.width*a*.9}px`,transform:`scale(${m})`,transformOrigin:"center"},className:"mx-auto object-contain"});if(s.fieldType==="initials"){if(s.signatureData)return i.jsx("img",{src:s.signatureData,alt:"Initials",style:{maxHeight:`${s.height*a*.9}px`,maxWidth:`${s.width*a*.9}px`,transform:`scale(${m})`,transformOrigin:"center"},className:"mx-auto object-contain"});if(s.assignedUser){const x=s.assignedUser.name.split(" ").map(b=>b[0]).join("").toUpperCase();return i.jsx("div",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:x})}else return i.jsx("div",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:"Initials"})}return s.fieldType==="text"?i.jsx("div",{className:"font-semibold text-gray-700 cursor-text flex items-center justify-center w-full h-full text-center",style:{fontSize:u},children:s.textValue||"Enter Text"}):s.fieldType==="date"?i.jsx("div",{className:"font-semibold text-gray-700 cursor-pointer flex items-center justify-center w-full h-full text-center",style:{fontSize:u},children:s.textValue||"Pick Date"}):i.jsx("span",{className:"font-semibold text-gray-700 flex items-center justify-center",style:{fontSize:u},children:s.fieldType.toUpperCase()})};return i.jsx(zt,{size:{width:s.width*a,height:s.height*a},position:{x:s.x*a,y:s.y*a},onDragStop:(u,m)=>t(s.id,m.x/a,m.y/a),onResize:(u,m,x,b,D)=>e(s.id,x.offsetWidth/a,x.offsetHeight/a,D.x/a,D.y/a),bounds:"parent",enableResizing:{bottomRight:!0,bottomLeft:!0,topRight:!0,topLeft:!0},style:{border:`2px dashed ${((v=s.assignedUser)==null?void 0:v.color)||"#888"}`,backgroundColor:"rgba(255,255,255,0.9)",borderRadius:"6px",padding:4},className:"group z-[5]",children:i.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full relative text-center",children:[h(),i.jsxs("div",{className:"absolute -top-8 right-0 bg-white border rounded-md shadow-md flex items-center gap-1 p-1",onClick:u=>u.stopPropagation(),children:[i.jsx("button",{ref:p,className:"text-xs px-2 py-0.5 rounded hover:bg-gray-100 flex items-center gap-1",onClick:u=>{var x;u.stopPropagation();const m=(x=p.current)==null?void 0:x.getBoundingClientRect();r(s.id,m??null)},children:s.assignedUser?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{background:s.assignedUser.color}}),i.jsx("span",{children:s.assignedUser.name})]}):"Assign"}),i.jsx("button",{onClick:()=>l(s.id),className:"text-gray-500 text-xs font-bold px-2 py-0.5 rounded hover:bg-gray-100",children:"🗑"})]})]})})},Pt=({visible:s,onClose:a,parties:t=[],setParties:e,onSubmit:r,onSend:l})=>{const[n,o]=z.useState([]),[p,h]=z.useState(null),[v,u]=z.useState(null);z.useEffect(()=>{s&&t&&o([...t])},[s,t]);const m=(E,g)=>{h(g),E.dataTransfer.effectAllowed="move",E.dataTransfer.setData("text/html",E.target.outerHTML),E.target.style.opacity="0.5"},x=E=>{E.target.style.opacity="1",h(null),u(null)},b=E=>{E.preventDefault(),E.dataTransfer.dropEffect="move"},D=(E,g)=>{E.preventDefault(),u(g)},M=()=>{u(null)};let k=null;const T=(E,g)=>{if(E.preventDefault(),p===null||p===g)return;const S=[...n],j=S[p];S.splice(p,1),S.splice(g,0,j),o(S),e(S),h(null),u(null),k&&clearTimeout(k),k=setTimeout(()=>{r(S)},1e3)},R=z.useCallback(()=>{l()},[]),C=z.useCallback(()=>{o([...t]),a()},[t,a]);return s?i.jsx("div",{className:"fixed inset-0 bg-black/40 flex justify-end z-50",children:i.jsxs("div",{className:"bg-white w-[500px] h-full p-5 flex flex-col shadow-lg",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Signing Order"}),i.jsxs("span",{className:"text-sm text-gray-500",children:[n.length," ",n.length===1?"party":"parties"]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("p",{className:"text-xs text-gray-500",children:n.length>0?"Drag and drop to reorder signing sequence":"Add parties first to set signing order"})}),n.length===0?i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center text-gray-500",children:[i.jsx("p",{className:"text-lg mb-2",children:"No parties added yet"}),i.jsx("p",{className:"text-sm",children:"Add some parties to set signing order"})]})}):i.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:i.jsx("div",{className:"space-y-3",children:n.map((E,g)=>{var S,j;return i.jsxs("div",{draggable:!0,onDragStart:N=>m(N,g),onDragEnd:x,onDragOver:b,onDragEnter:N=>D(N,g),onDragLeave:M,onDrop:N=>T(N,g),className:`
|
|
15
|
+
flex items-center justify-between rounded-lg px-4 py-3 border-2 transition-all duration-200 cursor-grab active:cursor-grabbing
|
|
16
|
+
${p===g?"bg-blue-50 border-blue-300 opacity-50":v===g?"bg-green-50 border-green-300 transform scale-105":"bg-gray-50 border-gray-200 hover:bg-gray-100 hover:border-gray-300"}
|
|
17
|
+
`,children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-0.5 text-gray-400 cursor-grab",children:[i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"}),i.jsx("div",{className:"w-1 h-1 bg-current rounded-full"})]})]}),i.jsx("div",{style:{backgroundColor:E.color||"#6b7280"},className:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0 shadow-sm",children:((j=(S=E.name)==null?void 0:S.charAt(0))==null?void 0:j.toUpperCase())||"?"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"font-semibold text-gray-900 text-sm truncate",children:E.name||"Unknown"}),i.jsx("div",{className:"text-xs text-gray-500 truncate",children:E.email||"No email"})]})]}),i.jsx("div",{className:"flex-shrink-0 ml-3",children:i.jsxs("div",{className:`
|
|
18
|
+
w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold
|
|
19
|
+
${p===g?"bg-blue-500 text-white":"bg-gray-200 text-gray-700"}
|
|
20
|
+
`,children:["#",g+1]})})]},`${E.email}_${g}`)})})}),i.jsx("div",{className:"mt-6 pt-4 border-t border-gray-200",children:i.jsxs("div",{className:"flex justify-between gap-3",children:[i.jsx(J,{size:"sm",className:"ltr:mr-3 rtl:ml-3",onClick:C,children:"Cancel"}),i.jsx(J,{variant:"solid",size:"sm",onClick:R,disabled:n.length===0,children:"Send to Signers (Email)"})]})})]})}):null},be=850,Et=({fields:s,setFields:a,numPages:t,scale:e,users:r,onOpenSignature:l,onOpenTextEditor:n})=>{const o=z.useRef([]),p=z.useRef(null),[h,v]=z.useState({open:!1,x:0,y:0,fieldId:null}),[u,m]=z.useState(null),x=u?Math.max(.4,(u-32)/be):e,b=z.useRef(x);z.useEffect(()=>{b.current=x},[x]),z.useEffect(()=>{const g=p.current;if(!g)return;const S=new ResizeObserver(j=>{for(const N of j)m(N.contentRect.width)});return S.observe(g),()=>S.disconnect()},[]);const[,D]=lt(()=>({accept:"FIELD",drop:(g,S)=>{var W;const j=S.getClientOffset();if(!j)return;const N=b.current;for(let L=0;L<o.current.length;L++){const P=(W=o.current[L])==null?void 0:W.getBoundingClientRect();if(P&&j.y>=P.top&&j.y<=P.bottom){let U=(j.x-P.left)/N-75,_=(j.y-P.top)/N-20/2;U=Math.max(0,Math.min(U,P.width/N-150)),_=Math.max(0,Math.min(_,P.height/N-20));const X=`${g.fieldType}_${Date.now()}`;a(K=>[...K,{id:X,x:U,y:_,width:150,height:20,fieldType:g.fieldType,assignedUser:null,signatureData:null,textValue:"",pageNumber:L+1,pageWidth:P.width/N,pageHeight:P.height/N}]);break}}}})),M=(g,S,j)=>a(N=>N.map(W=>W.id===g?{...W,x:S,y:j}:W)),k=(g,S,j,N,W)=>a(L=>L.map(P=>P.id===g?{...P,width:S,height:j,x:N,y:W}:P)),T=g=>a(S=>S.filter(j=>j.id!==g)),R=(g,S)=>{if(!S){v({open:!0,x:window.innerWidth/2-80,y:window.innerHeight/2-40,fieldId:g});return}v({open:!0,x:S.left,y:S.bottom,fieldId:g})},C=()=>v({open:!1,x:0,y:0,fieldId:null}),E=(g,S)=>{a(j=>j.map(N=>N.id===g?{...N,assignedUser:S}:N)),C()};return i.jsxs("div",{ref:g=>{D(g),p.current=g},className:"relative bg-gray-50 border border-gray-300 rounded-lg overflow-auto h-[88vh] p-4",children:[Array.from({length:t}).map((g,S)=>i.jsxs("div",{ref:j=>o.current[S]=j,className:"relative mb-6 flex justify-center",children:[i.jsx(Ue,{pageNumber:S+1,width:be*x,renderTextLayer:!1,renderAnnotationLayer:!1}),s.filter(j=>j.pageNumber===S+1).map(j=>i.jsx(Rt,{field:j,scale:x,onMove:M,onResize:k,onRequestOpenAssignMenu:(N,W)=>R(N,W),onRemoveField:T,onSign:(N,W,L)=>l(N,W,L),onEditText:(N,W)=>n(N,W)},j.id))]},S)),h.open&&i.jsx("div",{onClick:g=>g.stopPropagation(),className:"absolute z-50 fixed",style:{top:h.y+6,left:h.x,width:180},children:i.jsxs("div",{className:"bg-white border rounded shadow-md py-1",children:[i.jsx("div",{className:"px-2 py-1 text-xs text-gray-500",children:"Assign to"}),r==null?void 0:r.map(g=>i.jsxs("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-sm flex items-center gap-2",onClick:()=>E(h.fieldId,g),children:[i.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{background:g.color}}),i.jsx("div",{className:"flex flex-col",children:i.jsx("span",{className:"text-sm",children:g.name})})]},g.email)),i.jsx("div",{className:"px-2 py-2 border-t flex justify-end",children:i.jsx(J,{size:"sm",variant:"plain",className:"text-xs text-gray-500",onClick:C,children:"Close"})})]})})]})};function as(){const[s,a]=z.useState(null),[t,e]=z.useState([]),[r,l]=z.useState(1),[n,o]=z.useState([]),[p,h]=z.useState(!1),[v,u]=z.useState({visible:!1,fieldId:null,user:null,type:null}),[m,x]=z.useState({visible:!1,fieldId:null,value:""}),[b,D]=z.useState({name:"",email:""}),M=Ae(),[k,T]=z.useState(!1),[R,C]=z.useState({name:"",email:""}),[E,g]=z.useState("2026-01-25"),[S,j]=z.useState(!1),[N,W]=z.useState(!1),[L,P]=z.useState(null),[B,I]=z.useState(null),[U,_]=z.useState(!1),X=z.useRef(!1),K=Oe(),F=M.pathname.substring(M.pathname.lastIndexOf("/")+1);z.useEffect(()=>{const d=f=>u({visible:!0,fieldId:f.detail.id,user:f.detail.user,type:f.detail.type}),y=f=>x({visible:!0,fieldId:f.detail.id,value:f.detail.text});return window.addEventListener("openSignaturePad",d),window.addEventListener("openTextEditor",y),()=>{window.removeEventListener("openSignaturePad",d),window.removeEventListener("openTextEditor",y)}},[]),z.useEffect(()=>{const d=f=>u({visible:!0,fieldId:f.detail.id,user:f.detail.user,type:f.detail.type}),y=f=>x({visible:!0,fieldId:f.detail.id,value:f.detail.text});return window.addEventListener("openSignaturePad",d),window.addEventListener("openTextEditor",y),()=>{window.removeEventListener("openSignaturePad",d),window.removeEventListener("openTextEditor",y)}},[]);const $=async()=>{T(!0);try{const d=await st(F);if(d instanceof Blob){const y=URL.createObjectURL(d);a(y)}else console.error("Unexpected response type:",d),a(null)}catch(d){console.error("Error fetching document:",d),a(null)}finally{T(!1)}},ae=async()=>{var d,y,f,w;try{const c=await ue(F);if((y=(d=c==null?void 0:c.data)==null?void 0:d.finalResults)!=null&&y.$values){const A=((w=(f=c==null?void 0:c.data)==null?void 0:f.finalResults)==null?void 0:w.$values)||[];o(A);const V=A.length>0&&A.every(Q=>Q.status==="Signed");_(V)}}catch(c){console.error("Failed to fetch parties:",c),o([]),_(!1)}},we=(d,y)=>d.map(f=>{var A;let w=String(f.fieldType).toLowerCase();w==="1"||w==="text"?w="text":w==="2"||w==="initials"?w="initials":w==="3"||w==="signature"?w="signature":w==="4"||w==="date"?w="date":w="text";const c=f.assignedPartyId?{id:f.assignedPartyId,name:f.assignedParty,color:((A=y.find(V=>V.id===f.assignedPartyId))==null?void 0:A.color)||"#3b82f6"}:null;return{id:f.id,x:f.positionX,y:f.positionY,width:f.width,height:f.height,pageNumber:f.pageNumber,fieldType:w,assignedUser:c,textValue:f.placeholderText||"",signatureData:f.signatureData||null,pageWidth:f.pageWidth,pageHeight:f.pageHeight}}),ze=async()=>{var d,y,f,w;try{const c=await it(F);(y=(d=c==null?void 0:c.data)==null?void 0:d.finalResults)!=null&&y.$values&&(X.current=!0,e(we((w=(f=c==null?void 0:c.data)==null?void 0:f.finalResults)==null?void 0:w.$values,n)))}catch(c){console.error("Failed to fetch parties:",c),e([])}};z.useEffect(()=>{(async()=>{$(),await ae(),await ze()})()},[F]);const de=async(d,y,f)=>{var w,c;try{const A=y==null?void 0:y.map((V,Q)=>({partyId:V.id,signingOrder:Q+1}));await Je(F,A),q.push(i.jsx(Z,{title:"Success",type:"success",children:"Parties signing order saved successfully!"}))}catch(A){console.error("Error saving parties:",A),q.push(i.jsx(Z,{title:"Error",type:"danger",children:((c=(w=A==null?void 0:A.response)==null?void 0:w.data)==null?void 0:c.message)??"Failed to save parties. Please try again."}))}},Se=async d=>{var y,f;try{await Ke(F),q.push(i.jsx(Z,{title:"Success",type:"success",children:"Document sent successfully!"})),d(!1)}catch(w){console.error("Error saving parties:",w),q.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to sent parties. Please try again."}))}},je=async d=>{var y,f;try{await Qe(d),q.push(i.jsx(Z,{title:"Success",type:"success",children:"Party Deleted successfully!"})),ae()}catch(w){console.error("Error saving parties:",w),q.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to delete parties. Please try again."}))}},Ne=async d=>{var y,f;try{let w=d==null?void 0:d.map(c=>{var A;return{fieldType:oe==null?void 0:oe[c==null?void 0:c.fieldType],fieldName:c==null?void 0:c.id,pageNumber:c==null?void 0:c.pageNumber,positionX:c==null?void 0:c.x,positionY:c==null?void 0:c.y,width:c==null?void 0:c.width,height:c==null?void 0:c.height,assignedPartyId:c!=null&&c.assignedUser?(A=c==null?void 0:c.assignedUser)==null?void 0:A.id:null,pageWidth:c==null?void 0:c.pageWidth,pageHeight:c==null?void 0:c.pageHeight}});await et(F,w),h(!1)}catch(w){console.error("Error saving fields:",w),q.push(i.jsx(Z,{title:"Error",type:"danger",children:((f=(y=w==null?void 0:w.response)==null?void 0:y.data)==null?void 0:f.message)??"Failed to save fields. Please try again."}))}},De=d=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d),Re=async()=>{var w,c,A,V,Q,pe;const d={name:"",email:""};if(b.name.trim()||(d.name="Name is required"),b.email.trim()?De(b.email.trim())||(d.email="Invalid email address"):d.email="Email is required",C(d),d.name||d.email)return;const y="#"+Math.floor(Math.random()*16777215).toString(16),f={...b,color:y};try{await tt(F,f);const G=await ue(F);(c=(w=G==null?void 0:G.data)==null?void 0:w.finalResults)!=null&&c.$values&&o(((V=(A=G==null?void 0:G.data)==null?void 0:A.finalResults)==null?void 0:V.$values)||[]),D({name:"",email:""}),C({name:"",email:""})}catch(G){console.error("Error adding party:",G);const He=((pe=(Q=G==null?void 0:G.response)==null?void 0:Q.data)==null?void 0:pe.message)||"Failed to add party";q.push(i.jsx(Z,{title:"Error",type:"danger",children:He}))}},Pe=(d,y,f)=>{u({visible:!0,fieldId:d,user:y,type:f})},Ee=(d,y)=>{x({visible:!0,fieldId:d,value:y})};z.useEffect(()=>{if(!(t!=null&&t.length))return;if(X.current){X.current=!1;return}const d=setTimeout(()=>{Ne(t)},2e3);return()=>clearTimeout(d)},[t]);const Ce=(d,y)=>{P(y),d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/plain",String(y)),d.currentTarget.style.opacity="0.5"},We=d=>{d.currentTarget.style.opacity="1",P(null),I(null)},Me=d=>{d.preventDefault(),d.dataTransfer.dropEffect="move"},ke=(d,y)=>{d.preventDefault(),I(y)},Le=()=>{I(null)},Te=(d,y)=>{if(d.preventDefault(),L===null||L===y)return;const f=[...n],w=f[L];f.splice(L,1),f.splice(y,0,w),o(f),de(null,f),P(null),I(null)};return i.jsxs(i.Fragment,{children:[k&&i.jsx("div",{className:"flex justify-center items-center absolute inset-0 bg-gray-300 bg-opacity-20 z-50",children:i.jsx(Ye,{loading:!0})}),s?i.jsxs(Ie,{backend:$e,children:[i.jsxs("div",{className:"flex bg-white rounded-lg shadow-lg overflow-hidden h-[90vh]",children:[i.jsxs("div",{className:"w-[20%] border-r bg-gray-100 p-4 flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-gray-700",children:"Fields"}),i.jsxs(J,{size:"sm",variant:"solid",onClick:()=>K("/app/pages/signature/documents"),className:"transition-all duration-300 group hover:pr-8 hover:w-auto",children:[i.jsx(qe,{size:24}),i.jsx("span",{className:"opacity-0 max-w-0 transition-all duration-300 group-hover:opacity-100 group-hover:max-w-xs whitespace-nowrap",children:"Back"})]})]}),Nt.map(d=>i.jsx(Dt,{field:d},d.type)),(t==null?void 0:t.length)>0&&i.jsx("div",{onClick:()=>e([]),className:"cursor-move px-3 py-2 mb-2 border-t-custom-50 rounded-md border text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100",children:!U&&i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ce,{color:"red",size:18}),i.jsx("span",{children:" Clear all Fields"})]})}),i.jsx("h3",{className:"font-semibold text-gray-700 mt-6 mb-2",children:"Parties"}),i.jsx("div",{className:"space-y-2 max-h-54 overflow-auto mb-3",children:n==null?void 0:n.map((d,y)=>{var f,w;return i.jsxs("div",{draggable:!0,onDragStart:c=>Ce(c,y),onDragEnd:We,onDragOver:Me,onDragEnter:c=>ke(c,y),onDragLeave:Le,onDrop:c=>Te(c,y),className:`
|
|
21
|
+
flex items-center justify-between rounded px-3 py-2 border cursor-grab
|
|
22
|
+
${L===y?"bg-blue-50 border-blue-300 opacity-50":B===y?"bg-green-50 border-green-300 scale-[1.02]":"bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300"}
|
|
23
|
+
`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{style:{background:d.color||"#f3741c"},className:"w-8 h-8 rounded flex items-center justify-center text-white font-semibold",children:(w=(f=d.name)==null?void 0:f.slice(0,1))==null?void 0:w.toUpperCase()}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-medium",children:d.name}),i.jsx("div",{className:"text-xs text-gray-500",children:d.email})]})]}),!U&&i.jsx("button",{className:"text-red-500 text-sm",onClick:()=>je(d.id),children:i.jsx(ce,{size:18})})]},d.id)})}),!U&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mt-2 space-y-2",children:[i.jsx(le,{className:`border rounded px-2 py-1 text-xs w-full ${R.name?"border-red-500":""}`,placeholder:"Name",required:!0,value:b.name,onChange:d=>D({...b,name:d.target.value})}),R.name&&i.jsx("p",{className:"text-red-500 text-[11px] -mt-1",children:R.name}),i.jsx(le,{className:`border rounded px-2 py-1 text-xs w-full ${R.email?"border-red-500":""}`,placeholder:"Email",required:!0,value:b.email,onChange:d=>D({...b,email:d.target.value})}),R.email&&i.jsx("p",{className:"text-red-500 text-[11px] -mt-1",children:R.email}),i.jsx(J,{variant:"solid",size:"sm",className:"w-full text-xs py-1",onClick:Re,children:"Add Party"})]}),i.jsxs("div",{className:"mt-auto pt-3 border-t space-y-2",children:[i.jsx(J,{className:"w-full text-sm",size:"sm",variant:"solid",disabled:(n==null?void 0:n.length)===0,onClick:()=>h(!0),children:"Send To Signers (Email)"}),i.jsx(J,{className:"w-full text-sm",size:"sm",variant:"solid",disabled:(n==null?void 0:n.length)===0,onClick:()=>j(!0),children:"Generate Links"})]})]})]}),i.jsx("div",{className:"flex-1 min-w-0 p-4",children:i.jsx(_e,{file:s,onLoadSuccess:({numPages:d})=>l(d),loading:"Loading PDF...",children:i.jsx(Et,{fields:n.length>0?t:[],setFields:e,numPages:r,scale:1.5,users:n,onOpenSignature:Pe,onOpenTextEditor:Ee})})})]}),i.jsx(Pt,{visible:p,onClose:()=>h(!1),parties:n,setParties:o,onSubmit:d=>de(t,d),onSend:()=>Se(()=>h(!1))}),i.jsx(jt,{isOpen:S,onClose:()=>j(!1),signLinks:n,documentId:F,expiryDate:E,onUpdateDate:d=>g(d)}),i.jsxs("button",{className:"fixed bottom-10 right-10 z-0 flex items-center gap-2 bg-custom-500 text-white rounded-full shadow-lg px-5 py-3 transition-all duration-300 group hover:pr-8 hover:w-auto",onClick:()=>W(!0),children:[i.jsx(at,{size:24,className:"min-w-6"}),i.jsx("span",{className:"opacity-0 max-w-0 overflow-hidden transition-all duration-300 group-hover:opacity-100 group-hover:max-w-xs whitespace-nowrap",children:"Document Activity"})]})]}):i.jsx(i.Fragment,{children:k?"":"No Pdf Found"}),i.jsx(Ve,{title:"Document Activity",isOpen:N,onClose:()=>W(!1),portalClassName:"w30",children:i.jsx(nt,{documentId:F})})]})}export{as as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,l as ce}from"./vendor-mui-98daa63f.js";import{A as J}from"./AdaptableCard-3d1e1f96.js";import{P as Oe}from"./PageBreadcrumb-cf54a6e9.js";import{r as a,c as de,f as me,L as Pe}from"./vendor-react-ece1c85f.js";import{b as ue,c as qe,a as Ve}from"./vendor-redux-a1f00e6b.js";import{p as _e,q as Ye,r as Ge,s as Xe,t as He,h as Ze,u as Ke,v as We,w as Je,x as Qe}from"./DigitalSignature-69eaf80c.js";import{_ as et,a0 as O,r as tt,B as T,H as at,D as pe,k as fe,l as he,ai as ge,d as xe,E as S,F as C}from"./index-3b5ce20a.js";import{T as I,A as ye}from"./actioncell-6b5ebd6c.js";import{D as be}from"./tableV2-99c808c0.js";import"./Alert-59d09a99.js";import"./index-7596c6bb.js";import"./index-a14e51de.js";import{D as _}from"./Drawer-4f97e662.js";import{a as ne}from"./FormContainer-9a52b9e8.js";import"./Switcher-e2fba588.js";import"./index-289b3fd9.js";import{U as je}from"./Upload-be937eb6.js";import{c as ee,a as X,i as De,h as st,F as te,b as ae,d as L,E as Q}from"./index.esm-b2d342b5.js";import{S as Se}from"./StickyFooter-3e569b80.js";import{A as lt}from"./DocumentActivity-bc938c61.js";import{C as Ce}from"./ConfirmDialog-2838a642.js";import"./vendor-pdf-3c29882d.js";import"./vendor-devex-4076ffeb.js";import"./vendor-i18n-b89304ef.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-4be0b5ab.js";import"./FileSaver.min-20f3f13a.js";import"./DensitySelector-5d2e901f.js";import"./NoData-4cc4af03.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-de319a18.js";import"./DateDifference-e47d2393.js";const se="SignatureData",Y=ue(`${se}/getDocumentsData`,async i=>(await _e()).data),G=ue(`${se}/getDocumentsTemplates`,async()=>(await Ye()).data),it={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},nt={loading:!1,deleteConfirmation:!1,selectedRowData:"",tableData:it,filterData:{parentAccount:"",primaryContact:"",billingContact:""},accountList:[],contactList:[],documentList:[],DocumentTemplate:[]},we=qe({name:`${se}`,initialState:nt,reducers:{setTableData:(i,s)=>{i.tableData=s.payload},setFilterData:(i,s)=>{i.filterData=s.payload},toggleDeleteConfirmation:(i,s)=>{i.deleteConfirmation=s.payload},setSelectedRowData:(i,s)=>{i.selectedRowData=s.payload}},extraReducers:i=>{i.addCase(Y.fulfilled,(s,c)=>{var f,h,m,u;console.log("action.payload",(h=(f=c.payload)==null?void 0:f.finalResults)==null?void 0:h.$values),s.documentList=(u=(m=c.payload)==null?void 0:m.finalResults)==null?void 0:u.$values,s.loading=!1}).addCase(Y.pending,s=>{s.loading=!0}).addCase(Y.rejected,(s,c)=>{s.documentList=[]}).addCase(G.fulfilled,(s,c)=>{var f,h;s.DocumentTemplate=(h=(f=c.payload)==null?void 0:f.finalResults)==null?void 0:h.$values,s.loading=!1}).addCase(G.pending,s=>{s.loading=!0}).addCase(G.rejected,(s,c)=>{s.DocumentTemplate=[]})}}),{setTableData:Kt,setFilterData:Wt,toggleDeleteConfirmation:Ne,setSelectedRowData:Fe}=we.actions,ot=we.reducer,Te=Ve({data:ot}),U=et,oe=1,rt=ee({title:X().required("Title is required"),files:De().of(st()).test("file-or-template","Please either upload a file or select a template",function(i){const c=((this==null?void 0:this.parent)||{}).templateId,f=Array.isArray(i)&&i.length>0,h=c!=null&&c!=="";return f||h}),templateId:X().nullable()}),ct=({initialData:i={files:[],title:"",templateId:null},onSubmit:s,onCancel:c,type:f="Add"})=>{const h=["application/pdf"],[m,u]=a.useState([]);a.useEffect(()=>{(async()=>{var r,x,p,b,o,g,D;try{const j=await Ge();(p=(x=(r=j==null?void 0:j.data)==null?void 0:r.data)==null?void 0:x.finalResults)!=null&&p.$values&&u((D=(g=(o=(b=j.data)==null?void 0:b.data)==null?void 0:o.finalResults)==null?void 0:g.$values)==null?void 0:D.map(F=>({id:F.id,name:F.templateName})))}catch(j){console.error("Failed to load filter options",j)}})()},[]);const N=(d,r)=>{let x=!0;const p=1e7;if(r.length>=oe)return`You can only upload ${oe} file(s)`;if(d)for(const b of d)h.includes(b.type)?b.size>=p&&(x="Upload file cannot be more than 10MB!"):x="Only PDF files are allowed!";return x};return e.jsx(te,{initialValues:{...i},validationSchema:rt,onSubmit:(d,{setSubmitting:r})=>{s(d,r)},children:({values:d,setFieldValue:r,touched:x,errors:p,isSubmitting:b})=>e.jsx(ae,{children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title*"}),e.jsx(L,{name:"title",children:({field:o})=>e.jsx(O,{...o,placeholder:"File title"})}),e.jsx(Q,{name:"title",component:"div",className:"text-red-600"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select Template"}),e.jsx(tt,{options:m.map(o=>({label:o.name,value:o.id})),isMulti:!1,value:d.templateId?m.map(o=>({label:o.name,value:o.id})).find(o=>o.value===d.templateId):null,onChange:o=>{r("templateId",(o==null?void 0:o.value)||null),r("files",[])},isDisabled:d.files&&d.files.length>0,className:"rounded-md",styles:{input:o=>({...o,color:"black"})}}),e.jsx(Q,{name:"templateId",component:"div",className:"text-red-600"})]}),e.jsx("p",{className:"text-center",children:"OR"}),e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload File"}),e.jsx(L,{name:"files",children:({field:o,form:g})=>e.jsx(je,{draggable:!0,accept:h,beforeUpload:N,fileList:d.files||[],disabled:!!d.templateId,onChange:D=>{r("files",D),r("templateId",null)},onFileRemove:D=>g.setFieldValue(o.name,D)})}),p.files&&x.files&&e.jsx("div",{className:"text-red-500 text-sm mt-1",children:p.files})]}),e.jsx(Se,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(T,{size:"sm",className:"mr-2",onClick:c,children:"Cancel"}),e.jsx(T,{size:"sm",variant:"solid",type:"submit",loading:b,children:"Save"})]})})]})})})},dt=ee().shape({fileName:X().required("Name is required")}),mt=({isOpen:i,onClose:s,onSubmit:c,loading:f,FileName:h})=>e.jsx(at,{isOpen:i,onClose:s,contentClassName:"pb-0 px-0",className:"my-4",children:e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"px-6",children:"Save Template"}),e.jsx(te,{initialValues:{fileName:h??"",description:""},validationSchema:dt,onSubmit:m=>{c(m)},children:({errors:m,touched:u})=>e.jsxs(ae,{className:"px-6 pb-6 pt-4 gap-2",children:[e.jsx(ne,{label:"Template Name",asterisk:!0,invalid:!!m.fileName&&u.fileName,errorMessage:m.fileName,children:e.jsx(L,{type:"text",name:"fileName",className:"mt-2",placeholder:"Template Name",component:O,errors:m,touched:u})}),e.jsx(ne,{label:"Description",invalid:!!m.description&&u.description,errorMessage:m.description,children:e.jsx(L,{type:"text",textArea:!0,name:"description",className:"mt-2",placeholder:"Description",component:O,errors:m,touched:u})}),e.jsxs("div",{className:"flex justify-between gap-2 mt-4",children:[e.jsx(T,{type:"button",onClick:s,size:"sm",children:"Cancel"}),e.jsx(T,{type:"submit",size:"sm",loading:f,variant:"solid",children:"Save"})]})]})})]})}),re=1,ut=ee({title:X().required("Title is required"),files:De().min(1,"Please upload at least one file").required("File upload is required")}),pt=({initialData:i={files:[],title:"",description:""},onSubmit:s,onCancel:c,type:f="Add"})=>{const h=["application/pdf"],m=(u,N)=>{let d=!0;const r=1e7;if(N.length>=re)return`You can only upload ${re} file(s)`;if(u)for(const x of u)h.includes(x.type)?x.size>=r&&(d="Upload file cannot be more than 10MB!"):d="Only PDF files are allowed!";return d};return e.jsx(te,{initialValues:{...i},validationSchema:ut,onSubmit:(u,{setSubmitting:N})=>{s(u,N)},children:({values:u,setFieldValue:N,touched:d,errors:r,isSubmitting:x})=>e.jsx(ae,{children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Title*"}),e.jsx(L,{name:"title",children:({field:p})=>e.jsx(O,{...p,placeholder:"Template title"})}),e.jsx(Q,{name:"title",component:"div",className:"text-red-600"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),e.jsx(L,{name:"description",children:({field:p})=>e.jsx(O,{textArea:!0,...p,placeholder:"description"})})]}),e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload Template*"}),e.jsx(L,{name:"files",children:({field:p,form:b})=>e.jsx(je,{draggable:!0,accept:h,beforeUpload:m,fileList:u.files||[],disabled:!!u.templateId,onChange:o=>{N("files",o)},onFileRemove:o=>b.setFieldValue(p.name,o)})}),r.files&&d.files&&e.jsx("div",{className:"text-red-500 text-sm mt-1",children:r.files})]}),e.jsx(Se,{className:"px-8 flex items-center justify-between py-4",stickyClass:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"md:flex items-center justify-between w-full",children:[e.jsx(T,{size:"sm",className:"mr-2",onClick:c,children:"Cancel"}),e.jsx(T,{size:"sm",variant:"solid",type:"submit",loading:x,children:"Save"})]})})]})})})};pe("SignatureData",Te);function ft(i){if(i===0)return"0 B";const s=["B","KB","MB","GB","TB"],c=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,c)).toFixed(2)} ${s[c]}`}const Re=()=>{const[i,s]=a.useState([]);a.useState(!1);const[c,f]=a.useState(!1);a.useState(!1),a.useState();const[h,m]=a.useState(!1),[u,N]=a.useState(!1);a.useState(!1),a.useState(!1),a.useState(null);const d={edit:!1,delete:!0,view:!1};a.useRef(null),me();const r=fe(),{textTheme:x}=he(),p=U(l=>l.SignatureData.data.loading);U(l=>l.SignatureData.data.tableData);const b=U(l=>{var w,v;return((v=(w=l==null?void 0:l.SignatureData)==null?void 0:w.data)==null?void 0:v.DocumentTemplate)||[]}),[o,g]=a.useState(null),[D,j]=a.useState(!1),F=()=>{f(!0)},k=()=>{f(!1)},R=a.useCallback(async()=>{try{await r(G())}catch(l){console.error("Failed to fetch document data:",l)}},[r]),H=a.useCallback(()=>{m(!0)},[]),A=a.useCallback((l,w)=>{w===I.delete&&(r(Ne(!0)),r(Fe(l)),g(l),j(!0))},[r]),P=async(l,w)=>{try{await Xe(l==null?void 0:l.title,l==null?void 0:l.description,l==null?void 0:l.files[0]),await R(),w(!1),k(),S.push(e.jsx(C,{title:"Success",type:"success",children:"Template added successfully!"}))}catch(v){console.error("Error adding document:",v),w(!1),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to upload document"}))}},Z=a.useMemo(()=>[{dataField:"Action",caption:"Action",width:"10%",cellRender:l=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(ye,{row:l==null?void 0:l.data,actions:d,buttonClick:A})})},{dataField:"templateName",cssClass:"truncate-cell",caption:"Title",width:"15%",cellRender:l=>e.jsx("div",{"data-cname":"Name",children:l.value})},{dataField:"description",caption:"Description",width:"30%",cssClass:"truncate-cell",cellRender:l=>e.jsx("div",{"data-cname":"Description",children:l.value})},{dataField:"fileSize",caption:"Size",width:"10%",alignment:"left",cellRender:l=>e.jsx("div",{"data-cname":"Size",children:ft(l.value)})},{dataField:"createdByUserName",caption:"Uploaded By",width:"20%"},{dataField:"uploadDate",caption:"Upload Date",width:"10%",dataType:"date",format:"dd-MM-yyyy",cellRender:l=>{const w=ge(l.value).format("MM/DD/YYYY");return e.jsx("div",{"data-cname":"Upload Date",children:w})}}],[x,A]),[M,K]=a.useState({pageSize:"",pageIndex:""});a.useEffect(()=>{R()},[R]);const q=async()=>{if(o!=null&&o.id){j(!0);try{await He(o.id),S.push(e.jsx(C,{title:"Deleted",type:"success",children:"Template deleted successfully!"})),$(),await R()}catch(l){console.error("Delete error:",l),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to delete document"}))}finally{j(!1)}}},$=()=>{j(!1),g(null)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2 px-4 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Document Templates"}),e.jsx("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2",children:e.jsx(T,{onClick:F,block:!0,variant:"solid",size:"sm",icon:e.jsx(xe,{}),children:"New Template"})})]})}),(p||u)&&e.jsx(ce,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsx(J,{className:"borderless",children:e.jsx(be,{columns:Z,tableName:"digital-signature-template",data:b||[],defaultHiddenColumn:[],height:"calc(100vh - 200px)",fetchData:R,id_label:"$id",selectedRowId:i,setSelectedRowId:s,setFilterValues:()=>{},filterValues:[],identity:"digital-signature-template",setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"DocumentTemplate-Listing",handleSearch:()=>{},isColumnResizing:!0,pager:M,setPager:K,openFilter:H,isPaginationReq:!0,isFilterReq:!1,isSelectionReq:!1,isLoading:p})}),e.jsx(_,{title:"Add New Template",isOpen:c,onClose:k,portalClassName:"w30",children:e.jsx(pt,{onSubmit:P,onCancel:k,type:"Add"})}),e.jsx(Ce,{isOpen:D,type:"danger",title:"Delete Template",confirmButtonColor:"red-600",onClose:$,onCancel:$,onConfirm:q,children:e.jsx("p",{children:"Are you sure you want to delete this Template? This action cannot be undone."})})]})};Re.displayName="DocumentTemplate";const ht=de.memo(Re);pe("SignatureData",Te);const gt=(i="")=>i.replace(/([A-Z])/g," $1").trim();function xt(i){if(i===0)return"0 B";const s=["B","KB","MB","GB","TB"],c=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,c)).toFixed(2)} ${s[c]}`}const ve=()=>{const[i,s]=a.useState([]);a.useState(!1);const[c,f]=a.useState(!1),[h,m]=a.useState(!1);a.useState();const[u,N]=a.useState(!1),[d,r]=a.useState(!1),[x,p]=a.useState(!1),[b,o]=a.useState(!1),[g,D]=a.useState(null),j={edit:!1,delete:!0,view:!0,activity:!0,sendForSignature:!0,template:!0,signedDoc:!0};a.useRef(null),me();const F=fe(),{textTheme:k}=he(),R=U(t=>t.SignatureData.data.loading);U(t=>t.SignatureData.data.tableData);const H=U(t=>{var n,y;return((y=(n=t==null?void 0:t.SignatureData)==null?void 0:n.data)==null?void 0:y.documentList)||[]}),[A,P]=a.useState(null),[Z,M]=a.useState(!1),[K,q]=a.useState(!1),$=()=>{q(!0)},l=()=>{q(!1)},w=()=>{f(!0)},v=()=>{f(!1)},Ae=t=>{m(!0)},E=a.useCallback(async()=>{try{await F(Y())}catch(t){console.error("Failed to fetch document data:",t)}},[F]),Ie=a.useCallback(()=>{N(!0)},[]),le=a.useCallback(t=>{window.open(`/app/pages/signature/documents/details/${t.id}`)},[]),ie=a.useCallback((t,n)=>{n===I.view&&le(t),n===I.activity&&(Ae(),D(t)),n===I.delete&&(F(Ne(!0)),F(Fe(t)),P(t),M(!0)),n===I.sendForSignature&&ke(t.id),n===I.template&&(D(t),p(!0)),n===I.signedDoc&&Ue(t.id)},[F,le]),Le=async(t,n)=>{try{await We(t==null?void 0:t.files[0],(t==null?void 0:t.templateId)??void 0,t==null?void 0:t.title),await E(),n(!1),v(),S.push(e.jsx(C,{title:"Success",type:"success",children:"Document uploaded successfully!"}))}catch(y){console.error("Error adding document:",y),n(!1),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to upload document"}))}},ke=async t=>{r(!0);try{await Ze(t),S.push(e.jsx(C,{title:"Success",type:"success",children:"Document sent successfully!"}))}catch(n){console.error("Error adding document:",n),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to sent document"}))}finally{r(!1)}},Me=async t=>{var n,y,V;try{r(!0),(n=(await Je(g==null?void 0:g.id,t==null?void 0:t.fileName,t==null?void 0:t.description)).data)!=null&&n.success&&(r(!1),D(null),p(!1),S.push(e.jsx(C,{title:"Success",type:"success",children:"Template Saved successfully!"})))}catch(z){S.push(e.jsx(C,{title:"Error",type:"danger",children:((V=(y=z.response)==null?void 0:y.data)==null?void 0:V.message)||"An unexpected error occurred while Saving the template."}))}finally{r(!1)}},Ue=async t=>{const n=await Ke(t),y=n.headers["content-type"],V=new Blob([n.data],{type:y}),z=URL.createObjectURL(V);if(y.startsWith("image/")||y==="application/pdf")window.open(z,"_blank");else{const B=document.createElement("a");B.href=z,B.download="signed-file",document.body.appendChild(B),B.click(),document.body.removeChild(B)}},$e=a.useMemo(()=>[{dataField:"Action",caption:"Action",width:"10%",cellRender:t=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(ye,{row:t==null?void 0:t.data,actions:j,buttonClick:ie})})},{dataField:"description",caption:"Title",width:"30%",cellRender:t=>{var n;return e.jsx("div",{"data-cname":"Name",children:e.jsx(Pe,{to:`/app/pages/signature/documents/details/${(n=t==null?void 0:t.data)==null?void 0:n.id}`,className:`${k} hover:underline`,children:t.value})})}},{dataField:"status",caption:"Status",alignment:"left",width:"10%",cellRender:t=>{const n=t.value||"Pending",y={Completed:"bg-green-100 text-green-800",Draft:"bg-yellow-100 text-yellow-800",Pending:"bg-gray-100 text-gray-800",PendingSignatures:"bg-red-100 text-red-800"};return e.jsx("div",{"data-cname":"Status",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${y[n]||y.Pending}`,children:gt(n)})})}},{dataField:"sourceType",caption:"Source",width:"12%",alignment:"left",cellRender:t=>{var y;const n=(y=t==null?void 0:t.data)==null?void 0:y.isCreatedFromTemplate;return e.jsx("div",{"data-cname":"Source",children:e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${n?"bg-custom-100 text-custom-800":"bg-purple-100 text-purple-800"}`,children:n?"Template Upload":"File Upload"})})}},{dataField:"fileSize",caption:"Size",width:"10%",alignment:"left",cellRender:t=>e.jsx("div",{"data-cname":"Size",children:xt(t.value)})},{dataField:"createdByUserName",caption:"Uploaded By",width:"20%"},{dataField:"createdDate",caption:"Upload Date",width:"10%",dataType:"date",format:"dd-MM-yyyy",cellRender:t=>{const n=ge(t.value).format("MM/DD/YYYY");return e.jsx("div",{"data-cname":"Upload Date",children:n})}}],[k,ie]),[Ee,ze]=a.useState({pageSize:"",pageIndex:""});a.useEffect(()=>{E()},[E]);const Be=async()=>{if(A!=null&&A.id){M(!0);try{await Qe(A.id),S.push(e.jsx(C,{title:"Deleted",type:"success",children:"Document deleted successfully!"})),W(),await E()}catch(t){console.error("Delete error:",t),S.push(e.jsx(C,{title:"Error",type:"danger",children:"Failed to delete document"}))}finally{M(!1)}}},W=()=>{M(!1),P(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:[e.jsx(Oe,{items:[{label:"Build"},{label:"Document List"}]}),e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Document List"}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2",children:[e.jsx(T,{onClick:$,block:!0,variant:"solid",size:"sm",className:"mr-2",children:"View Templates"}),e.jsx(T,{onClick:w,block:!0,variant:"solid",size:"sm",icon:e.jsx(xe,{}),children:"New Document"})]})]})]}),e.jsxs(J,{className:"h-full py-2 px-4 m-6 bg-transparent",bodyClass:"h-full",children:[(R||d)&&e.jsx(ce,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsx(J,{className:"borderless",children:e.jsx(be,{columns:$e,tableName:"digital-signature-Listing",data:H||[],defaultHiddenColumn:[],height:"calc(100vh - 310px)",fetchData:E,id_label:"$id",selectedRowId:i,setSelectedRowId:s,setFilterValues:()=>{},filterValues:[],identity:"digital-signature-Listing",setInLineFilters:()=>{},inLineFilter:[],inLineFilterMobileView:[],setInLineFiltersMobileView:()=>{},setColSorting:()=>{},ImpColumnName:"DocumentId",idName:"DocumentList-Listing",handleSearch:()=>{},isColumnResizing:!0,pager:Ee,setPager:ze,openFilter:Ie,isPaginationReq:!0,isFilterReq:!1,isSelectionReq:!1,isLoading:R})})]}),e.jsx(_,{title:"Upload New Document",isOpen:c,onClose:v,portalClassName:"w30",children:e.jsx(ct,{onSubmit:Le,onCancel:v,type:"Add"})}),e.jsx(_,{title:"Document Activity",isOpen:h,onClose:()=>m(!1),portalClassName:"w30",children:e.jsx(lt,{documentId:g==null?void 0:g.id})}),e.jsx(Ce,{isOpen:Z,type:"danger",title:"Delete Record",confirmButtonColor:"red-600",onClose:W,onCancel:W,onConfirm:Be,children:e.jsx("p",{children:"Are you sure you want to delete this File Record? This action cannot be undone."})}),e.jsx(_,{title:"",isOpen:K,onClose:l,portalClassName:"w90",children:e.jsx(ht,{})}),e.jsx(mt,{isOpen:x,onClose:()=>p(!1),userId:g,loading:b,onSubmit:Me,FileName:`Copy of ${g==null?void 0:g.description}`})]})};ve.displayName="DocumentList";const Jt=de.memo(ve);export{Jt as default};
|