{"version":3,"file":"globalCheckoutServices-DO4mlGL4.js","sources":["../../../../Coloplast.UI/src/shared/services/globalCheckoutServices.ts"],"sourcesContent":["import { AxiosError, AxiosResponse } from 'axios';\r\nimport axios from 'shared/tools/axiosMultisite';\r\nimport * as API from '../types/globalCheckoutService.types';\r\n\r\nexport const URL_ACTIVATE_CONSUMER_ACCOUNT_API = '/api/consumeraccountactivationapi/activate-consumer-account';\r\nexport const URL_NDIS_FUNDING_API = '/api/global-checkout/ndis-funding-service';\r\nexport const URL_OWN_FUNDING_API = '/api/global-checkout/own-funding-service';\r\nexport const URL_REIMBURSEMENT_CONSUMER_API = '/api/global-checkout/consumer-reimbursement-details-page-service';\r\nexport const URL_UPDATE_REIMBURSEMENT_CONSUMER_API =\r\n\t'/api/consumeraccount/update-consumer-profile-reimbursement-information';\r\nexport const URL_DELIVERY_API = '/api/global-checkout/delivery-information-service';\r\nexport const URL_UPDATE_PRESCRIPTION_MATCH_API = '/api/global-checkout/update-prescription-match';\r\n\r\nexport function sendCheckoutNdisForm(data: API.SendCheckoutNdisFormPayload) {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\taxios\r\n\t\t\t.put(URL_NDIS_FUNDING_API, data)\r\n\t\t\t.then((result: AxiosResponse) => {\r\n\t\t\t\tresolve(result?.data);\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nexport function sendOwnFunding(data: API.SendOwnFundingPayload) {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\taxios\r\n\t\t\t.put(URL_OWN_FUNDING_API, data)\r\n\t\t\t.then((result: AxiosResponse) => {\r\n\t\t\t\tresolve(result?.data);\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nexport function sendConsumerAccountActivation(data: API.SendConsumerAccountActivationPayload) {\r\n\treturn axios.post(URL_ACTIVATE_CONSUMER_ACCOUNT_API, data);\r\n}\r\n\r\nexport function sendCheckoutReimbursementConsumerForm(\r\n\tdata: API.SendCheckoutReimbursementConsumerFormPayload\r\n): Promise> {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\taxios\r\n\t\t\t.put(URL_REIMBURSEMENT_CONSUMER_API, data)\r\n\t\t\t.then((result: AxiosResponse) => {\r\n\t\t\t\tresolve(result);\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nexport function updateCheckoutReimbursementConsumerForm(\r\n\tdata: API.SendCheckoutReimbursementConsumerFormPayload\r\n): Promise> {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\taxios\r\n\t\t\t.put<\r\n\t\t\t\tAPI.SendCheckoutReimbursementConsumerFormPayload,\r\n\t\t\t\tAxiosResponse\r\n\t\t\t>(URL_UPDATE_REIMBURSEMENT_CONSUMER_API, data)\r\n\t\t\t.then((result) => {\r\n\t\t\t\tresolve(result);\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nexport function sendCheckoutDeliveryForm(\r\n\tdata: API.SendCheckoutDeliveryFormPayload\r\n): Promise> {\r\n\treturn new Promise((resolve, reject) => {\r\n\t\taxios\r\n\t\t\t.put>(\r\n\t\t\t\tURL_DELIVERY_API,\r\n\t\t\t\tdata\r\n\t\t\t)\r\n\t\t\t.then((result) => {\r\n\t\t\t\tresolve(result);\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treject(error);\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nexport function updatePrescriptionMatch(data: API.UpdatePrescriptionMatchPayload) {\r\n\treturn axios.post(URL_UPDATE_PRESCRIPTION_MATCH_API, data);\r\n}"],"names":["URL_ACTIVATE_CONSUMER_ACCOUNT_API","URL_NDIS_FUNDING_API","URL_OWN_FUNDING_API","URL_REIMBURSEMENT_CONSUMER_API","URL_UPDATE_REIMBURSEMENT_CONSUMER_API","URL_DELIVERY_API","URL_UPDATE_PRESCRIPTION_MATCH_API","sendCheckoutNdisForm","data","resolve","reject","axios","result","error","sendOwnFunding","sendConsumerAccountActivation","sendCheckoutReimbursementConsumerForm","updateCheckoutReimbursementConsumerForm","sendCheckoutDeliveryForm","updatePrescriptionMatch"],"mappings":"wCAIO,MAAMA,EAAoC,8DACpCC,EAAuB,4CACvBC,EAAsB,2CACtBC,EAAiC,mEACjCC,EACZ,yEACYC,EAAmB,oDACnBC,EAAoC,iDAE1C,SAASC,EAAqBC,EAAuC,CAC3E,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACvCC,EACE,IAAIV,EAAsBO,CAAI,EAC9B,KAAMI,GAA4D,CAClEH,EAAQG,GAAA,YAAAA,EAAQ,IAAI,CAAA,CACpB,EACA,MAAOC,GAAsB,CAC7BH,EAAOG,CAAK,CAAA,CACZ,CAAA,CACF,CACF,CAEO,SAASC,EAAeN,EAAiC,CAC/D,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACvCC,EACE,IAAIT,EAAqBM,CAAI,EAC7B,KAAMI,GAAsD,CAC5DH,EAAQG,GAAA,YAAAA,EAAQ,IAAI,CAAA,CACpB,EACA,MAAOC,GAAsB,CAC7BH,EAAOG,CAAK,CAAA,CACZ,CAAA,CACF,CACF,CAEO,SAASE,EAA8BP,EAAgD,CACtF,OAAAG,EAAM,KAAKX,EAAmCQ,CAAI,CAC1D,CAEO,SAASQ,EACfR,EAC4E,CAC5E,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACvCC,EACE,IAAIR,EAAgCK,CAAI,EACxC,KAAMI,GAA6E,CACnFH,EAAQG,CAAM,CAAA,CACd,EACA,MAAOC,GAAsB,CAC7BH,EAAOG,CAAK,CAAA,CACZ,CAAA,CACF,CACF,CAEO,SAASI,EACfT,EAC8E,CAC9E,OAAO,IAAI,QAA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