{"version":3,"sources":["webpack:///./src/helpers/customer/index.ts"],"names":["cov_p3byxmdcv","actualCoverage","lotTabs","s","label","value","customerEoiStatuses","background","badgeLabel","badgeBackground","customerLotStatuses","customerStatuses","Map","eoiPendingStatuses","_customerStatuses$get","get","_customerStatuses$get2","_customerStatuses$get3","_customerStatuses$get4","_customerStatuses$get5","_customerStatuses$get6","_customerStatuses$get7","_customerStatuses$get8","eoiApprovingStatuses","_customerStatuses$get9","_customerStatuses$get10","isEoiPendingStatus","status","f","includes","isEoiApprovingStatus","getEoiPendingStatus","eoiStatus","statuses","Array","from","values","b","getStatusByLabel","getFinishedStatus","_customerStatuses$get11","_customerStatuses$get12","EoiStatus","WITHDRAWN","dynamicStatuses","_s$get","_s$get2","_s$get3","find","item","getValueByStatus","field","_getStatusByLabel","getTabByUrl","path","tab","getLotStatus","lotStatus","APPROVED","LotStatus","EOI","PENDING_FOR_BILLING","DRAFT","PENDING","TERMINATED","showingEoiDetailControls","complete","decline","delete","withdraw","CONTRACT_EXECUTED","UNCONDITIONAL","eoiStatusesHavingBackground","DECLINED","WAITING_FOR_APPROVED","REFUND_DECLINED","REFUNDED","WAITING_FOR_PENDING"],"mappings":"wktBAkBM,OAAAA,EAAA,kBAAAC,KAAAD,IAdC,MAAME,GAAOF,IAAAG,EAAA,KAAa,CAC/B,CAAEC,MAAO,WAAYC,MAAO,YAC5B,CAAED,MAAO,YAAaC,MAAO,aAC7B,CAAED,MAAO,4BAA6BC,MAAO,eAC7C,CAAED,MAAO,WAAYC,MAAO,aAC5B,CAAED,MAAO,aAAcC,MAAO,qBAG1BC,GAAmBN,IAAAG,EAAA,KAAgC,CACvD,CACE,UACA,CACEC,MAAO,YACPC,MAAO,UACPE,WAAY,gBACZC,WAAY,cAGhB,CACE,QACA,CACEJ,MAAO,YACPC,MAAO,QACPE,WAAY,OACZC,WAAY,UAGhB,CACE,sBACA,CACEJ,MAAO,YACPC,MAAO,sBACPE,WAAY,OACZC,WAAY,wBAGhB,CACE,WAC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AA,MAAA5B,IAAAG,EAAA,MACC,CAAC0D,EAAqBC,GAAOjC,SAASG,IAE/CmC,UACE,OADKnE,IAAA4B,EAAA,MAAA5B,IAAAG,EAAA,MACE,CAAC4D,GAASlC,SAASG,IAE5BoC,SACE,OADIpE,IAAA4B,EAAA,MAAA5B,IAAAG,EAAA,MACG,CAAC0D,EAAqBC,EAAOE,GAAYnC,SAC9CG,IAGJqC,WACE,OADMrE,IAAA4B,EAAA,MAAA5B,IAAAG,EAAA,MAEJH,IAAAqC,EAAC,GAAD,MAACqB,GAAU7B,SAASG,KAAuBhC,IAAAqC,EAAA,QAC3C,CACEsB,eAAUC,IACVD,eAAUW,kBACVX,eAAUY,eACV1C,SAAS4B,MAMZ,MAAMe,GAA2BxE,IAAAG,EAAA,MAAG,CACzCuC,eAAUqB,QACVrB,eAAUgB,SACVhB,eAAU+B,SACV/B,eAAUgC,qBACVhC,eAAUC,UACVD,eAAUiC,gBACVjC,eAAUkC,SACVlC,eAAUmC","file":"js/CustomerLotDetails~CustomerLotEoiDetails~CustomerWaitlistDetailsEditView~CustomerWaitlistDetailsView.de0e9bce.js","sourcesContent":["import {CustomerLotStatus, LotStatusMap, LotStatusObject, LotTab,} from \"@/types/CustomerLotDetails\";\nimport {EoiStatus} from \"@/enums/EoiStatus\";\nimport {LotStatus} from \"@/enums/LotStatus\";\n\nexport const lotTabs: LotTab[] = [\n { label: \"ACTIVITY\", value: \"activity\" },\n { label: \"DOCUMENTS\", value: \"documents\" },\n { label: \"CONTRACT INFORMATION FORM\", value: \"eoi-details\" },\n { label: \"CONTRACT\", value: \"contracts\" },\n { label: \"CONTACT US\", value: \"estate-contacts\" },\n];\n\nconst customerEoiStatuses: [string, LotStatusObject][] = [\n [\n \"PENDING\",\n {\n label: \"Submitted\",\n value: \"pending\",\n background: \"success-light\",\n badgeLabel: \"Submitted\",\n },\n ],\n [\n \"DRAFT\",\n {\n label: \"Submitted\",\n value: \"draft\",\n background: \"gray\",\n badgeLabel: \"Draft\",\n },\n ],\n [\n \"PENDING_FOR_BILLING\",\n {\n label: \"Submitted\",\n value: \"pending for billing\",\n background: \"gray\",\n badgeLabel: \"Pending For Billing\",\n },\n ],\n [\n \"APPROVED\",\n {\n label: \"Approved\",\n value: \"approved\",\n background: \"light-blue\",\n badgeLabel: \"Approved\",\n },\n ],\n [\n \"DECLINED\",\n {\n label: \"Declined\",\n value: \"declined\",\n background: \"warning-light\",\n badgeLabel: \"Declined\",\n },\n ],\n [\n \"TERMINATED\",\n {\n label: \"Submitted\",\n value: \"terminated\",\n background: \"gray-light\",\n badgeLabel: \"Terminated\",\n },\n ],\n [\n \"WAITING_FOR_APPROVED\",\n {\n label: \"Submitted\",\n value: \"waitingForApproved\",\n background: \"primary\",\n badgeLabel: \"Submitted\",\n },\n ],\n [\n \"WAITING_FOR_DECLINED\",\n {\n label: \"Submitted\",\n value: \"waitingForDeclined\",\n background: \"warning-light\",\n badgeLabel: \"EOI Declining\",\n },\n ],\n [\n \"TRANSACTION_ERROR\",\n {\n label: \"Submitted\",\n value: \"transaction_error\",\n background: \"warning\",\n badgeLabel: \"Transaction Error\",\n badgeBackground: \"warning\",\n },\n ],\n [\n \"WAITING_FOR_PENDING\",\n {\n label: \"Submitted\",\n value: \"waitingForPending\",\n background: \"blue\",\n badgeLabel: \"EOI Submitting\",\n badgeBackground: \"blue\",\n },\n ],\n];\nconst customerLotStatuses: [string, LotStatusObject][] = [\n [\n \"CONTRACT_EXECUTED\",\n {\n label: \"Contract Executed\",\n value: \"Contract Executed\",\n background: \"orange-light\",\n badgeLabel: \"Contract Executed\",\n },\n ],\n [\n \"EOI\",\n {\n label: \"Contract Executed\",\n value: \"EOI\",\n background: \"\",\n badgeLabel: \"Approved\",\n },\n ],\n [\n \"UNCONDITIONAL\",\n {\n label: \"Finance Unconditional\",\n value: \"Unconditional\",\n background: \"primary\",\n badgeLabel: \"Finance Unconditional\",\n },\n ],\n [\n \"SETTLED\",\n {\n label: \"Settled\",\n value: \"Settled\",\n background: \"warning\",\n badgeLabel: \"Settled\",\n },\n ],\n [\n \"WITHDRAWN\",\n {\n label: \"Withdrawn\",\n value: \"withdrawn\",\n background: \"orange\",\n badgeLabel: \"Withdrawn\",\n },\n ],\n [\n \"REFUNDED\",\n {\n label: \"Deposit refunded\",\n value: \"refunded\",\n background: \"warning-light\",\n badgeLabel: \"Deposit refunded\",\n },\n ],\n [\n \"REFUND_DECLINED\",\n {\n label: \"Deposit not refunded\",\n value: \"refundDeclined\",\n background: \"warning-light\",\n badgeLabel: \"Deposit not refunded\",\n },\n ],\n];\nexport const customerStatuses = new Map([\n ...customerEoiStatuses,\n ...customerLotStatuses,\n]);\n\nexport const eoiPendingStatuses = [\n customerStatuses.get(\"PENDING\")?.value,\n customerStatuses.get(\"DRAFT\")?.value,\n customerStatuses.get(\"PENDING_FOR_BILLING\")?.value,\n customerStatuses.get(\"TERMINATED\")?.value,\n customerStatuses.get(\"WAITING_FOR_APPROVED\")?.value,\n customerStatuses.get(\"WAITING_FOR_DECLINED\")?.value,\n customerStatuses.get(\"TRANSACTION_ERROR\")?.value,\n customerStatuses.get(\"WAITING_FOR_PENDING\")?.value,\n];\nconst eoiApprovingStatuses = [\n customerStatuses.get(\"APPROVED\")?.value,\n customerStatuses.get(\"DECLINED\")?.value,\n];\nexport const isEoiPendingStatus = (status: CustomerLotStatus): boolean =>\n eoiPendingStatuses.includes(status);\nexport const isEoiApprovingStatus = (status: CustomerLotStatus): boolean =>\n eoiApprovingStatuses.includes(status);\n\nfunction getEoiPendingStatus(eoiStatus: CustomerLotStatus) {\n const statuses = Array.from(customerStatuses.values()) as LotStatusObject[];\n if (isEoiPendingStatus(eoiStatus)) {\n return getStatusByLabel(statuses, eoiStatus);\n } else {\n return customerStatuses.get(\"PENDING\");\n }\n}\nfunction getFinishedStatus(eoiStatus: EoiStatus) {\n if (eoiStatus === customerStatuses.get(\"REFUND_DECLINED\")?.value) {\n return customerStatuses.get(\"REFUND_DECLINED\");\n }\n if (eoiStatus === customerStatuses.get(\"REFUNDED\")?.value) {\n return customerStatuses.get(\"REFUNDED\");\n }\n if (eoiStatus === EoiStatus.WITHDRAWN) {\n return {\n background: \"gray\",\n badgeLabel: \"Refunded\",\n label: \"Refunded\",\n value: \"Settled\",\n };\n }\n return customerStatuses.get(\"SETTLED\");\n}\n\nexport function dynamicStatuses(\n status: CustomerLotStatus,\n eoiStatus: CustomerLotStatus\n): LotStatusObject[] {\n const s = customerStatuses as LotStatusMap;\n return [\n getEoiPendingStatus(eoiStatus),\n eoiStatus === s.get(\"DECLINED\")?.value\n ? s.get(\"DECLINED\")\n : s.get(\"APPROVED\"),\n status === s.get(\"EOI\")?.value ? s.get(\"EOI\") : s.get(\"CONTRACT_EXECUTED\"),\n eoiStatus === s.get(\"WITHDRAWN\")?.value\n ? customerStatuses.get(\"WITHDRAWN\")\n : s.get(\"UNCONDITIONAL\"),\n getFinishedStatus(eoiStatus as EoiStatus),\n ] as LotStatusObject[];\n}\n\nconst getStatusByLabel = (\n statuses: LotStatusObject[],\n status: CustomerLotStatus\n): LotStatusObject | undefined =>\n statuses.find((item) => item.value === status);\n\nexport function getValueByStatus(\n status: CustomerLotStatus,\n field: keyof LotStatusObject\n): string | undefined {\n const statuses = customerStatuses.values();\n return getStatusByLabel(Array.from(statuses) as LotStatusObject[], status)?.[\n field\n ];\n}\n\nexport function getTabByUrl(path: string): LotTab | undefined {\n return lotTabs.find((tab) => path.includes(tab.value));\n}\n\nexport function getLotStatus(\n eoiStatus: EoiStatus,\n lotStatus: LotStatus\n): LotStatus | EoiStatus {\n if (eoiStatus === EoiStatus.APPROVED) {\n if (lotStatus === LotStatus.EOI) {\n return EoiStatus.APPROVED;\n }\n return lotStatus;\n }\n return eoiStatus;\n}\n\nconst { PENDING_FOR_BILLING, DRAFT, PENDING, APPROVED, TERMINATED } = EoiStatus;\n\nexport function showingEoiDetailControls(\n eoiStatus: EoiStatus,\n lotStatus: LotStatus\n): {\n complete(): boolean;\n delete(): boolean;\n withdraw(): boolean;\n decline(): boolean;\n} {\n return {\n complete() {\n return [PENDING_FOR_BILLING, DRAFT].includes(eoiStatus as EoiStatus);\n },\n decline() {\n return [PENDING].includes(eoiStatus as EoiStatus);\n },\n delete() {\n return [PENDING_FOR_BILLING, DRAFT, TERMINATED].includes(\n eoiStatus as EoiStatus\n );\n },\n withdraw() {\n return (\n [APPROVED].includes(eoiStatus as EoiStatus) &&\n [\n LotStatus.EOI,\n LotStatus.CONTRACT_EXECUTED,\n LotStatus.UNCONDITIONAL,\n ].includes(lotStatus)\n );\n },\n };\n}\n\nexport const eoiStatusesHavingBackground = [\n EoiStatus.PENDING,\n EoiStatus.APPROVED,\n EoiStatus.DECLINED,\n EoiStatus.WAITING_FOR_APPROVED,\n EoiStatus.WITHDRAWN,\n EoiStatus.REFUND_DECLINED,\n EoiStatus.REFUNDED,\n EoiStatus.WAITING_FOR_PENDING,\n];\n"],"sourceRoot":""}