1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6361],{445:(e,_,a)=>{"use strict";a.r(_),a.d(_,{__N_SSP:()=>A,default:()=>L});var t=a(37876),i=a(14232),n=a(54587),o=a.n(n),r=a(53525),s=a(43646),c=a.n(s),l=a(37073),d=a.n(l),u=a(9295),m=a(86176),g=a(32588),p=a(89099),h=a(71972),v=a(11457),b=a(91040),P=a(88202),f=a(72710),y=a(37734),x=a.n(y),k=a(18303);let N=e=>{var _,a,n,o,r,s;let{closeModal:c,userData:l,account:d,theme:m,setProduct:g,product:p}=e,[h,f]=(0,i.useState)(null!=(_=p.price)?_:null),[y,N]=(0,i.useState)(null!=(a=p.currency)?a:"GMD"),[j,w]=(0,i.useState)(null!=(n=p.name)?n:""),[M,T]=(0,i.useState)(null!=(o=p.description)?o:""),[A,L]=(0,i.useState)(null!=(r=p.quantity)?r:0),[C,I]=(0,i.useState)(null!=(s=p.inventory_type)?s:"unlimited"),[S,D]=(0,i.useState)(!1),E=async e=>{if(e.preventDefault(),j&&h>=10)try{D(!0);let{data:e}=await b.A.put("".concat(P.H$,"/api/products/").concat(p.id),{data:{name:j,description:M,quantity:A,inventory_type:C,currency:y,price:h}},{headers:{Authorization:"Bearer ".concat(l.token)}});g(e),c()}catch(e){(0,u.f1)(e)}finally{D(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"backdrop",onClick:()=>c()}),(0,t.jsxs)("div",{className:x().container,style:{width:"500px"},id:m,children:[(0,t.jsxs)("div",{className:x().heading,children:[(0,t.jsxs)("div",{className:x().heading_text,children:[(0,t.jsx)("h1",{children:"Edit Product"}),(0,t.jsx)("p",{})]}),(0,t.jsx)("i",{className:"fas fa-close",onClick:()=>c(),role:"button"})]}),(0,t.jsx)("div",{className:x().body,children:(0,t.jsxs)("form",{autoComplete:"off",onSubmit:E,children:[(0,t.jsxs)("div",{className:x().form_group,children:[(0,t.jsx)("label",{htmlFor:"name",children:"Name*"}),(0,t.jsx)("input",{type:"text",name:"name",id:"name",value:j,onChange:e=>w(e.target.value),placeholder:"Enter your product name",required:!0})]}),(0,t.jsxs)("div",{className:x().form_group,children:[(0,t.jsx)("label",{htmlFor:"description",children:"Description"}),(0,t.jsx)("textarea",{name:"description",id:"description",value:M,onChange:e=>T(e.target.value),placeholder:"Craft a detailed product description to boost sales by 20%",rows:4})]}),(0,t.jsxs)("div",{className:x().form_group,children:[(0,t.jsx)("label",{htmlFor:"amount",children:"Price in GMD*"}),(0,t.jsx)(k.A,{name:"amount",id:"amount",onChange:e=>f(isNaN(e)?0:e),placeholder:"".concat(y," 0.00"),value:h,min:10,required:!0})]}),(0,t.jsxs)("div",{className:x().form_group,children:[(0,t.jsx)("label",{htmlFor:"quantity",children:"Quantity*"}),(0,t.jsxs)("div",{className:x().input_group,children:[(0,t.jsxs)("select",{name:"type",id:"type",onChange:e=>I(e.target.value),value:C,children:[(0,t.jsx)("option",{value:"unlimited",children:"Unlimited"}),(0,t.jsx)("option",{value:"limited",children:"Limited"})]}),"limited"==C&&(0,t.jsx)("input",{type:"number",name:"quantity",id:"quantity",min:"1",value:A,onChange:e=>L(e.target.valueAsNumber),placeholder:"Enter quantity in stock (e.g., 50)",required:!0})]})]}),(0,t.jsx)("br",{}),S&&(0,t.jsx)(v.A,{}),(0,t.jsx)("div",{className:x().button_rack,children:(0,t.jsx)("button",{className:x().action,type:"submit",disabled:S||!h||h<10,children:"Update Product"})})]})})]})]})};var j=a(79850),w=a(29838),M=a(69945);let T=e=>{let{closeModal:_,userData:a,theme:n,setProduct:o,product:r}=e,[s,c]=(0,i.useState)([]),[l,d]=(0,i.useState)([]),[m,g]=(0,i.useState)(r.imageUrls),[p,h]=(0,i.useState)(!1),f=async e=>{if(e.preventDefault(),s.length||m.length)try{h(!0);let e=new FormData;if(e.append("currentImages",m.join(",")),e.append("toBeDeleted",l.join(",")),s.length>0)for(let _ of s){let a=await (0,w.A)(_);e.append("images",a)}let{data:t}=await b.A.patch("".concat(P.H$,"/api/products/").concat(r.id,"/edit-images"),e,{headers:{Authorization:"Bearer ".concat(a.token)}});o({...r,...t}),_()}catch(e){(0,u.f1)(e)}finally{h(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"backdrop",onClick:p?null:()=>_()}),(0,t.jsxs)("div",{className:x().container,style:{width:"500px",padding:"20px 30px"},id:n,children:[(0,t.jsxs)("div",{className:x().heading,children:[(0,t.jsxs)("div",{className:x().heading_text,children:[(0,t.jsx)("h1",{children:"Update Product Images"}),(0,t.jsx)("p",{})]}),(0,t.jsx)("i",{className:"fas fa-close",onClick:p?null:()=>_(),role:"button"})]}),(0,t.jsx)("div",{className:x().body,children:(0,t.jsxs)("form",{autoComplete:"off",onSubmit:f,children:[(0,t.jsx)("div",{className:x().productImages,children:m.map((e,_)=>(0,t.jsxs)("div",{className:x().productImage,children:[(0,t.jsx)(M.A,{src:e,alt:e}
1),(0,t.jsx)("i",{className:"fas fa-trash-alt",onClick:()=>{g(m.filter((e,a)=>a!==_)),d(_=>[..._,e])}})]},_))}),(0,t.jsx)("div",{className:x().form_group,children:(0,t.jsx)(j.A,{files:s,setFiles:c,maxImages:3-m.length})}),(0,t.jsx)("br",{}),p&&(0,t.jsx)(v.A,{}),(0,t.jsx)("div",{className:x().button_rack,children:(0,t.jsx)("button",{className:x().action,type:"submit",disabled:p||!m.length&&!s.length,children:"Save"})})]})})]})]})};var A=!0;let L=e=>{let{user:_,accounts:a,business:n,id:s}=e,l=(0,p.useRouter)(),{theme:y}=(0,f.D)(),{activeAccount:x}=(0,i.useContext)(m.A),[k,j]=(0,i.useState)(!1),[w,M]=(0,i.useState)(!0),[A,L]=(0,i.useState)(null),[C,I]=(0,i.useState)(0),[S,D]=(0,i.useState)(!1),[E,G]=(0,i.useState)(!1),U=async()=>{(0,u.Uh)("Change Product State","Are you sure you want to change the product state?","warning","Yes, change state").then(async e=>{if(e.isConfirmed)try{D(!0);let{data:e}=await b.A.patch("".concat(P.H$,"/api/products/").concat(A.id,"/change-status"),{status:"active"==A.status?"inactive":"active"},{headers:{Authorization:"Bearer ".concat(_.token)}});L(e)}catch(e){(0,u.f1)(e)}finally{D(!1)}})},z=(0,i.useCallback)(async()=>{if(x&&x.id)try{M(!0);let{data:e}=await b.A.get("".concat(P.H$,"/api/products/single/").concat(s,"?fields=id,imageUrls,price,currency,name,description,payment_url,status,inventory_type,quantity"),{headers:{Authorization:"Bearer ".concat(_.token)}});L(e)}catch(e){(0,u.f1)(e),l.back()}finally{M(!1)}},[_,x]);return(0,i.useEffect)(()=>{z()},[z]),(0,t.jsxs)(r.A,{business:n,userData:_,accounts:a,title:"Edit Product",breadCrumbs:[{title:"Products",link:"/products",active:!1},{title:"Edit Product",link:"/products/orders",active:!0}],children:[E&&(0,t.jsx)(T,{product:A,setProduct:L,userData:_,closeModal:()=>G(!1),theme:y}),k&&(0,t.jsx)(N,{product:A,setProduct:L,userData:_,account:x,closeModal:()=>j(!1),theme:y}),(0,t.jsxs)("div",{className:c().container,children:[(0,t.jsx)(h.A,{productId:s,productTabs:g.AL,activeTab:1,business:n,dynamic:{id:s},user:_,path:"edit-product"}),w||!A?(0,t.jsx)(v.A,{}):(0,t.jsxs)("div",{className:c().product_details,children:[(0,t.jsx)("div",{className:c().product_image_container,id:y,children:(0,t.jsxs)("div",{className:c().imageGallery,children:[(0,t.jsx)("div",{className:c().mainImage,children:(0,t.jsx)(o(),{src:A.imageUrls[C],alt:A.name,className:c().productImage,fill:!0})}),A.imageUrls.length>1&&(0,t.jsx)("div",{className:c().thumbnailContainer,children:A.imageUrls.map((e,_)=>(0,t.jsx)("button",{className:"".concat(c().thumbnail," ").concat(C===_?c().activeThumbnail:""),onClick:()=>I(_),children:(0,t.jsx)(o(),{src:e,alt:"".concat(A.name," thumbnail ").concat(_),fill:!0})},_))}),(0,u._m)("MANAGE_PRODUCT",n.permissions)&&(0,t.jsxs)("button",{className:"".concat(c().editProductImgBtn," update-product-images"),onClick:e=>G(!0),children:[(0,t.jsx)("span",{children:"Edit Product Images"}),(0,t.jsx)("i",{className:"fas fa-image"})]})]})}),(0,t.jsxs)("div",{className:c().product_info,id:y,children:[(0,t.jsxs)("div",{className:c().product_info_details,children:[(0,t.jsx)("h1",{className:c().productName,children:A.name}),A.description&&(0,t.jsx)("p",{className:c().productDescription,children:A.description}),(0,t.jsx)("div",{className:c().priceContainer,children:(0,t.jsx)("span",{className:c().price,children:(0,u.nd)(A.price,A.currency)})}),"limited"==A.inventory_type&&(0,t.jsxs)("div",{className:"".concat(d().slot," ").concat(d().slot_slim),children:[(0,t.jsx)("h5",{children:"Quantity"}),(0,t.jsx)("p",{children:A.quantity})]}),(0,t.jsxs)("div",{className:"".concat(d().slot," ").concat(d().slot_slim),children:[(0,t.jsx)("h5",{children:"Status"}),(0,t.jsx)("p",{children:A.status})]})]}),(0,u._m)("MANAGE_PRODUCT",n.permissions)&&(0,t.jsxs)("div",{className:d().slot_footer,children:[(0,t.jsxs)("button",{onClick:()=>j(!0),className:"edit-product",children:[(0,t.jsx)("i",{className:"fas fa-edit"})," Edit Product"]}),(0,t.jsxs)("button",{onClick:U,disabled:S,style:{backgroundColor:"active"===A.status?"#d92d20":"",borderColor:"active"===A.status?"#d92d20":"",cursor:S?"not-allowed":"pointer"},children:[(0,t.jsx)("i",{className:"fas fa-check",style:{marginRight:"6px"}}),"active"!==A.status?"Activate Product":"Deactivate Product"]})]})]})]})]})]})}},6515:(e,_,a)=>{"use strict";a.d(_,{A:()=>l});var t=a(37876),i=a(14232),n=a(89142),o=a.n(n),r=a(48230),s=a.n(r),c=a(86176);let l=e=>{let{tabs:_,activeIndex:a,business:n,dynamic:r}=e,{activeAccount:l}=(0,i.useContext)(c.A);return(0,t.jsx)("div",{className:o().tab_container,children:_.map((e,_)=>l&&l.test_mode&&e.hideOnTestMode||!(!e.permissions.length||n.permissions.some(_=>e.permissions.includes(_)))?null:(0,t.jsx)(s(),{href:function(e,_){return _?Object.entries(_).reduce((e,_)=>{let[a,t]=_;return e.replace(RegExp("{".concat(a,"}"),"g"),t)},e):e}(e.link,r),passHref:!0,className:"modem-tab ".concat(o().tab," ").concat(a==_?o().active:void 0),prefetch:!0,children:(0,t.jsx)("p",{style:e.color?{color:e.color,fontWeight:500}:{},children:e.title})},e.title))})}},12581:e=>{e.exports={container:"PaymentLink_container__F1SDL",quick_details:"PaymentLink_quick_details__qBwj_",link:"PaymentLink_link__fPu9Q",header:"PaymentLink_header__UToQp",overview:"PaymentLink_overview__kl18k",product_header:"PaymentLink_product_header__7c8mm",title_row:"PaymentLink_title_row__Xh2ah",link_row:"PaymentLink_link_row__WUb9V",icon_button:"PaymentLink_icon_button__oKj__",icon_button_done:"PaymentLink_icon_button_done__UlW66",stats:"PaymentLink_stats__31_EO",stat:"PaymentLink_stat__NZ_PJ",stat_label:"PaymentLink_stat_label__un4ck",stat_value:"PaymentLink_stat_value__Ue7jP",section:"PaymentLink_section__QXgW_",table:"PaymentLink_table__8C1TN",cell_break:"PaymentLink_cell_break__Q3_9R","payment-method":"PaymentLink_payment-method__rE92m",payment_image:"PaymentLink_payment_image__VpmlO","risk-badge":"PaymentLink_risk-badge__ExDat","metadata-section":"PaymentLink_metadata-section__Vi0at",page_skeleton:"PaymentLink_page_skeleton__nOQeO",pl_shimmer:"PaymentLink_pl_shimmer__73V_r",aside:"PaymentLink_aside__hk2LF",button:"PaymentLink_button__C1VuN",danger:"PaymentLink_danger__FIx7s",active:"PaymentLink_active__SMWoQ",inactive:"PaymentLink_inactive__tbvNe",qr
1:"PaymentLink_qr__EIF9P",whatsapp:"PaymentLink_whatsapp__IIKTE",whatsapp_sm:"PaymentLink_whatsapp_sm__qE_ZV",loading:"PaymentLink_loading__RnfId",spin:"PaymentLink_spin__C2f_4",eyebrow:"PaymentLink_eyebrow__lJ0b5",test_tag:"PaymentLink_test_tag__QtmUt",alert:"PaymentLink_alert__Hus9d",stat_method:"PaymentLink_stat_method__foPlv",risk:"PaymentLink_risk__PjZkO",risk_medium:"PaymentLink_risk_medium__2oRs8",risk_high:"PaymentLink_risk_high__njYMv",json:"PaymentLink_json__CHFKA"}},18303:(e,_,a)=>{"use strict";a.d(_,{A:()=>r});var t=a(37876),i=a(58504),n=a(37073),o=a.n(n);let r=e=>{let{value:_,onChange:a,required:n,disabled:r,placeholder:s,min:c,id:l,name:d,autoFocus:u}=e;return(0,t.jsx)(i.Ay,{id:l,name:null!=d?d:"currency",placeholder:s,decimalsLimit:2,allowNegativeValue:!1,autoFocus:u,defaultValue:_,onValueChange:e=>{a(parseFloat(e))},min:null!=c?c:100,className:o().input,required:null!=n&&n,disabled:null!=r&&r})}},29838:(e,_,a)=>{"use strict";a.d(_,{A:()=>o,d:()=>n});var t=a(83587),i=a(87697);let n=async e=>{if(e.size/1048576<.5)return e;try{let _=await e.arrayBuffer(),a=await i.UL4.load(_),t=await a.save({useObjectStreams:!0,addDefaultPage:!1});return new File([t],e.name,{type:"application/pdf"})}catch(_){return e}},o=async e=>{if(e.size/1048576<.3)return e;try{return await (0,t.A)(e,{maxSizeMB:.3,maxWidthOrHeight:900,useWebWorker:!0,initialQuality:.8,fileType:"image/jpeg"})}catch(_){return e}}},37073:e=>{e.exports={container:"Monitor_container__wAX2M",form:"Monitor_form__FVIm6",aside:"Monitor_aside__qSEzO",aside_button:"Monitor_aside_button__Hm_8q",aside_button_draft:"Monitor_aside_button_draft__qvipU",message:"Monitor_message__QTnvW",form_grid:"Monitor_form_grid__rdedj",input:"Monitor_input__8Bz9q",advanced:"Monitor_advanced__TcteA",status:"Monitor_status__hGpbN",heading:"Monitor_heading__79Piu",actions:"Monitor_actions__y7_0k",form_row:"Monitor_form_row__2n5TF",field_hint:"Monitor_field_hint__CbAvB",field_error:"Monitor_field_error__cM63P",test_notice:"Monitor_test_notice___NXgZ",summary_panel:"Monitor_summary_panel__UmxNR",summary_row:"Monitor_summary_row__QB5F3",summary_value:"Monitor_summary_value__y0TZH",summary_total:"Monitor_summary_total__ieE26",summary_negative:"Monitor_summary_negative__e3dxf",form_skeleton:"Monitor_form_skeleton__9LWbz",mon_shimmer:"Monitor_mon_shimmer__W4IAx",button_spinner:"Monitor_button_spinner__pagck",mon_spin:"Monitor_mon_spin__32gvN",custom_field:"Monitor_custom_field__3nsMx",channel_row:"Monitor_channel_row__nwcY1",row_remove:"Monitor_row_remove__9sJ_B",add_row:"Monitor_add_row__WDDoc",optional:"Monitor_optional__6rTDV",section:"Monitor_section__LDJ1W",section_title:"Monitor_section_title__1BSL8",check_group:"Monitor_check_group__Ar_MP",check_chip:"Monitor_check_chip__iXs13",check_chip_on:"Monitor_check_chip_on__JIULG",disclosure:"Monitor_disclosure__xOt_s",count_badge:"Monitor_count_badge__TXULo",advanced_body:"Monitor_advanced_body__8f1VP",customer_lists:"Monitor_customer_lists__vv49D",customer:"Monitor_customer__0f8wB",icon:"Monitor_icon__K3Oes",add_customer:"Monitor_add_customer__mUXd8",block:"Monitor_block__81Bar",invoice_heading:"Monitor_invoice_heading__TUC0b",invoice_status:"Monitor_invoice_status__C8xwK","not-paid":"Monitor_not-paid__5h8jP",overdue:"Monitor_overdue__ERxtD",paid:"Monitor_paid__8eoHD",invoice_view:"Monitor_invoice_view__pNfI4",invoice_heading_details:"Monitor_invoice_heading_details__vPaLG",invoice_logo:"Monitor_invoice_logo__mJGlQ",invoiceNumber:"Monitor_invoiceNumber__IxiNj",invoice_body_table:"Monitor_invoice_body_table__eLiEy",invoice_body:"Monitor_invoice_body__XbmIO",invoice_body_headings:"Monitor_invoice_body_headings__0avUK",lineItem:"Monitor_lineItem__InH7t",add_item:"Monitor_add_item__uwXMj",invoice_footer:"Monitor_invoice_footer__qg6_f",total:"Monitor_total__mjX67",subtotal:"Monitor_subtotal__KMQzK",discount:"Monitor_discount__GHo14",discount_container:"Monitor_discount_container__dLZ_G",slot:"Monitor_slot__KjE55",slot_slim:"Monitor_slot_slim__sLVRI",link:"Monitor_link__6pFA1",slot_footer:"Monitor_slot_footer__KX_8E"}},43646:e=>
1{e.exports={flex:"Page_flex__sPa1V",detail:"Page_detail__XUuvH",description:"Page_description__F5wod",preference_form:"Page_preference_form__hl3G_",filterGroup:"Page_filterGroup__CA9Fa",heading:"Page_heading__p8iqW",search_box:"Page_search_box__5g1ze",export:"Page_export__t7I7T",action_button:"Page_action_button__vWDeZ",div_container:"Page_div_container__8gPad",first:"Page_first__Zj1IW",last:"Page_last__VkJcr",reload:"Page_reload__yZWyu",table_other:"Page_table_other__c3lrA",table:"Page_table__mLSBI",table_empty_row:"Page_table_empty_row__ppq74",skeleton_row:"Page_skeleton_row__nNSlQ",row_selected:"Page_row_selected___yCzp",actions:"Page_actions__ey4p0",cell_strong:"Page_cell_strong__3a20Z",cell_muted:"Page_cell_muted__pS1WG",cell_numeric:"Page_cell_numeric__eQsGW",cell_empty:"Page_cell_empty__IaugL",tfoot:"Page_tfoot__nKctw",tfoot_selection:"Page_tfoot_selection__vaLfx",tfoot_actions:"Page_tfoot_actions__DYyC8",disabled:"Page_disabled__bivjA",table_empty_action:"Page_table_empty_action__E6GsI",skeleton:"Page_skeleton__Y2Hzs",table_shimmer:"Page_table_shimmer__U8RnY",skeleton_check:"Page_skeleton_check__plc3k",skeleton_sm:"Page_skeleton_sm__Pn9DP",skeleton_md:"Page_skeleton_md__LeCIU",skeleton_lg:"Page_skeleton_lg__Jdc1p",table_empty:"Page_table_empty__YKLZP",table_empty_title:"Page_table_empty_title__OcUDj",table_empty_text:"Page_table_empty_text__ju7Kn",table_flush:"Page_table_flush__mjYDf",cell_amount:"Page_cell_amount__26AzR",event_name:"Page_event_name__fczxv",row_link:"Page_row_link__HN4BC",row_offline:"Page_row_offline__z8wLk",method_cell:"Page_method_cell__CukjA",source_online:"Page_source_online__wpdSE",source_offline:"Page_source_offline__KKPcV",transaction_reference:"Page_transaction_reference__lK3oP",paid:"Page_paid__3yPmQ","not-paid":"Page_not-paid__1EYKa",overdue:"Page_overdue__t8sF9",amount_container:"Page_amount_container__l6ZLv",amount:"Page_amount__goAaK",currency:"Page_currency__Og3uq",payment_image:"Page_payment_image__2eOTH",product_table:"Page_product_table__edyG7",product_image:"Page_product_image__8RX_A",product_name:"Page_product_name__lObi1",product_status:"Page_product_status__3UGOb","status-active":"Page_status-active__yhhWo","status-out-of-stock":"Page_status-out-of-stock__1n98Y","status-inactive":"Page_status-inactive__9Yk6e",customizeArea:"Page_customizeArea__ItZuS",product_details:"Page_product_details__tKjR9",customizeSection:"Page_customizeSection__dWcr_",product_image_container:"Page_product_image_container__6bYwg",imageGallery:"Page_imageGallery__QSa_7",mainImage:"Page_mainImage__n8IrA",editProductImgBtn:"Page_editProductImgBtn__8ZIkl",productImage:"Page_productImage__RRJUC",thumbnailContainer:"Page_thumbnailContainer__9xAOy",thumbnail:"Page_thumbnail__AoTcx",activeThumbnail:"Page_activeThumbnail___3ScV",product_info:"Page_product_info__bDncF",product_info_details:"Page_product_info_details__PiUb8",productName:"Page_productName__xIV2o",productDescription:"Page_productDescription__U84O8",priceContainer:"Page_priceContainer__Gdq3Q",price:"Page_price__GRz_G",storefrontConfig:"Page_storefrontConfig__a11aU",telegram_connections:"Page_telegram_connections__LJp0S",add_connection_button:"Page_add_connection_button__yP0I_",no_connections:"Page_no_connections__Hcde1",telegram_connection_item:"Page_telegram_connection_item__Z_vX5",telegram_connection_item__dark:"Page_telegram_connection_item__dark__i2JkF",telegram_connection_info:"Page_telegram_connection_info__YpkrL",telegram_username:"Page_telegram_username__Pbm_c",telegram_chat_id:"Page_telegram_chat_id__z3tR7",remove_connection_button:"Page_remove_connection_button__064hh",configSection:"Page_configSection__Cj240",configSectionInputGroup:"Page_configSectionInputGroup__Mnt_M",socialMediaInputs:"Page_socialMediaInputs__vJA_3",socialMediaInput:"Page_socialMediaInput__pSdAX",socialMediaUrlInput:"Page_socialMediaUrlInput__cpW4l",storefrontPreview:"Page_storefrontPreview__bE7Lh",container:"Page_container__4TqKj",key_group:"Page_key_group__H__hF",generate_button:"Page_generate_button__sOpi2",balances:"Page_balances__XxVRJ",balance:"Page_balance__8n2mZ",note:"Page_note__5Mvzp",balance_bold:"Page_balance_bold__v4wOQ",balance_layout_container:"Page_balance_layout_container__PRRcb",balance_layout:"Page_balance_layout__e6f9K",balance_header:"Page_balance_header__YhTw_",overview_grid:"Page_overview_grid__yzOB6",overview_card:"Page_overview_card__H2VfG",overview_card_head:"Page_overview_card_head__LQcs_",overview_title:"Page_overview_title__iSSWV",overview_label:"Page_overview_label__TQdep",overview_info:"Page_overview_info__UOaUM",overview_amount:"Page_overview_amount__lHq5K",overview_rows:"Page_overview_rows__I6_j_",overview_row:"Page_overview_row__jbT5L",overview_value:"Page_overview_value__5NEVe",overview_total:"Page_overview_total__7rdUw",overview_action:"Page_overview_action__1z4P6",upcoming_list:"Page_upcoming_list__VqsxF",upcoming_item:"Page_upcoming_item__ij44i",upcoming_text:"Page_upcoming_text__E26Kh",upcoming_date:"Page_upcoming_date__4EHfB",upcoming_note:"Page_upcoming_note__DI8DB",upcoming_empty:"Page_upcoming_empty__Tzd3X",pref_page:"Page_pref_page__R_eFp",pref_title:"Page_pref_title__U59i8",pref_readonly:"Page_pref_readonly__mmgnl",pref_section:"Page_pref_section__ZPVKE",pref_heading:"Page_pref_heading__v0bQW",pref_desc:"Page_pref_desc__sCgb9",pref_list:"Page_pref_list__IZvqD",pref_row:"Page_pref_row__ZW8rX",pref_label:"Page_pref_label__VJNco",pref_value:"Page_pref_value__YPn9s",pref_mono:"Page_pref_mono__pSDKz",pref_copy:"Page_pref_copy__8xVdz",pref_copied:"Page_pref_copied__oZrAF",option_grid:"Page_option_grid__JTFwp",option_card:"Page_option_card__wIV_u",option_card_active:"Page_option_card_active__V_RZj",option_card_disabled:"Page_option_card_disabled__mUNMT",option_text:"Page_option_text__6cuuQ",option_title:"Page_option_title__gDIJP",option_desc:"Page_option_desc__NgS4g",option_saving:"Page_option_saving__nNxN4",table_shimmer_spin:"Page_table_shimmer_spin__NKopJ",main:"Page_main__MOW5Q",payment_methods:"Page_payment_methods__Lfy5Z",payment_method:"Page_payment_method__FS0HE",grid:"Page_grid__YvlVv",div:"Page_div__Y9jve",copy:"Page_copy__M5XEl",grid_container:"Page_grid_container__HbSiJ",after_purchase_container:"Page_after_purchase_container__cPkSU",after_purchase_section:"Page_after_purchase_section__dx601",after_purchase_header:"Page_after_purchase_header__cayUK",tooltip:"Page_tooltip__ErYF1",edit_button:"Page_edit_button__Gy7Ja",after_purchase_content:"Page_after_purchase_content__67_my",edit_container:"Page_edit_container__Fv23H",input_field:"Page_input_field__Aba_Y",edit_actions:"Page_edit_actions__B8vR0",cancel_button:"Page_cancel_button__0z_a9",save_button:"Page_save_button__MAT6Z",tip:"Page_tip__yUQIe",thresholdSettings:"Page_thresholdSettings__djS9L",formTitle:"Page_formTitle__a9Wab",formGrid:"Page_formGrid__kZ_tm",settingGroup:"Page_settingGroup__PozkZ",buttonGroup:"Page_buttonGroup__IKMnX",button:"Page_button__H_NzJ",buttonPrimary:"Page_buttonPrimary__n6aYW",buttonSecondary:"Page_buttonSecondary__n1G_v",error:"Page_error__ALqOW",success:"Page_success__wotz_",ke
1ys:"Page_keys__DztvY",key_table:"Page_key_table__Qddnd",key_row_revoked:"Page_key_row_revoked__WWyAt",new_key_panel:"Page_new_key_panel__dQYxG",key_actions:"Page_key_actions__ShY8o",revoke_button:"Page_revoke_button__fyTVH",pagination:"Page_pagination__swtem"}},50477:()=>{},51546:(e,_,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[id]/edit",function(){return a(445)}])},57635:e=>{e.exports={fileGrid:"FileGrid_fileGrid__bHufj",fileItem:"FileGrid_fileItem__iVE_E",imageContainer:"FileGrid_imageContainer__e9YkW",previewImage:"FileGrid_previewImage__AzZmK",overlay:"FileGrid_overlay__ndiAX",deleteButton:"FileGrid_deleteButton__bCDgO",fileInfo:"FileGrid_fileInfo__h3uqx",fileName:"FileGrid_fileName__mNWFL",fileSize:"FileGrid_fileSize__oC98L"}},69945:(e,_,a)=>{"use strict";a.d(_,{A:()=>n});var t=a(37876),i=a(87189);a(7042);let n=e=>{let{src:_,alt:a,className:n,style:o}=e;return(0,t.jsx)(i.LazyLoadImage,{src:_,alt:a,placeholderSrc:"/placeholder.svg",effect:"opacity",style:o,className:n,threshold:10,wrapperClassName:"w-full h-full",loading:"lazy"})}},71972:(e,_,a)=>{"use strict";a.d(_,{A:()=>b});var t=a(37876),i=a(14232),n=a(12581),o=a.n(n),r=a(6515),s=a(9295),c=a(91040),l=a(88202),d=a(48230),u=a.n(d),m=a(89099),g=a(74302),p=a(92523),h=a(13569),v=a(99088);let b=e=>{var _,a;let{productId:n,productTabs:d,activeTab:b,business:P,dynamic:f,user:y,path:x}=e,{product:k,setProductState:N}=(0,i.useContext)(p.A),j=(0,m.useRouter)(),[w,M]=(0,i.useState)(!1),[T,A]=(0,i.useState)([]),[L,C]=(0,i.useState)(!1),I=(0,i.useCallback)(async()=>{try{let{data:e}=await c.A.get("".concat(l.H$,"/api/products/single/").concat(n,"?fields=name,payment_url"),{headers:{Authorization:"Bearer ".concat(y.token)}});N(e)}catch(e){(0,s.f1)(e)}},[n]);(0,i.useEffect)(()=>{I()},[I]),(0,i.useEffect)(()=>{if(x&&!P.onboarding_states.includes(x.toLowerCase())){let e=h.A[x];e&&(A(e),C(!0))}},[x]);let S=async()=>{C(!1);try{let e=new Set(P.onboarding_states);e.add(x.toLowerCase());let _=Array.from(e);await c.A.put("".concat(l.H$,"/api/businesses/").concat(P.id),{data:{onboarding_states:_}},{headers:{Authorization:"Bearer ".concat(y.token)}})}catch(e){}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:o().product_header,children:[(0,t.jsx)("div",{className:o().overview,children:(0,t.jsx)("h2",{children:null!=(_=null==k?void 0:k.name)?_:"..."})}),(0,t.jsxs)("div",{className:o().aside,children:[(0,t.jsx)(g.A,{content:"Share to WhatsApp",children:(0,t.jsx)("button",{className:"".concat(o().whatsapp," whatsapp"),onClick:()=>(0,s.J5)(null==k?void 0:k.payment_url,"\uD83D\uDECDï¸ *".concat(null==k?void 0:k.name,"*\n\n⨠Secure your purchase now: ").concat(null==k?void 0:k.payment_url,"\n\n\uD83D\uDCAB Shop with confidence and enjoy our best prices!\n\n\uD83D\uDCB3 Safe & secure payment\n\uD83D\uDE9A Fast delivery\n\uD83D\uDD12 100% guaranteed\n\n_Get yours today!_ \uD83D\uDC46")),disabled:!k||w,children:(0,t.jsx)("i",{className:"fab fa-whatsapp"})})}),(0,t.jsx)(u(),{href:null!=(a=null==k?void 0:k.payment_url)?a:"",target:"_blank",prefetch:!0,children:(0,t.jsx)("button",{className:"".concat(o().button," preview-product"),disabled:!k||w,children:"Preview"})}),(0,s._m)("MANAGE_PRODUCT",P.permissions)&&(0,t.jsx)("button",{className:"".concat(o().qr," ").concat(o().active," delete-product"),onClick:()=>{(0,s.Uh)("Delete Product","Once deleted, you won't be able to restore this product. Proceed?","warning","Delete product").then(async e=>{if(e.isConfirmed)try{M(!0),await c.A.delete("".concat(l.H$,"/api/products/").concat(n),{headers:{Authorization:"Bearer ".concat(y.token)}}),j.replace("/products")}catch(e){(0,s.f1)(e)}finally{M(!1)}})},disabled:w,children:(0,t.jsx)("i",{className:"fas fa-trash"})})]})]}),(0,t.jsx)(r.A,{tabs:d,activeIndex:b,business:P,dynamic:f}),(0,t.jsx)(v.A,{steps:T,run:L,cleanUp:S})]})}},79850:(e,_,a)=>{"use strict";a.d(_,{A:()=>l});var t=a(37876),i=a(9295),n=a(14232),o=a(30236),r=a(57635),s=a.n(r),c=a(69945);let l=e=>{let{files:_,setFiles:a,maxImages:r=3}=e,l=(0,n.useCallback)(e=>{let t=e.filter(e=>e.size<=6291456),n=r-_.length,o=t.slice(0,n);o.length>0?a([..._,...o.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)}))]):(0,i.f1)(Error("You can only upload up to ".concat(r," images")))},[_]),{getRootProps:d,getInputProps:u}
1=(0,o.VB)({onDrop:l,accept:{"image/*":[]},multiple:!0,maxFiles:r,maxSize:6291456,onDropRejected:e=>{if(e.length>0){let _=e[0].errors[0].message||"You can only upload up to ".concat(r," images");(0,i.f1)(Error(_))}}});return(0,t.jsxs)("div",{children:[_.length<r&&(0,t.jsxs)("div",{...d(),style:{border:"2px dashed #ccc",padding:"20px",cursor:"pointer",textAlign:"center"},children:[(0,t.jsx)("input",{...u()}),(0,t.jsxs)("p",{style:{display:"flex",flexDirection:"column",gap:"0.2rem"},children:[(0,t.jsxs)("span",{children:["Drag & drop a high quality image here, or click to select (max"," ",(0,t.jsx)("b",{children:r})," images, 6MB each)."]}),(0,t.jsx)("span",{style:{color:"#888",fontSize:"0.95em",padding:0,margin:0},children:"Tip: Upload a clear photo of your product, we'll optimize it for speed. High quality images can boost your sales conversion!"})]})]}),_.length>0&&(0,t.jsx)("div",{className:s().fileGrid,children:_.map((e,i)=>(0,t.jsxs)("div",{className:s().fileItem,children:[(0,t.jsx)("div",{className:s().imageContainer,children:(0,t.jsx)(c.A,{src:e.preview,alt:"preview-".concat(i),className:s().previewImage})}),(0,t.jsx)("div",{className:s().overlay}),(0,t.jsx)("button",{onClick:e=>{e.preventDefault(),a(_.filter((e,_)=>_!==i))},className:s().deleteButton,"aria-label":"Remove file ".concat(i+1),children:"\xd7"}),(0,t.jsx)("div",{className:s().fileInfo,children:(0,t.jsx)("p",{className:s().fileName,children:e.name||"File ".concat(i+1)})})]},i))})]})}},89142:e=>{e.exports={tab_container:"TabNavigation_tab_container__OExVz",tab:"TabNavigation_tab__0GgXr",active:"TabNavigation_active__X8EdW",heading:"TabNavigation_heading__51O2h",table_other:"TabNavigation_table_other__JoYB1",table:"TabNavigation_table__KQnbP",container:"TabNavigation_container__LtB8f",balance_layout_container:"TabNavigation_balance_layout_container__KYNi2",grid:"TabNavigation_grid__xAv4Y",first:"TabNavigation_first__JKH_a",last:"TabNavigation_last__M1ycp",balance_layout:"TabNavigation_balance_layout__Y_is2",balances:"TabNavigation_balances__7_Gi8",keys:"TabNavigation_keys__DEI_l",product_details:"TabNavigation_product_details__BUgA7",product_image_container:"TabNavigation_product_image_container__1wuH4",mainImage:"TabNavigation_mainImage__oK2fv",productName:"TabNavigation_productName__yu7Bk",search_box:"TabNavigation_search_box__h7_XE",actions:"TabNavigation_actions__7DZMS",product_table:"TabNavigation_product_table__1q16_",product_image:"TabNavigation_product_image__Wz85R",product_info:"TabNavigation_product_info__Smx0L",grid_container:"TabNavigation_grid_container__e8vay",after_purchase_container:"TabNavigation_after_purchase_container__uWm8O",after_purchase_header:"TabNavigation_after_purchase_header__NPFMl",after_purchase_content:"TabNavigation_after_purchase_content__kQjTm",edit_actions:"TabNavigation_edit_actions__Ih_lM",cancel_button:"TabNavigation_cancel_button__aEGhX",save_button:"TabNavigation_save_button__sB4WW",key_group:"TabNavigation_key_group__XOwK9",export:"TabNavigation_export__2Ve2V",reload:"TabNavigation_reload__7_zHq",tfoot_actions:"TabNavigation_tfoot_actions__C9XZ5",action_button:"TabNavigation_action_button__NH5wx",product_name:"TabNavigation_product_name__fRO8j",thumbnail:"TabNavigation_thumbnail__5Fjtd",thumbnailContainer:"TabNavigation_thumbnailContainer__ABLsU",productDescription:"TabNavigation_productDescription__OWKgu",price:"TabNavigation_price__BJrWC",product_info_details:"TabNavigation_product_info_details__Z85h_",balance:"TabNavigation_balance__rPy6x",balance_header:"TabNavigation_balance_header__jdhWC",generate_button:"TabNavigation_generate_button__L6rYX",input_field:"TabNavigation_input_field__u_yHU",edit_button:"TabNavigation_edit_button__KtBqx",payment_image:"TabNavigation_payment_image__udm0x",after_purchase_section:"TabNavigation_after_purchase_section__Qh6Sv",productImage:"TabNavigation_productImage__i_cfU"}}},e=>{e.O(0,[8230,7838,8504,5738,4587,4851,236,3525,8129,5498,7489,636,6593,8792],()=>e(e.s=51546)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.