(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[914],{7388:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/returns",function(){return n(7777)}])},7777:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return te},default:function(){return ne}});var r=n(4051),i=n.n(r),l=n(5893),o=n(7294),s=n(1163),u=n(5152),a=n(4931),d=n(949),c=n(8465),m=n(7243),v=n(7536),f=n(9288),p=n(4231),h=n(5496),b=new RegExp(/^\d{10,11}$/),y=function(e){var t,n,r,i,l,o,s,u,a,d=e.key,c=e.labels;return"email"===d?(0,h.X)(p.Ry().shape({reference_number:p.Z_().required(null!==(t=null===c||void 0===c?void 0:c.required)&&void 0!==t?t:"Field is required"),email:p.Z_().email(null!==(n=null===c||void 0===c?void 0:c.emailError)&&void 0!==n?n:"Please enter a valid email address").required(null!==(r=null===c||void 0===c?void 0:c.required)&&void 0!==r?r:"Field is required")})):"combo"===d?(0,h.X)(p.Ry().shape({reference_number:p.Z_().required(null!==(i=null===c||void 0===c?void 0:c.required)&&void 0!==i?i:"Field is required"),email:p.Z_().email(null!==(l=null===c||void 0===c?void 0:c.emailError)&&void 0!==l?l:"Please enter a valid email address"),phone_number:p.Z_().typeError(null!==(o=null===c||void 0===c?void 0:c.numberError)&&void 0!==o?o:"Only numbers allowed").test("len",null===c||void 0===c?void 0:c.phoneLen,(function(e){return e&&b.test(e.toString())}))})):(0,h.X)(p.Ry().shape({reference_number:p.Z_().required(null!==(s=null===c||void 0===c?void 0:c.required)&&void 0!==s?s:"Field is required"),phone_number:p.Z_().typeError(null!==(u=null===c||void 0===c?void 0:c.numberError)&&void 0!==u?u:"Only numbers allowed").required(null!==(a=null===c||void 0===c?void 0:c.required)&&void 0!==a?a:"Field is required").test("len",null===c||void 0===c?void 0:c.phoneLen,(function(e){return e&&b.test(e.toString())}))}))},x=n(652);function g(e,t,n,r,i,l,o){try{var s=e[l](o),u=s.value}catch(a){return void n(a)}s.done?t(u):Promise.resolve(u).then(r,i)}var _=function(e){var t,n,r,u,d,c,m=e.state,p=e.agree,h=e.setAgree,b=e.returnPolicy,_=e.refundPolicy,j=e.privacyPolicy,S=e.fetchReasons,w=e.processLogin,N=e.domain,k=e.labels,O=e.conditionsData,I=(0,o.useState)("email"),P=I[0],R=I[1],D=(0,s.useRouter)(),C=(0,v.cI)({defaultValues:(u={},d=m.orderFields[0].key,c=m.orderFields[0].value,d in u?Object.defineProperty(u,d,{value:c,enumerable:!0,configurable:!0,writable:!0}):u[d]=c,u),resolver:y({key:3===m.orderFields.length?P:m.orderFields[1].key,labels:k}),shouldUnregister:!1,mode:"onBlur"}),E=C.register,T=C.handleSubmit,q=C.formState,F=q.errors,A=q.isSubmitting,z=C.reset,Z=C.setValue;(0,o.useEffect)((function(){var e={};m.orderFields.forEach((function(t){return e[t.key]=""})),z(e)}),[z]),(0,o.useEffect)((function(){Z(P,"")}),[P]);var L,M,J,U,V,W,B=function(){var e,t=(e=i().mark((function e(t){var n,r,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(t),3===(null===(n=m.orderFields)||void 0===n?void 0:n.length)&&(delete t[l="email"===P?"phone_number":"email"],r=r.filter((function(e){return e!==l}))),e.next=5,fetch("/api/get/".concat(r[0],"=").concat(t[r[0]],"/").concat(r[1],"=").concat(t[r[1]],"/domain=").concat(N));case 5:e.sent.json().then((function(e){var n,i,l;200===(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.status)&&(null===e||void 0===e?void 0:e.result)?(D.replace("/returns/?".concat(r[0],"=").concat(t[r[0]],"&").concat(r[1],"=").concat(t[r[1]])),w(e),S()):a.ZP.error(null!==(l=null===e||void 0===e||null===(i=e.meta)||void 0===i?void 0:i.message)&&void 0!==l?l:null===k||void 0===k?void 0:k.error.something)})).catch((function(e){return a.ZP.error(JSON.stringify(e))}));case 7:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function o(e){g(l,r,i,o,s,"next",e)}function s(e){g(l,r,i,o,s,"throw",e)}o(void 0)}))});return function(e){return t.apply(this,arguments)}}();return(0,l.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,l.jsxs)("div",{className:"flex flex-col justify-between z-20 relative bg-white rounded-xl px-8 md:px-12 xl:px-20 py-8 md:py-16 mx-4 sm:mx-0",children:[(0,l.jsx)("div",{className:"text-xl md:text-3xl text-center text-primary font-semibold",children:null===k||void 0===k?void 0:k.title}),(0,l.jsx)("div",{className:"text-secondary text-center mt-4",children:"returns-plus"===m.subdomain?"Please test with order number 1034 and email returns.demo@clickpost.ai":null===k||void 0===k?void 0:k.description}),3===m.orderFields.length&&(0,l.jsxs)("div",{className:"flex mt-5 justify-center items-center gap-3",children:[(0,l.jsx)("span",{children:null!==(L=null===k||void 0===k?void 0:k.loginWith)&&void 0!==L?L:"Login with"}),(0,l.jsx)(f.rs,{name:"fieldValue",onChange:function(){return R("email"===P?"phone_number":"email")},checked:"phone_number"===P,inactiveText:k.email&&k.email.length<10?k.email:"Email",activeText:k.phone_number&&k.phone_number.length<10?k.phone_number:"Mobile"})]}),(0,l.jsxs)("form",{onSubmit:T(B),className:"text-center mt-2",children:[(0,l.jsx)(f.II,{field:{name:m.orderFields[0].key,placeholder:null!==(M=k[m.orderFields[0].key])&&void 0!==M?M:"Order Number"},error:null===F||void 0===F||null===(t=F[m.orderFields[0].key])||void 0===t?void 0:t.message,register:E(m.orderFields[0].key),classNames:{wrapper:"mt-6 text-secondary"},icon:(0,l.jsx)("span",{className:"material-icons-outlined text-muted opacity-80 text-xl",children:"inventory_2"}),size:"lg"}),2===m.orderFields.length&&(0,l.jsx)(f.II,{field:{name:m.orderFields[1].key,placeholder:null!==(J=k[m.orderFields[1].key])&&void 0!==J?J:"Enter Value"},error:null===F||void 0===F||null===(n=F[m.orderFields[1].key])||void 0===n?void 0:n.message,register:E(m.orderFields[1].key),classNames:{wrapper:"mt-2 text-secondary"},icon:(0,l.jsx)("span",{className:"material-icons-outlined text-muted opacity-80 text-xl",children:null!==(U=x.cz[m.orderFields[1].key])&&void 0!==U?U:"mail"}),size:"lg"}),3===m.orderFields.length&&(0,l.jsx)(f.II,{field:{name:P,placeholder:null!==(V=k[P])&&void 0!==V?V:"Enter Value"},error:null===F||void 0===F||null===(r=F[P])||void 0===r?void 0:r.message,register:E(P),classNames:{wrapper:"mt-2 text-secondary"},icon:(0,l.jsx)("span",{className:"material-icons-outlined text-muted opacity-80 text-xl",children:null!==(W=x.cz[P])&&void 0!==W?W:"mail"}),size:"lg"}),(0,l.jsx)(f.gP,{subdomain:m.subdomain,agree:p,setAgree:h,returnLink:b,refundLink:_,privacyLink:j,conditionsData:O}),(0,l.jsx)(f.zx,{type:"submit",style:"primary",className:"w-full mt-5",label:null===k||void 0===k?void 0:k.submit,size:"lg",disabled:A||(x.Cy.indexOf(m.subdomain)>-1||(null===O||void 0===O?void 0:O.enabled))&&!p||""!==m.buttonStatus})]})]})})};function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}function N(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var k=function(e){var t,n,r,i,o,u=e.state,a=e.setState,d=e.allItems,c=e.returnData,m=e.setReturnData,v=e.returnItemTemplate,p=e.items,h=e.setItems,b=e.noReturnItems,y=e.labels,x=(0,s.useRouter)(),g=function(e){var t=[];p.indexOf(e)>-1?(t=p.filter((function(t){return t!==e})),c.item_info=c.item_info.filter((function(t){return t.id!==e})),m(w({},c))):t=N(p).concat([e]),h(t)},_=function(e){var t=e.item;return(0,l.jsx)(f.qg,{item:t,isReturnedItem:t.return_quantity&&t.return_quantity>0,isReturnEligible:t.shipment_eligible_for_return,returnData:c,setReturnData:m,returnItemTemplate:v,toggleItemSelection:g,items:p,state:u,setState:a,labels:y})};return(0,l.jsxs)("div",{className:"p-4 flex flex-col justify-between relative h-full w-full",children:[(0,l.jsxs)("div",{className:"h-[calc(100%-50px)] w-full flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(f.ks,{onClick:function(){a(w({},u,{returnStage:u.shipmentItems.hasMultipleShipments?"shipmentSelection":"",isLoading:!0})),h([]),u.shipmentItems.hasMultipleShipments||x.push("/returns")}}),(0,l.jsx)("span",{className:"ml-2 text-primary text-md font-bold md:text-xl",children:b?null===y||void 0===y?void 0:y.selectScreen.selectItemsnonReturnable:null===y||void 0===y?void 0:y.selectScreen.selectItems})]}),(0,l.jsxs)("p",{className:"mb-4 text-primary",children:[(0,l.jsxs)("span",{children:[null===y||void 0===y?void 0:y.selectScreen.orderID," :"]})," ",null!==(o=null===u||void 0===u||null===(t=u.shipment)||void 0===t?void 0:t.reference_number)&&void 0!==o?o:"---"]}),(0,l.jsxs)("div",{className:"overflow-y-auto w-full h-full",children:[u.shipmentItems.hasMultipleShipments&&(0,l.jsxs)("div",{className:"flex items-center mb-2",children:[(0,l.jsx)("span",{className:"text-secondary mr-1",children:"AWB: "}),c.awb]}),d.filter((function(e){return!("Return request already placed"===e.non_return_reason)&&c.awb===e.tracking_info__awb})).map((function(e,t){return(0,l.jsx)(_,{item:e},t)}))]})]}),!b&&(0,l.jsx)(f.zx,{label:(null===p||void 0===p?void 0:p.length)>0?(null===p||void 0===p?void 0:p.length)>1?null===y||void 0===y||null===(n=y.selectScreen)||void 0===n?void 0:n.returnMultiple:null===y||void 0===y||null===(r=y.selectScreen)||void 0===r?void 0:r.returnOne:null===y||void 0===y||null===(i=y.selectScreen)||void 0===i?void 0:i.selectItems,style:"primary",type:"button",size:"lg",onClick:function(e){e.preventDefault();var t=[];p.forEach((function(e){var n,r=(null===(n=c.item_info)||void 0===n?void 0:n.find((function(t){return t.id===e})))||d.find((function(t){return t.id===e})),i=0,l=0;if(r){r.return_quantity&&r.return_quantity>0?i=r.return_quantity:r.eligible_quantity_can_be_return?(i=1,l=r.eligible_quantity_can_be_return):(i=1,l=r.quantity);var o={id:r.id,quantity:i,totalQuantity:l,reason_id:r.reason_id||1,reason_comment:r.reason_comment||null,product_image_link:r.product_image_link||null,images:r.images,description:r.description,sku:r.sku,price:r.price};t.push(o)}m(w({},c,{item_info:t})),a(w({},u,{returnStage:"itemsSelected"}))}))},disabled:p.length<1,className:"sticky bottom-20 py-2"})]})};function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e}var P=function(e){var t=e.state,n=e.setState,r=e.reasons,i=e.items,o=e.returnData,s=e.setReturnData,u=e.labels;return(0,l.jsxs)("div",{className:"p-4 h-full flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(f.ks,{onClick:function(){return n(I({},t,{returnStage:"showItems"}))}})," ",(0,l.jsx)("span",{className:"ml-2 text-primary text-md md:text-xl font-bold",children:null===u||void 0===u?void 0:u.reasonScreen.returnReason})]}),(0,l.jsx)("div",{className:"overflow-y-auto h-full md:h-5/6 pb-4 pt-2",children:i.map((function(e,a){return(0,l.jsxs)("div",{className:"rounded flex flex-col mb-6 last:mb-0",children:[(0,l.jsxs)("span",{className:"mb-4 font-semibold text-primary",children:[null===u||void 0===u?void 0:u.reasonScreen.item," ",a+1," of ",i.length]}),(0,l.jsxs)("div",{className:"rounded-md pt-4 md:pt-0 bg-white overflow-hidden",children:[(0,l.jsx)("div",{className:"md:py-6 px-4 md:px-8",children:(0,l.jsx)(f.qg,{item:e,state:t,setState:n,isReasonForm:!0,noBorder:!0,items:[],returnData:o,setReturnData:s,isReturnEligible:!0,labels:u})}),(0,l.jsx)("div",{className:"border-t border-t-gray2 mt-2 mx-4 md:mx-0"}),(0,l.jsx)(f.s2,{reasons:r,state:t,setState:n,returnData:o,setReturnData:s,item:e,labels:u})]})]},a)}))}),(0,l.jsx)("div",{className:"mt-auto",children:(0,l.jsx)(f.zx,{type:"submit",style:"primary",className:"w-full mt-4",onClick:function(e){e.preventDefault();var i=[];o.item_info.length>0&&o.item_info.forEach((function(e){var t,n=r.find((function(t){return t.id===e.reason_id})),l=(null===n||void 0===n?void 0:n.imageQuantity)>0,o=e.product_image_link?null===(t=e.product_image_link.split(","))||void 0===t?void 0:t.length:0;l&&0===o&&i.push(e.id)})),i.length>0&&a.ZP.error(null===u||void 0===u?void 0:u.reasonScreen.imageMandatory),s(I({},o,{imageUploadErrorIDs:i})),0===i.length&&n(I({},t,{returnStage:"reasonSelected"}))},size:"lg",label:null===u||void 0===u?void 0:u.reasonScreen.proceed})})]})};function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){R(e,t,n[t])}))}return e}var C=function(e){var t,n,r,i,o,s,u,a,d,c,m,v,p,h,b,y,x,g,_,j,S,w,N,k,O,I,P,R,C,E,T,q,F,A,z,Z,L,M,J=e.state,U=e.setState,V=e.returnData,W=e.setReturnData,B=e.config,X=e.labels,$=function(e){W(D({},V,{return_amount_in_store_credit:"storeCredit"===e}))};return(null===B||void 0===B||null===(t=B.return_plugin_setting_data)||void 0===t||null===(n=t.refundTypes)||void 0===n||null===(r=n.backToSource)||void 0===r?void 0:r.enabled)||!(null===B||void 0===B||null===(i=B.return_plugin_setting_data)||void 0===i||null===(o=i.refundTypes)||void 0===o||null===(s=o.storeCredits)||void 0===s?void 0:s.enabled)||V.return_amount_in_store_credit||$("storeCredit"),(0,l.jsxs)("div",{className:"p-4 h-full flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(f.ks,{onClick:function(){return U(D({},J,{returnStage:"itemsSelected"}))}}),(0,l.jsx)("span",{className:"ml-2 text-primary text-md md:text-xl font-bold",children:null===X||void 0===X?void 0:X.refundScreen.selectRefund})]}),(0,l.jsx)("div",{className:"rounded bg-white h-full p-4 md:p-8 flex flex-col justify-between",children:(0,l.jsxs)("div",{children:[(null===B||void 0===B||null===(u=B.return_plugin_setting_data)||void 0===u||null===(a=u.refundTypes)||void 0===a||null===(d=a.storeCredits)||void 0===d?void 0:d.enabled)&&(0,l.jsx)(f.RO,{onClick:function(){return $("storeCredit")},isSelected:!0===V.return_amount_in_store_credit,title:null===X||void 0===X?void 0:X.refundScreen.storeCredits,description:(null===B||void 0===B||null===(c=B.return_plugin_setting_data)||void 0===c||null===(m=c.refundTypes)||void 0===m||null===(v=m.storeCredits)||void 0===v||null===(p=v.instructions)||void 0===p?void 0:p.length)>0?null===B||void 0===B||null===(h=B.return_plugin_setting_data)||void 0===h||null===(b=h.refundTypes)||void 0===b||null===(y=b.storeCredits)||void 0===y?void 0:y.instructions:null===X||void 0===X?void 0:X.refundScreen.storeCredits}),(null===B||void 0===B||null===(x=B.return_plugin_setting_data)||void 0===x||null===(g=x.refundTypes)||void 0===g||null===(_=g.backToSource)||void 0===_?void 0:_.enabled)&&(0,l.jsx)(f.RO,{onClick:function(){return $("backToSource")},isSelected:!1===V.return_amount_in_store_credit,title:null===X||void 0===X?void 0:X.refundScreen.backToSource,description:(null===B||void 0===B||null===(j=B.return_plugin_setting_data)||void 0===j||null===(S=j.refundTypes)||void 0===S||null===(w=S.backToSource)||void 0===w||null===(N=w.instructions)||void 0===N?void 0:N.length)>0?null===B||void 0===B||null===(k=B.return_plugin_setting_data)||void 0===k||null===(O=k.refundTypes)||void 0===O||null===(I=O.backToSource)||void 0===I?void 0:I.instructions:"Can take 5-7 business days"}),(null===B||void 0===B||null===(P=B.return_plugin_setting_data)||void 0===P||null===(R=P.refundTypes)||void 0===R||null===(C=R.storeCredits)||void 0===C?void 0:C.enabled)||(null===B||void 0===B||null===(E=B.return_plugin_setting_data)||void 0===E||null===(T=E.refundTypes)||void 0===T||null===(q=T.backToSource)||void 0===q?void 0:q.enabled)?null:(0,l.jsx)("p",{children:"Refund mode is not configured. Please contact your Customer Success team."})]})}),(0,l.jsx)(f.zx,{label:null===X||void 0===X?void 0:X.refundScreen.viewSummary,style:"primary",size:"lg",onClick:function(){return U(D({},J,{returnStage:"refundModeSelected"}))},disabled:null===V.return_amount_in_store_credit||!(null===B||void 0===B||null===(F=B.return_plugin_setting_data)||void 0===F||null===(A=F.refundTypes)||void 0===A||null===(z=A.storeCredits)||void 0===z?void 0:z.enabled)&&!(null===B||void 0===B||null===(Z=B.return_plugin_setting_data)||void 0===Z||null===(L=Z.refundTypes)||void 0===L||null===(M=L.backToSource)||void 0===M?void 0:M.enabled),className:"w-full my-4"})]})},E=function(e){var t=e.isMobile,n=e.status,r=e.allStatuses,i=e.resetState,o=e.labels;return(0,l.jsxs)("div",{className:"my-3 p-2 md:p-4 h-full flex flex-col relative",children:[(0,l.jsx)("div",{className:"rounded bg-white max-h-[calc(100%-42px-2rem)] py-2 md:py-4 md:h-5/6 ".concat(t?"":"border border-gray3"),children:(0,l.jsxs)("div",{className:"h-full overflow-y-auto flex flex-col",children:[(0,l.jsxs)("div",{className:"flex flex-col py-8 bg-primary mx-6 md:mx-12 rounded justify-center items-center mt-4",children:[(0,l.jsx)(f.zR,{}),(0,l.jsx)("div",{className:"mt-4 mb-2 text-primary font-semibold text-center",children:null===o||void 0===o?void 0:o.statusScreen.returnRequested}),(0,l.jsx)("div",{className:"mt-2 mb-2 text-secondary text-sm text-center",children:n})]}),(0,l.jsx)(f.TY,{statuses:r,labels:o})]})}),(0,l.jsx)(f.zx,{style:"primary",className:"w-full mt-5",label:null===o||void 0===o?void 0:o.statusScreen.continue,size:"lg",onClick:i})]})};function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){T(e,t,n[t])}))}return e}var F=function(e){var t,n,r,i,s,u,a,d,c,m,v,p,h,b=e.state,y=e.setState,x=e.returnData,g=e.setReturnData,_=e.onSubmit,j=e.config,S=e.isMobile,w=e.labels,N=e.pincodeOptional,k=e.hideWarehouse,O=(0,o.useState)({show:!1,text:null!==(m=null===j||void 0===j||null===(t=j.return_plugin_setting_data)||void 0===t?void 0:t.disclaimer)&&void 0!==m?m:"Drop/ship your return items in/to the above address with original packaging and tags."}),I=O[0],P=O[1];return(0,l.jsxs)("div",{className:"p-4 h-full flex-col flex",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(f.ks,{onClick:function(){return y(q({},b,{returnStage:"reasonSelected"}))}}),(0,l.jsx)("span",{className:"ml-2 text-primary text-md md:text-xl font-bold",children:null===w||void 0===w?void 0:w.summaryScreen.returnSummary})]}),(0,l.jsx)("div",{className:"flex flex-col bg-white rounded-md justify-between h-[calc(100%-110px)] px-4 pt-4 md:px-8",children:(0,l.jsxs)("div",{className:"overflow-y-auto h-full",children:[(0,l.jsxs)("div",{className:"border-b pb-4 border-gray3",children:[(0,l.jsx)("div",{className:"text-sm text-primary mb-4 font-semibold",children:x.item_info.length>1?null===w||void 0===w||null===(n=w.summaryScreen)||void 0===n?void 0:n.returnMultiple:null===w||void 0===w||null===(r=w.summaryScreen)||void 0===r?void 0:r.returnOne}),x.item_info.map((function(e,t){return(0,l.jsx)(f.qg,{item:e,state:b,setState:y,returnData:x,setReturnData:g,isReturnEligible:!0,noBorder:!0,items:[],showEdit:!0,labels:w},t)}))]}),(0,l.jsx)("div",{className:"border-b border-gray3 py-6",children:(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsxs)("div",{className:"w-3/4 md:5/6",children:[(0,l.jsx)("div",{className:"text-sm text-primary font-semibold mb-2",children:null===w||void 0===w?void 0:w.summaryScreen.refundMode}),(0,l.jsx)("span",{className:"text-secondary text-sm",children:x.return_amount_in_store_credit?null===w||void 0===w?void 0:w.summaryScreen.storeCredits:null===w||void 0===w?void 0:w.summaryScreen.backToSource})]}),(0,l.jsx)("div",{className:"w-1/4 md:1/6 justify-end flex",children:(0,l.jsx)("div",{className:"w-[36px] h-[36px] rounded-full border border-gray3 flex items-center justify-center text-button-secondary hover:bg-button-primary hover:text-button-primary cursor-pointer",role:"presentation",onClick:function(){return y(q({},b,{returnStage:"reasonSelected"}))},children:(0,l.jsx)("span",{className:"material-icons text-base",children:"edit"})})})]})}),k?null:(0,l.jsxs)("div",{className:"pt-6 pb-4",children:[(0,l.jsx)("div",{className:"text-sm text-primary font-semibold",children:null===w||void 0===w?void 0:w.summaryScreen.address}),(0,l.jsx)("span",{className:"text-secondary text-sm",children:null!==(v=null===j||void 0===j?void 0:j.self_ship_address)&&void 0!==v?v:"Contact Customer Support for the shipping address"})]}),(0,l.jsxs)("div",{className:"p-4 border border-button-primary bg-primary rounded-md mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center mb-1",children:[(0,l.jsx)("span",{className:"material-icons text-button-secondary mr-3",children:"info"}),(0,l.jsx)("span",{className:"text-primary text-sm font-semibold",children:null===w||void 0===w?void 0:w.summaryScreen.instructions})]}),(0,l.jsxs)("div",{className:"text-sm text-primary ml-8",children:[I.show?I.text:I.text.substring(0,S?84:120),I.text.length>(S?84:120)&&(0,l.jsxs)("div",{className:"text-button-secondary cursor-pointer flex items-center mt-1",onClick:function(){P(q({},I,{show:!I.show}))},role:"presentation",children:["View ",I.show?"less":"more",(0,l.jsx)("span",{className:"material-icons ml-1",children:I.show?"keyboard_arrow_up":"keyboard_arrow_down"})]})]})]}),!N&&(0,l.jsxs)("div",{className:"border-t border-gray3 mt-5 py-4 flex items-center text-base justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-icons text-button-secondary text-lg",children:"location_on"}),"Add ZIP Code",(0,l.jsx)(f.u,{text:"Mandatory for Label Generated Returns",placement:"right",children:(0,l.jsx)("span",{className:"material-icons text-gray text-base",children:"info"})})]}),(0,l.jsx)(f.II,{field:{name:"return_pin_code",placeholder:null!==(p=null===w||void 0===w?void 0:w.pincode)&&void 0!==p?p:"Enter your ZIP/PIN Code here",value:x.return_info.return_pin_code},error:(null===x||void 0===x||null===(i=x.return_info)||void 0===i?void 0:i.return_pin_code)&&0!==(null===x||void 0===x||null===(s=x.return_info)||void 0===s||null===(u=s.return_pin_code)||void 0===u?void 0:u.length)?"":null!==(h=null===w||void 0===w?void 0:w.error.required)&&void 0!==h?h:"This field is required",classNames:{wrapper:"text-secondary w-60"},size:"sm",onChange:function(e){x.return_info.return_pin_code=e.target.value,g(q({},x))}})]})]})}),(0,l.jsx)(f.zx,{label:null===w||void 0===w?void 0:w.summaryScreen.placeReturn,type:"button",size:"lg",style:"primary",onClick:_,className:"mt-4 w-full",disabled:!N&&(!(null===x||void 0===x||null===(a=x.return_info)||void 0===a?void 0:a.return_pin_code)||(null===x||void 0===x||null===(d=x.return_info)||void 0===d||null===(c=d.return_pin_code)||void 0===c?void 0:c.length)<5)})]})},A=n(4404),z=n(2757),Z=n(4882),L=n(9032);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){J(e,t,n[t])}))}return e}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,l=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(u){s=!0,i=u}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W=function(e){var t,n,r=e.state,i=e.setState,o=e.allItems,u=e.returnData,a=e.setReturnData,d=e.returnItemTemplate,c=e.items,m=e.setItems,v=e.noReturnItems,p=e.labels,h=(0,s.useRouter)(),b=function(e){var t=e.item;return(0,l.jsx)(f.qg,{item:t,isReturnedItem:t.return_quantity&&t.return_quantity>0,isReturnEligible:t.shipment_eligible_for_return,returnData:u,setReturnData:a,returnItemTemplate:d,toggleItemSelection:null,items:c,state:r,setState:i,labels:p,isDisplayOnly:!(t.return_quantity&&t.return_quantity>0)})};return(0,l.jsx)("div",{className:"p-4 flex flex-col justify-between relative h-full w-full",children:(0,l.jsxs)("div",{className:"h-[calc(100%-50px)] w-full flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(f.ks,{onClick:function(){i(U({},r,{returnStage:"",isLoading:!0})),m([]),h.push("/returns")}}),(0,l.jsx)("span",{className:"ml-2 text-primary text-md font-bold md:text-xl",children:v?null===p||void 0===p?void 0:p.selectScreen.notReturnable:null===p||void 0===p?void 0:p.selectScreen.selectShipment})]}),(0,l.jsxs)("p",{className:"mb-4 text-primary",children:[(0,l.jsxs)("span",{children:[null===p||void 0===p?void 0:p.selectScreen.orderID," :"]})," ",null!==(n=null===r||void 0===r||null===(t=r.shipment)||void 0===t?void 0:t.reference_number)&&void 0!==n?n:"---"]}),(0,l.jsx)("div",{className:"overflow-y-auto w-full h-full",children:r.shipmentItems.awbs.map((function(e,t){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-secondary",children:"AWB: "}),e]}),o.filter((function(t){return t.tracking_info__awb===e})).some((function(e){return e.shipment_eligible_for_return}))&&(0,l.jsx)(L.Z,{label:"Start Return",onClick:function(){return function(e){var t=V(o.filter((function(t){return t.tracking_info__awb===e})),1)[0];a(U({},u,{awb:t.tracking_info__awb,shipment_uuid:t.tracking_info__shipment_uuid})),i(U({},r,{returnStage:"showItems"}))}(e)},style:"primary"})]}),o.filter((function(t){return t.tracking_info__awb===e&&!("Return request already placed"===t.non_return_reason)})).map((function(e,t){return(0,l.jsx)(b,{item:e},t)}))]})}))})]})})};function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e,t,n,r,i,l,o){try{var s=e[l](o),u=s.value}catch(a){return void n(a)}s.done?t(u):Promise.resolve(u).then(r,i)}function $(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function o(e){X(l,r,i,o,s,"next",e)}function s(e){X(l,r,i,o,s,"throw",e)}o(void 0)}))}}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){G(e,t,n[t])}))}return e}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,l=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(u){s=!0,i=u}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return l}}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){if(e){if("string"===typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}var ee=(0,u.default)((function(){return n.e(461).then(n.bind(n,7461))}),{loadableGenerated:{webpack:function(){return[7461]}},ssr:!1}),te=!0,ne=function(e){var t,n,r,u,v,f,p,h,b,y,x,g,j,S,w=e.theme,N=e.config,O=e.subdomain,I=e.advancedConfig,R=(0,s.useRouter)(),D=R.asPath,T=R.locale,q=H(D.split("?"),2)[1],L=void 0===q?"":q,M=(0,o.useState)(JSON.parse(JSON.stringify(Z.Mx))),J=M[0],U=M[1],V=(0,o.useState)("default"),B=V[0],X=V[1],G=(0,o.useState)([]),K=G[0],te=G[1],ne=(0,o.useState)(Z.I9),re=ne[0],ie=ne[1],le=(0,o.useState)([]),oe=le[0],se=le[1],ue=(0,o.useState)(""),ae=ue[0],de=ue[1],ce=(0,o.useState)(!1),me=ce[0],ve=ce[1],fe=(0,A.ac)("(max-width: 500px)"),pe=(0,z.Z)(T,null===I||void 0===I||null===(t=I.returns)||void 0===t?void 0:t.languages),he=pe.loading,be=pe.text;(0,o.useEffect)((function(){var e=L.split("&").reduce((function(e,t){var n=H(t.split("="),2),r=n[0],i=n[1];return e.set(r,i),e}),new Map),t=e.get("email"),n=e.get("reference_number"),r=e.get("phone_number");n&&(t||r)&&O&&J.isLoading&&(J.orderDetails.reference_number=n.trim(),t&&(J.orderDetails.email=t.trim()),r&&(J.orderDetails.phone_number=r.trim()),U(Q({},J)),ye(J.orderDetails),ge())}),[L,O]),(0,o.useEffect)((function(){var e,t,n,r;window&&((0,A.iv)().width>500?de(null===w||void 0===w||null===(e=w.header)||void 0===e||null===(t=e.logo)||void 0===t?void 0:t.desktop):de(null===w||void 0===w||null===(n=w.header)||void 0===n||null===(r=n.logo)||void 0===r?void 0:r.mobile))}),[w]),(0,o.useEffect)((function(){var e,t,n,r,i,l,o,s,u,a,d,c;if(null===I||void 0===I||null===(e=I.returns)||void 0===e||null===(t=e.login)||void 0===t?void 0:t.method)Z.N3[null!==(c=I.returns.login.method)&&void 0!==c?c:"email"].input_fields.forEach((function(e,t){var n,r;J.orderFields[t].label=e,J.orderFields[t].key=null!==(r=null===N||void 0===N||null===(n=N.return_authorization_config)||void 0===n?void 0:n.url_params[e])&&void 0!==r?r:J.orderFields[t].key})),J.isConfigLoaded=!0;else if((null===N||void 0===N||null===(n=N.return_authorization_config)||void 0===n||null===(r=n.input_fields)||void 0===r?void 0:r.length)>0&&(null===N||void 0===N||null===(i=N.return_authorization_config)||void 0===i?void 0:i.url_params)){var m;null===N||void 0===N||null===(m=N.return_authorization_config)||void 0===m||m.input_fields.forEach((function(e,t){var n,r;J.orderFields[t].label=e,J.orderFields[t].key=null!==(r=null===N||void 0===N||null===(n=N.return_authorization_config)||void 0===n?void 0:n.url_params[e])&&void 0!==r?r:J.orderFields[t].key})),J.isConfigLoaded=!0}"phone"!==(null===I||void 0===I||null===(l=I.returns)||void 0===l||null===(o=l.login)||void 0===o?void 0:o.method)&&"email"!==(null===I||void 0===I||null===(s=I.returns)||void 0===s||null===(u=s.login)||void 0===u?void 0:u.method)&&2!==(null===N||void 0===N||null===(a=N.return_authorization_config)||void 0===a||null===(d=a.input_fields)||void 0===d?void 0:d.length)||(J.orderFields=J.orderFields.filter((function(e,t){return 2!==t}))),U(Q({},J))}),[I,N]);var ye=function(){var e=$(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.ZP.loading("Fetching order details..."),!((null===(r=Object.keys(t))||void 0===r?void 0:r.length)>=2)){e.next=10;break}return U(Q({},J,{buttonStatus:"submitting"})),e.next=6,fetch("/api/get/".concat(r[0],"=").concat(t[r[0]],"/").concat(r[1],"=").concat(t[r[1]],"/domain=").concat(O));case 6:e.sent.json().then((function(e){var t,r,i;200===(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.status)&&(null===e||void 0===e?void 0:e.result)?(a.ZP.success("Order details fetched successfully",{id:n}),xe(e)):(a.ZP.error(null!==(i=null===e||void 0===e||null===(r=e.meta)||void 0===r?void 0:r.message)&&void 0!==i?i:be.error.something,{id:n}),U(Q({},J,{isLoading:!1,buttonStatus:""})))})).catch((function(e){a.ZP.error(null!==e&&void 0!==e?e:be.error.support,{id:n})})),e.next=11;break;case 10:a.ZP.error(be.error.support,{id:n});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xe=function(e){var t,n,r,i,l,o,s=null!==(r=e.result.item_info)&&void 0!==r?r:[],u=[];(null===s||void 0===s?void 0:s.length)>0&&(s.forEach((function(e){u.push(e.tracking_info__awb)})),u=Y(new Set(u))),U(Q({},J,{shipment:Q({},e.result,{item_info:e.result.item_info}),shipmentItems:{returned:null!==(i=e.result.return_info.map((function(t){var n,r;return Q({},t,{tracking_info__awb:null===(r=null===(n=e.result.item_info)||void 0===n?void 0:n.find((function(e){return e.id===t.item_info_id})))||void 0===r?void 0:r.tracking_info__awb})})))&&void 0!==i?i:[],returnable:null!==(l=null===(t=e.result.item_info)||void 0===t?void 0:t.filter((function(e){return e.shipment_eligible_for_return&&e.eligible_quantity_can_be_return>0})))&&void 0!==l?l:[],nonReturnable:null!==(o=null===(n=e.result.item_info)||void 0===n?void 0:n.filter((function(e){return!e.shipment_eligible_for_return||e.non_return_reason})))&&void 0!==o?o:[],hasMultipleShipments:(null===u||void 0===u?void 0:u.length)>1,awbs:u},returnStage:(null===u||void 0===u?void 0:u.length)>1?"shipmentSelection":"showItems",isLoading:!1,buttonStatus:""}))},ge=function(){var e=$(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/reasons/".concat(null!==O&&void 0!==O?O:J.subdomain),{method:"GET"});case 2:e.sent.json().then((function(e){var t,n,r,i,l;200===(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.status)&&(null===e||void 0===e||null===(n=e.result)||void 0===n?void 0:n.return_reasons)?te(null===e||void 0===e||null===(r=e.result)||void 0===r?void 0:r.return_reasons):(a.ZP.error(null!==(l=null===e||void 0===e||null===(i=e.meta)||void 0===i?void 0:i.message)&&void 0!==l?l:be.error.something),U(Q({},J,{isLoading:!1})))})).catch((function(e){return a.ZP.error(e+be.error.something+be.error.support)}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){var e,t;(null===J||void 0===J||null===(e=J.shipment)||void 0===e||null===(t=e.return_address)||void 0===t?void 0:t.length)>0&&we()}),[(null===J||void 0===J||null===(n=J.shipment)||void 0===n?void 0:n.return_address)&&!J.isLoading]);var _e,je,Se,we=function(){var e=$(i().mark((function e(){var t,n,r,l,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=(0,A.rg)(J.shipment.return_address[0]),ie(Q({},re,{return_info:r,shipment_uuid:null===(t=J.shipment)||void 0===t?void 0:t.shipment_uuid,awb:null===(n=J.shipment)||void 0===n?void 0:n.awb,domain:J.subdomain,source:null!==(l=J.source)&&void 0!==l?l:null,token:null!==(o=J.token)&&void 0!==o?o:null,item_info:[],self_shipped:!0,return_amount_in_store_credit:!1}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=$(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),U(Q({},J,{buttonStatus:"submitting"})),(n=re).domain=null!==O&&void 0!==O?O:J.subdomain,n.item_info.forEach((function(e){var t=K.find((function(t){return t.id===e.reason_id}));t&&t.name&&(e.return_reason_data=t.name)})),e.next=7,fetch("/api/post/",{method:"POST",body:JSON.stringify(n)});case 7:e.sent.json().then((function(e){var t;if(200===(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.status)&&(null===e||void 0===e?void 0:e.result))U(Q({},J,{returnStage:"returnConfirmed",returnResult:null===e||void 0===e?void 0:e.result,buttonStatus:"submitted"}));else{var n;if(500===(null===e||void 0===e?void 0:e.status))a.ZP.error("We are unable to process your return request at the moment. Please contact your Store Support Team");else a.ZP.error(be.error.customerSuccess+". "+JSON.stringify(null!==(n=null===e||void 0===e?void 0:e.error)&&void 0!==n?n:""),{duration:5e3});U(Q({},J,{returnResult:[],buttonStatus:""}))}})).catch((function(e){return a.ZP.error(e+be.error.something+be.error.support)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ke=(0,d.LN)(null===w||void 0===w||null===(r=w.meta)||void 0===r?void 0:r.websiteURL);return(0,o.useEffect)((function(){O&&U(Q({},J,{subdomain:O}))}),[O]),(0,o.useEffect)((function(){var e,t,n,r,i,l=null===I||void 0===I||null===(e=I.returns)||void 0===e||null===(t=e.languages)||void 0===t?void 0:t.type;"default"===T&&"new"!==l&&"custom"!==l?X(null!==(i=null===I||void 0===I||null===(n=I.returns)||void 0===n||null===(r=n.languages)||void 0===r?void 0:r.default)&&void 0!==i?i:"en"):X(T)}),[]),(0,l.jsxs)("div",{className:" max-h-full h-full",children:[(0,l.jsx)(ee,{theme:w,logo:ae,advancedConfig:I,lang:B,setLang:X,handleSelect:function(e){X(e),R.push(D,void 0,{locale:"custom"===e?"default":e})},locale:T}),(0,l.jsxs)(c.Z,{theme:w,showHeroImage:!1,children:[J.isConfigLoaded&&""===J.returnStage&&!he&&(0,l.jsx)(_,{state:J,agree:me,setAgree:ve,returnPolicy:null!==(_e=null===w||void 0===w||null===(u=w.footerLinks)||void 0===u?void 0:u.returnPolicy)&&void 0!==_e?_e:"",refundPolicy:null!==(je=null===w||void 0===w||null===(v=w.footerLinks)||void 0===v?void 0:v.refundPolicy)&&void 0!==je?je:"",privacyPolicy:null!==(Se=null===w||void 0===w||null===(f=w.footerLinks)||void 0===f?void 0:f.privacyPolicy)&&void 0!==Se?Se:"",fetchReasons:ge,processLogin:xe,domain:null!==O&&void 0!==O?O:J.subdomain,labels:be,conditionsData:null===I||void 0===I||null===(p=I.returns)||void 0===p||null===(h=p.login)||void 0===h?void 0:h.condition}),"shipmentSelection"===J.returnStage&&(0,l.jsx)(W,{state:J,setState:U,allItems:Y(J.shipmentItems.returnable).concat(Y(J.shipmentItems.returned),Y(J.shipmentItems.nonReturnable)),returnData:re,setReturnData:ie,returnItemTemplate:Z.wu,items:oe,setItems:se,noReturnItems:0===J.shipmentItems.returnable.length,labels:be}),"showItems"===J.returnStage&&(0,l.jsx)(k,{state:J,setState:U,allItems:Y(J.shipmentItems.returnable).concat(Y(J.shipmentItems.returned),Y(J.shipmentItems.nonReturnable)),returnData:re,setReturnData:ie,returnItemTemplate:Z.wu,items:oe,setItems:se,noReturnItems:0===J.shipmentItems.returnable.length,labels:be}),"itemsSelected"===J.returnStage&&(0,l.jsx)(P,{state:J,setState:U,isMobile:fe,reasons:K,items:re.item_info,returnData:re,setReturnData:ie,labels:be}),"reasonSelected"===J.returnStage&&(0,l.jsx)(C,{state:J,setState:U,isMobile:fe,returnData:re,setReturnData:ie,config:N,labels:be}),"refundModeSelected"===J.returnStage&&(0,l.jsx)(F,{state:J,setState:U,isMobile:fe,returnData:re,setReturnData:ie,onSubmit:Ne,config:N,labels:be,pincodeOptional:!(null===I||void 0===I?void 0:I.returns)||(null===I||void 0===I||null===(b=I.returns)||void 0===b?void 0:b.pincodeOptional),hideWarehouse:null===I||void 0===I||null===(y=I.returns)||void 0===y||null===(x=y.warehouseAddress)||void 0===x?void 0:x.hide}),"returnConfirmed"===J.returnStage&&(0,l.jsx)(E,{isMobile:fe,status:(null===(g=J.returnResult)||void 0===g||null===(j=g.return_id)||void 0===j?void 0:j.length)>0?(0,l.jsxs)(l.Fragment,{children:[be.statusScreen.referenceNumber,":",(0,l.jsx)("span",{className:"font-semibold ml-1",children:null===(S=J.returnResult)||void 0===S?void 0:S.return_id[0]})]}):be.statusScreen.initiated,config:N,allStatuses:[],labels:be,resetState:function(){R.push(ke),U(Q({},JSON.parse(JSON.stringify(Z.Mx)),{subdomain:J.subdomain})),se([])}})]}),(0,l.jsx)(m.Z,{theme:w,isMobile:fe,labels:be})]})}}},function(e){e.O(0,[774,786,414,5,888,179],(function(){return t=7388,e(e.s=t);var t}));var t=e.O();_N_E=t}]);