(this.webpackJsonpadminpanel=this.webpackJsonpadminpanel||[]).push([[0],{373:function(e,t,s){},380:function(e){e.exports=JSON.parse('{"name":"adminpanel","homepage":"","version":"0.1.0","private":true,"dependencies":{"@material-ui/core":"^4.11.4","@sweetalert/with-react":"^0.1.1","@syncfusion/ej2-react-calendars":"^19.4.48","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^12.8.3","axios":"^0.19.2","bootstrap":"^4.3.1","chart.js":"^4.2.1","crypto-js":"^4.1.1","dotenv":"^10.0.0","eslint-config-standard":"^17.1.0","eslint-plugin-prettier":"^5.1.3","eslintrc":"^1.0.6","file-saver":"^2.0.5","file-upload-with-preview":"^6.0.2","font-awesome":"^4.7.0","fs":"0.0.1-security","html2plaintext":"^2.1.4","jodit":"^4.2.47","jodit-react":"^4.0.2","jquery":"^3.4.1","jsonwebtoken":"^8.5.1","material-table":"^1.69.3","material-ui":"^0.20.2","moment":"^2.29.1","moment-timezone":"^0.5.46","multiselect-react-dropdown":"^2.0.25","node-sass":"^9.0.0","popper.js":"^1.15.0","prettier":"^3.2.5","qrcode":"^1.5.4","quill":"^2.0.2","react":"^17.0.2","react-beautiful-dnd":"^13.1.0","react-bootstrap":"^2.0.2","react-chartjs-2":"^5.2.0","react-checkbox-tree":"^1.8.0","react-confirm":"^0.1.24","react-data-table-component":"^7.5.3","react-date-picker":"^10.0.3","react-datepicker":"^4.11.0","react-datetime-picker":"^4.2.1","react-dialog":"^1.0.2","react-dom":"^17.0.2","react-dropdown-tree-select":"^2.5.1","react-export-excel":"^0.5.3","react-multiple-select-dropdown-lite":"^2.0.5","react-nestable":"^2.0.0","react-number-format":"^4.7.3","react-password-strength-bar":"^0.4.0","react-quill":"^2.0.0","react-rating-stars-component":"^2.2.0","react-router-dom":"^5.1.2","react-scripts":"4.0.3","react-select":"^5.7.0","react-sortable-tree":"^2.8.0","react-spinners":"^0.11.0","react-summernote":"^2.0.2","react-svg":"^14.1.4","react-tag-autocomplete":"^7.3.0","react-tag-input":"^6.10.3","react-toastify":"^7.0.4","read-excel-file":"^5.2.28","simple-react-validator":"^1.6.0","styled-components":"^5.3.5","sweetalert":"^2.1.2","web-vitals":"^1.1.2","xlsx":"^0.18.5","xmlbuilder":"^15.1.1"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.18.6","@types/react-datetime-picker":"^5.0.0","browser-sync":"^2.26.7","compass-mixins":"^0.12.10","eslint":"^7.11.0","eslint-config-prettier":"^9.1.0","eslint-config-standard":"^17.1.0","eslint-plugin-import":"^2.29.1","eslint-plugin-n":"^16.6.2","eslint-plugin-prettier":"^5.1.3","eslint-plugin-promise":"^6.1.1","eslint-plugin-react":"^7.34.1","prettier":"^3.2.5","stylelint":"^16.3.1","stylelint-order":"^6.0.4"},"scripts":{"start":"react-scripts --openssl-legacy-provider start","build":"react-scripts --openssl-legacy-provider build","test":"react-scripts test","eject":"react-scripts eject","secure_start":"set HTTPS=true&&set SSL_CRT_FILE=C:/Windows/System32/cert.crt&&set SSL_KEY_FILE=C:/Windows/System32/cert.key&&react-scripts start","deploy:staging":"aws s3 sync build/ s3://harmony-staging-admin-panel","deploy:live":"aws s3 sync build/ s3://harmony-admin-panel"},"eslintConfig":{"extends":["react-app","react-app/jest"]},"browserslist":[">0.2%","not dead","not op_mini all"]}')},624:function(e,t,s){},625:function(e,t,s){},626:function(e,t,s){},627:function(e,t,s){},633:function(e,t){},635:function(e,t){},670:function(e,t){},672:function(e,t){},673:function(e,t){},679:function(e,t){},681:function(e,t){},684:function(e,t){},686:function(e,t){},706:function(e,t){},722:function(e,t){},725:function(e,t){},760:function(e,t){},997:function(e,t,s){"use strict";s.r(t);var a={};s.r(a),s.d(a,"getToken",(function(){return w})),s.d(a,"encrypt",(function(){return k})),s.d(a,"myheaders",(function(){return S})),s.d(a,"postApi",(function(){return C})),s.d(a,"getApi",(function(){return A})),s.d(a,"S3_BUCKET_URL",(function(){return P}));var c={};s.r(c),s.d(c,"ValidateUser",(function(){return D})),s.d(c,"ValidateToken",(function(){return M})),s.d(c,"GetMetal",(function(){return R})),s.d(c,"GetMetalAdminList",(function(){return F})),s.d(c,"UpdateMetalDetail",(function(){return I})),s.d(c,"GetMetalQuality",(function(){return E})),s.d(c,"GetMetalQualityAdminList",(function(){return L})),s.d(c,"SetMetalQuality",(function(){return G})),s.d(c,"DeleteMetalQuality",(function(){return T})),s.d(c,"GetDiamondShape",(function(){return B})),s.d(c,"GetStoneShapeAdminList",(function(){return z})),s.d(c,"SetDiamondShape",(function(){return U})),s.d(c,"DeleteDiamondShape",(function(){return q})),s.d(c,"GetDiamondMarkup",(function(){return H})),s.d(c,"GetDiamondMarkupAdmin",(function(){return V})),s.d(c,"SetDiamondMarkup",(function(){return K})),s.d(c,"DeleteDiamondMarkup",(function(){return W})),s.d(c,"GetShapeCategory",(function(){return Y})),s.d(c,"GetDiamondQuality",(function(){return Q})),s.d(c,"GetStoneQualityAdminList",(function(){return X})),s.d(c,"SetDiamondQuality",(function(){return J})),s.d(c,"DeleteDiamondQuality",(function(){return Z})),s.d(c,"GetProductSize",(function(){return $})),s.d(c,"GetProductSizeAdminList",(function(){return ee})),s.d(c,"GetProductSizeCategoryList",(function(){return te})),s.d(c,"GetProductSizeExcel",(function(){return se})),s.d(c,"SetProductSize",(function(){return ae})),s.d(c,"DeleteProductSize",(function(){return ce})),s.d(c,"SearchCategory",(function(){return re})),s.d(c,"GetParentCategoryList",(function(){return le})),s.d(c,"GetCategory",(function(){return ne})),s.d(c,"GetCategoryAdminList",(function(){return ie})),s.d(c,"GetSubCategories",(function(){return oe})),s.d(c,"SetCategory",(function(){return de})),s.d(c,"UpdateCategory",(function(){return me})),s.d(c,"GetCategoryDetail",(function(){return ue})),s.d(c,"DeleteCategory",(function(){return je})),s.d(c,"ChangeCategoryAttributeOrder",(function(){return be})),s.d(c,"BestsellerCategory",(function(){return pe})),s.d(c,"GetContentManagementAdminList",(function(){return he})),s.d(c,"GetContentManagementDetail",(function(){return xe})),s.d(c,"GetContentManagementList",(function(){return Oe})),s.d(c,"AddContentManagement",(function(){return ge})),s.d(c,"UpdateContentManagement",(function(){return ve})),s.d(c,"DeleteContentManagement",(function(){return Ne})),s.d(c,"UploadContentImages",(function(){return fe})),s.d(c,"GetNavigationMenuList",(function(){return _e})),s.d(c,"GetAdminNavigationMenuList",(function(){return ye})),s.d(c,"AddNavigationMenuItem",(function(){return we})),s.d(c,"DeleteNavigationMenuItem",(function(){return ke})),s.d(c,"GetNavigationMenuDetail",(function(){return Se})),s.d(c,"UpdateNavigationMenu",(function(){return Ce})),s.d(c,"UpdateNavigationMenuOrder",(function(){return Ae})),s.d(c,"GenerateSitemap",(function(){return Pe})),s.d(c,"AddCustomer",(function(){return De})),s.d(c,"UpdateCustomer",(function(){return Me})),s.d(c,"GetCustomerList",(function(){return Re})),s.d(c,"SearchCustomer",(function(){return Fe})),s.d(c,"GetCustomerAdminList",(function(){return Ie})),s.d(c,"DeleteCustomer",(function(){return Ee})),s.d(c,"GetCustomerDetail",(function(){return Le})),s.d(c,"GetCustomerExcel",(function(){return Ge})),s.d(c,"ChangeCustomerStatus",(function(){return Te})),s.d(c,"SetCustomerGroup",(function(){return Be})),s.d(c,"UpdateCustomerGroup",(function(){return ze})),s.d(c,"DeleteCustomerGroup",(function(){return Ue})),s.d(c,"GetCustomerGroups",(function(){return qe})),s.d(c,"GetCustomerGroupsAdminList",(function(){return He})),s.d(c,"GetCustomerGroupDetail",(function(){return Ve})),s.d(c,"GetDefaultGroup",(function(){return Ke})),s.d(c,"AddAddress",(function(){return We})),s.d(c,"UpdateAddress",(function(){return Ye})),s.d(c,"GetAddresses",(function(){return Qe})),s.d(c,"DeleteAddress",(function(){return Xe})),s.d(c,"GetCountryList",(function(){return Je})),s.d(c,"GetCountryWithCurrencyList",(function(){return Ze})),s.d(c,"GetStateList",(function(){return $e})),s.d(c,"GetCityList",(function(){return et})),s.d(c,"GetProductAttributeList",(function(){return tt})),s.d(c,"GetProductAttributeAdminList",(function(){return st})),s.d(c,"GetProductAttributeDetail",(function(){return at})),s.d(c,"AddProductAttribute",(function(){return ct})),s.d(c,"UpdateProductAttribute",(function(){return rt})),s.d(c,"DeleteProductAttribute",(function(){return lt})),s.d(c,"ChangeAttributeOptionOrder",(function(){return nt})),s.d(c,"GetAttributeOptions",(function(){return it})),s.d(c,"GetShapeAttributeOptions",(function(){return ot})),s.d(c,"GetProductAttributeSetList",(function(){return dt})),s.d(c,"GetProductAttributeSetAdminList",(function(){return mt})),s.d(c,"GetProductAttributeSetDetail",(function(){return ut})),s.d(c,"AddProductAttributeSet",(function(){return jt})),s.d(c,"UpdateProductAttributeSet",(function(){return bt})),s.d(c,"DeleteProductAttributeSet",(function(){return pt})),s.d(c,"FetchProductMedia",(function(){return ht})),s.d(c,"ValidateProductSku",(function(){return xt})),s.d(c,"SearchProducts",(function(){return Ot})),s.d(c,"GetProductsList",(function(){return gt})),s.d(c,"GetProductsAdminList",(function(){return vt})),s.d(c,"GetAdminProductDetail",(function(){return Nt})),s.d(c,"SetProducts",(function(){return ft})),s.d(c,"UpdateProducts",(function(){return _t})),s.d(c,"DeleteProducts",(function(){return yt})),s.d(c,"ImportProducts",(function(){return wt})),s.d(c,"CheckProductImages",(function(){return kt})),s.d(c,"GetProductDetailBySku",(function(){return St})),s.d(c,"GetAttributesBySetList",(function(){return Ct})),s.d(c,"GetBannerList",(function(){return At})),s.d(c,"SetBanner",(function(){return Pt})),s.d(c,"DeleteBanner",(function(){return Dt})),s.d(c,"GetBanner",(function(){return Mt})),s.d(c,"GetBannerDetails",(function(){return Rt})),s.d(c,"GetBestSellerProductsDetails",(function(){return Ft})),s.d(c,"SyncProductMedia",(function(){return It})),s.d(c,"SyncProduct",(function(){return Et})),s.d(c,"UpdateProductPriceWithExcel",(function(){return Lt})),s.d(c,"GetOrderLists",(function(){return Gt})),s.d(c,"GetOrderExcel",(function(){return Tt})),s.d(c,"GetOrderAdminLists",(function(){return Bt})),s.d(c,"GetOrderDetail",(function(){return zt})),s.d(c,"GetOrderStatusList",(function(){return Ut})),s.d(c,"GetAdminSalesOrders",(function(){return qt})),s.d(c,"UpdateOrderStatus",(function(){return Ht})),s.d(c,"GetInquiryAdminLists",(function(){return Vt})),s.d(c,"GetInquiryDetails",(function(){return Kt})),s.d(c,"GetDiamondsList",(function(){return Wt})),s.d(c,"GetDiamondDefaultFilters",(function(){return Yt})),s.d(c,"getcachekeys",(function(){return Qt})),s.d(c,"removecachebykeys",(function(){return Xt})),s.d(c,"ResetCache",(function(){return Jt})),s.d(c,"removeAllCache",(function(){return Zt})),s.d(c,"generatecachekey",(function(){return $t})),s.d(c,"GetCouponList",(function(){return es})),s.d(c,"GetCouponExcel",(function(){return ts})),s.d(c,"GetCouponAdminList",(function(){return ss})),s.d(c,"GetCouponDetail",(function(){return as})),s.d(c,"AddCoupon",(function(){return cs})),s.d(c,"UpdateCoupon",(function(){return rs})),s.d(c,"DeleteCoupon",(function(){return ls})),s.d(c,"AddCatalogPriceRule",(function(){return ns})),s.d(c,"UpdateCatalogPriceRule",(function(){return is})),s.d(c,"DeleteCatalogPriceRule",(function(){return os})),s.d(c,"GetCatalogPriceRuleList",(function(){return ds})),s.d(c,"GetCatalogPriceRuleExcel",(function(){return ms})),s.d(c,"GetCatalogPriceRuleDetail",(function(){return us})),s.d(c,"GetNewsletterExcel",(function(){return js})),s.d(c,"GetSubscribersExcel",(function(){return bs})),s.d(c,"GetNewsletterList",(function(){return ps})),s.d(c,"GetSubscribersList",(function(){return hs})),s.d(c,"DeleteSubscriber",(function(){return xs})),s.d(c,"PostNewsletter",(function(){return Os})),s.d(c,"CancelNewsletter",(function(){return gs})),s.d(c,"GetContactFormList",(function(){return vs})),s.d(c,"GetContactFormListExcel",(function(){return Ns})),s.d(c,"GetContactFormAdminList",(function(){return fs})),s.d(c,"SendContactResponse",(function(){return _s})),s.d(c,"GetReviewsList",(function(){return ys})),s.d(c,"GetReview",(function(){return ws})),s.d(c,"UpdateReview",(function(){return ks})),s.d(c,"GetShortLivedToken",(function(){return Ss})),s.d(c,"GetLongLivedToken",(function(){return Cs})),s.d(c,"UpdateInstagramToken",(function(){return As})),s.d(c,"GetInstagramToken",(function(){return Ps})),s.d(c,"GetInstagramOptions",(function(){return Ds})),s.d(c,"InstagramAuth",(function(){return Ms})),s.d(c,"GetSettingOptions",(function(){return Rs})),s.d(c,"GetSettingAdminOptions",(function(){return Fs})),s.d(c,"UpdateSettingOption",(function(){return Is})),s.d(c,"GetSettingOptionDetail",(function(){return Es})),s.d(c,"AddSettingOption",(function(){return Ls})),s.d(c,"DeleteSettingOption",(function(){return Gs})),s.d(c,"DashboardCounts",(function(){return Ts})),s.d(c,"BestSellerProduct",(function(){return Bs})),s.d(c,"lastorderProducts",(function(){return zs})),s.d(c,"getHomeContent",(function(){return Us})),s.d(c,"GetMostViewProducts",(function(){return qs})),s.d(c,"GetService",(function(){return Hs})),s.d(c,"GetServiceAdminList",(function(){return Vs})),s.d(c,"AddService",(function(){return Ks})),s.d(c,"DeleteService",(function(){return Ws})),s.d(c,"GetAppointmentQRStatisticsList",(function(){return Ys})),s.d(c,"GetAppointment",(function(){return Qs})),s.d(c,"setAppointment",(function(){return Xs})),s.d(c,"DeleteAppointment",(function(){return Js})),s.d(c,"Getservices",(function(){return Zs})),s.d(c,"GetAppointmentReport",(function(){return $s})),s.d(c,"ReviewAppointment",(function(){return ea})),s.d(c,"GetVendorDiamondCount",(function(){return ta})),s.d(c,"GetNivodaDiamondFeeds",(function(){return sa})),s.d(c,"SetSoldDiamond",(function(){return aa})),s.d(c,"SetSoldDiamondBySKU",(function(){return ca})),s.d(c,"GetServiceLogs",(function(){return ra})),s.d(c,"StartService",(function(){return la})),s.d(c,"StopService",(function(){return na})),s.d(c,"GetImportCounts",(function(){return ia})),s.d(c,"SetBlogCategory",(function(){return oa})),s.d(c,"GetBlogCategory",(function(){return da})),s.d(c,"GetBlogCategoryById",(function(){return ma})),s.d(c,"DeleteBlogCategory",(function(){return ua})),s.d(c,"SetBlog",(function(){return ja})),s.d(c,"GetBlogs",(function(){return ba})),s.d(c,"GetBlogById",(function(){return pa})),s.d(c,"DeleteBlog",(function(){return ha})),s.d(c,"GetLinkStatistics",(function(){return xa})),s.d(c,"GetSearchTerms",(function(){return Oa})),s.d(c,"GetSearchTermsExcel",(function(){return ga})),s.d(c,"GetLastSearchTerms",(function(){return va})),s.d(c,"GetAnalysisData",(function(){return Na})),s.d(c,"GetRoles",(function(){return fa})),s.d(c,"DeleteRole",(function(){return _a})),s.d(c,"GetRoleByID",(function(){return ya})),s.d(c,"SetRole",(function(){return wa})),s.d(c,"GetUser",(function(){return ka})),s.d(c,"GetUserExcel",(function(){return Sa})),s.d(c,"SetUser",(function(){return Ca})),s.d(c,"GetUsers",(function(){return Aa})),s.d(c,"DeleteUser",(function(){return Pa})),s.d(c,"GetAppointmentUsers",(function(){return Da})),s.d(c,"GetPermissionByRole",(function(){return Ma})),s.d(c,"GetPermission",(function(){return Ra})),s.d(c,"DeletePermission",(function(){return Fa})),s.d(c,"GetPermissionByID",(function(){return Ia})),s.d(c,"SetPermission",(function(){return Ea})),s.d(c,"GetVirtualRingRequestList",(function(){return La})),s.d(c,"UpdateProductPrice",(function(){return Ga})),s.d(c,"GetSectionList",(function(){return Ta})),s.d(c,"SetSection",(function(){return Ba})),s.d(c,"GetTemplatesList",(function(){return za})),s.d(c,"GetSectionById",(function(){return Ua})),s.d(c,"GetSectionItemById",(function(){return qa})),s.d(c,"DeleteSection",(function(){return Ha})),s.d(c,"SetSectionItem",(function(){return Va})),s.d(c,"DeleteSectionItem",(function(){return Ka})),s.d(c,"ClearSectionItems",(function(){return Wa})),s.d(c,"GenerateAccessToken",(function(){return Ya})),s.d(c,"GetShippingRate",(function(){return Qa})),s.d(c,"GetShippingRateByID",(function(){return Xa})),s.d(c,"SetShippingRate",(function(){return Ja})),s.d(c,"DeleteShippingRate",(function(){return Za}));var r={};s.r(r),s.d(r,"Dashboard",(function(){return ac})),s.d(r,"DiamondShape",(function(){return cc})),s.d(r,"AddDiamondShape",(function(){return rc})),s.d(r,"EditDiamondShape",(function(){return lc})),s.d(r,"DiamondQuality",(function(){return nc})),s.d(r,"AddDiamondQuality",(function(){return ic})),s.d(r,"EditDiamondQuality",(function(){return oc})),s.d(r,"DiamondMarkup",(function(){return dc})),s.d(r,"AddDiamondMarkup",(function(){return mc})),s.d(r,"EditDiamondMarkup",(function(){return uc})),s.d(r,"Metal",(function(){return jc})),s.d(r,"AddMetal",(function(){return bc})),s.d(r,"EditMetal",(function(){return pc})),s.d(r,"MetalQuality",(function(){return hc})),s.d(r,"AddMetalQuality",(function(){return xc})),s.d(r,"EditMetalQuality",(function(){return Oc})),s.d(r,"Products",(function(){return gc})),s.d(r,"AddProducts",(function(){return vc})),s.d(r,"ImportExcel",(function(){return Nc})),s.d(r,"UpdatePrice",(function(){return fc})),s.d(r,"EditProducts",(function(){return _c})),s.d(r,"GenerateCSV",(function(){return yc})),s.d(r,"DeleteSelected",(function(){return wc})),s.d(r,"DeleteAll",(function(){return kc})),s.d(r,"Coupons",(function(){return Sc})),s.d(r,"AddCoupons",(function(){return Cc})),s.d(r,"EditCoupons",(function(){return Ac})),s.d(r,"CatalogPriceRule",(function(){return Pc})),s.d(r,"AddCatalogPriceRule",(function(){return Dc})),s.d(r,"EditCatalogPriceRule",(function(){return Mc})),s.d(r,"RelatedProduct",(function(){return Rc})),s.d(r,"ProductConfigurations",(function(){return Fc})),s.d(r,"ConfigurableStep1",(function(){return Ic})),s.d(r,"AddVideo",(function(){return Ec})),s.d(r,"EditVideo",(function(){return Lc})),s.d(r,"ProductSize",(function(){return Gc})),s.d(r,"AddProductSize",(function(){return Tc})),s.d(r,"EditProductSize",(function(){return Bc})),s.d(r,"ShippingRate",(function(){return zc})),s.d(r,"AddShippingRate",(function(){return Uc})),s.d(r,"EditShippingRate",(function(){return qc})),s.d(r,"Category",(function(){return Hc})),s.d(r,"AddCategory",(function(){return Vc})),s.d(r,"EditCategory",(function(){return Kc})),s.d(r,"ContentManagement",(function(){return Wc})),s.d(r,"AddContentManagement",(function(){return Yc})),s.d(r,"EditContentManagement",(function(){return Qc})),s.d(r,"Pages",(function(){return Xc})),s.d(r,"NavigationMenu",(function(){return Jc})),s.d(r,"EditNavigationMenu",(function(){return Zc})),s.d(r,"AddCustomer",(function(){return $c})),s.d(r,"EditCustomer",(function(){return er})),s.d(r,"Customers",(function(){return tr})),s.d(r,"CustomerGroup",(function(){return sr})),s.d(r,"AddCustomerGroup",(function(){return ar})),s.d(r,"EditCustomerGroup",(function(){return cr})),s.d(r,"Addresses",(function(){return rr})),s.d(r,"AddCustomerAddress",(function(){return lr})),s.d(r,"EditCustomerAddress",(function(){return nr})),s.d(r,"ProductAttribute",(function(){return ir})),s.d(r,"AddProductAttribute",(function(){return or})),s.d(r,"EditProductAttribute",(function(){return dr})),s.d(r,"ProductAttributeSet",(function(){return mr})),s.d(r,"AddProductAttributeSet",(function(){return ur})),s.d(r,"EditProductAttributeSet",(function(){return jr})),s.d(r,"AddAttributeGroup",(function(){return br})),s.d(r,"EditAttributeGroup",(function(){return pr})),s.d(r,"Banner",(function(){return hr})),s.d(r,"AddBanner",(function(){return xr})),s.d(r,"EditBanner",(function(){return Or})),s.d(r,"Diamond",(function(){return gr})),s.d(r,"Gemstone",(function(){return vr})),s.d(r,"PullDiamond",(function(){return Nr})),s.d(r,"SoldDiamond",(function(){return fr})),s.d(r,"Order",(function(){return _r})),s.d(r,"OrderInquiry",(function(){return yr})),s.d(r,"OrdersDetails",(function(){return wr})),s.d(r,"InquiryDetails",(function(){return kr})),s.d(r,"CacheManagement",(function(){return Sr})),s.d(r,"Newsletter",(function(){return Cr})),s.d(r,"AddNewsletter",(function(){return Ar})),s.d(r,"Subscriber",(function(){return Pr})),s.d(r,"ContactForm",(function(){return Dr})),s.d(r,"SendResponse",(function(){return Mr})),s.d(r,"Reviews",(function(){return Rr})),s.d(r,"EditReview",(function(){return Fr})),s.d(r,"InstagramToken",(function(){return Ir})),s.d(r,"GenerateInstagramToken",(function(){return Er})),s.d(r,"Settings",(function(){return Lr})),s.d(r,"SystemService",(function(){return Gr})),s.d(r,"ServiceLogs",(function(){return Tr})),s.d(r,"AddSettingOption",(function(){return Br})),s.d(r,"EditSettingOption",(function(){return zr})),s.d(r,"AddService",(function(){return Ur})),s.d(r,"EditService",(function(){return qr})),s.d(r,"Service",(function(){return Hr})),s.d(r,"AppointmentTitle",(function(){return Vr})),s.d(r,"EditAppointment",(function(){return Kr})),s.d(r,"AppointmentReport",(function(){return Wr})),s.d(r,"BlogCategory",(function(){return Yr})),s.d(r,"AddBlogCategory",(function(){return Qr})),s.d(r,"EditBlogCategory",(function(){return Xr})),s.d(r,"Blogs",(function(){return Jr})),s.d(r,"AddBlog",(function(){return Zr})),s.d(r,"EditBlog",(function(){return $r})),s.d(r,"LinkStatistics",(function(){return el})),s.d(r,"SearchTerms",(function(){return tl})),s.d(r,"AppointmentQRStatistics",(function(){return sl})),s.d(r,"Roles",(function(){return al})),s.d(r,"AddRole",(function(){return cl})),s.d(r,"EditRole",(function(){return rl})),s.d(r,"Users",(function(){return ll})),s.d(r,"AddUser",(function(){return nl})),s.d(r,"EditUser",(function(){return il})),s.d(r,"Permissions",(function(){return ol})),s.d(r,"AddPermission",(function(){return dl})),s.d(r,"EditPermission",(function(){return ml})),s.d(r,"VirtualRingBuilder",(function(){return ul})),s.d(r,"WidgetsSection",(function(){return jl})),s.d(r,"WidgetsPages",(function(){return bl})),s.d(r,"AddSection",(function(){return pl})),s.d(r,"EditSection",(function(){return hl})),s.d(r,"AddSectionOption",(function(){return xl})),s.d(r,"EditSectionOption",(function(){return Ol}));var l={};s.r(l),s.d(l,"Error",(function(){return vl})),s.d(l,"Required",(function(){return Nl})),s.d(l,"RecordUpdated",(function(){return fl})),s.d(l,"RecordAdded",(function(){return _l})),s.d(l,"RecordDeleted",(function(){return yl})),s.d(l,"SubscriberDeactivated",(function(){return wl})),s.d(l,"ResponseSend",(function(){return kl})),s.d(l,"DiamondImported",(function(){return Sl})),s.d(l,"DiamondSold",(function(){return Cl})),s.d(l,"SelectAtlestOneItem",(function(){return Al})),s.d(l,"Confirm",(function(){return Pl})),s.d(l,"ConfirmDelete",(function(){return Dl})),s.d(l,"ConfirmEnable",(function(){return Ml})),s.d(l,"ConfirmDisable",(function(){return Rl})),s.d(l,"ConfirmDeactivate",(function(){return Fl})),s.d(l,"MessageDelete",(function(){return Il})),s.d(l,"MessageDeactivate",(function(){return El})),s.d(l,"MenuUpdated",(function(){return Ll})),s.d(l,"MenuAdded",(function(){return Gl})),s.d(l,"SitemapGenerated",(function(){return Tl})),s.d(l,"oops",(function(){return Bl})),s.d(l,"RescheduleLink",(function(){return zl})),s.d(l,"AppointmentConfirmed",(function(){return Ul})),s.d(l,"AppointmentRejected",(function(){return ql})),s.d(l,"validimage",(function(){return Hl})),s.d(l,"formatnotsupport",(function(){return Vl})),s.d(l,"blankfile",(function(){return Kl})),s.d(l,"invalidfile",(function(){return Wl})),s.d(l,"pricelength",(function(){return Yl})),s.d(l,"pricehighest",(function(){return Ql})),s.d(l,"selectgroup",(function(){return Xl})),s.d(l,"atleastonegroup",(function(){return Jl})),s.d(l,"defaultgroupnotdelete",(function(){return Zl})),s.d(l,"Confirmtitle",(function(){return $l})),s.d(l,"ConfirmClear",(function(){return en})),s.d(l,"soldDiamondtitle",(function(){return tn})),s.d(l,"soldDiamondClear",(function(){return sn})),s.d(l,"CacheClear",(function(){return an})),s.d(l,"ResetCache",(function(){return cn})),s.d(l,"GenerateCache",(function(){return rn})),s.d(l,"ConfirmCancelNewsletter",(function(){return ln})),s.d(l,"MessageCancelNewsletter",(function(){return nn})),s.d(l,"NewsletterCancelled",(function(){return on})),s.d(l,"ProductImageVerified",(function(){return dn})),s.d(l,"SkuAlreadyExists",(function(){return mn})),s.d(l,"samedate",(function(){return un})),s.d(l,"smalldate",(function(){return jn})),s.d(l,"updateprice",(function(){return bn})),s.d(l,"sectionadd",(function(){return pn})),s.d(l,"sectionupdate",(function(){return hn})),s.d(l,"sectiondeleted",(function(){return xn})),s.d(l,"sectionoptionadd",(function(){return On})),s.d(l,"sectionoptionupdate",(function(){return gn})),s.d(l,"Reviewupdated",(function(){return vn})),s.d(l,"MinimumSpendError",(function(){return Nn})),s.d(l,"InvalidFileType",(function(){return fn})),s.d(l,"RequiredSku",(function(){return _n})),s.d(l,"RequiredParentSku",(function(){return yn})),s.d(l,"RequiredProductTitle",(function(){return wn})),s.d(l,"RequiredCategory",(function(){return kn})),s.d(l,"RequiredWeight",(function(){return Sn})),s.d(l,"RequiredAttributeSet",(function(){return Cn})),s.d(l,"ProductAttributeSetDeleteError",(function(){return An})),s.d(l,"ProductAttributeDeleteError",(function(){return Pn})),s.d(l,"ProductSizeDeleteError",(function(){return Dn})),s.d(l,"ProductAttributeOptionDeleteError",(function(){return Mn})),s.d(l,"RequiredPrice",(function(){return Rn})),s.d(l,"InvalidPrice",(function(){return Fn})),s.d(l,"RequiredOption1Value",(function(){return In})),s.d(l,"RequiredOption2Value",(function(){return En})),s.d(l,"RequiredOption3Value",(function(){return Ln})),s.d(l,"RequiredCanBeSetCarat",(function(){return Gn})),s.d(l,"RequiredCanBeSetShape",(function(){return Tn})),s.d(l,"SwalSectionDeleteProp",(function(){return Bn})),s.d(l,"SwalDeleteProp",(function(){return zn})),s.d(l,"SwalDeactivateProp",(function(){return Un})),s.d(l,"Swalcancelnewsletter",(function(){return qn})),s.d(l,"CahcheclearProp",(function(){return Hn})),s.d(l,"diamondSoldProp",(function(){return Vn})),s.d(l,"diamondReverSoldProp",(function(){return Kn}));var n={};s.r(n),s.d(n,"Appointment",(function(){return Wn})),s.d(n,"EditAppointment",(function(){return Yn})),s.d(n,"AppointmentReport",(function(){return Qn}));var i={};s.r(i),s.d(i,"GetPaymentMethod",(function(){return di})),s.d(i,"GetJSON",(function(){return mi})),s.d(i,"sortObjectByKey",(function(){return ui})),s.d(i,"validatePermission",(function(){return ji})),s.d(i,"capitalizeString",(function(){return bi})),s.d(i,"groupBy",(function(){return pi})),s.d(i,"setImage",(function(){return hi})),s.d(i,"generateCombinations",(function(){return xi})),s.d(i,"generateCombination",(function(){return Oi})),s.d(i,"groupByProperty",(function(){return gi})),s.d(i,"generateRandomString",(function(){return vi})),s.d(i,"isGroupByPropertyExist",(function(){return Ni}));var o={};s.r(o),s.d(o,"Master",(function(){return Mi})),s.d(o,"rolepermission",(function(){return Ri})),s.d(o,"blogs",(function(){return Fi})),s.d(o,"OrderList",(function(){return Ii})),s.d(o,"TestPermission",(function(){return Ei})),s.d(o,"Products",(function(){return Li})),s.d(o,"Sales",(function(){return Gi})),s.d(o,"Earrings",(function(){return Ti})),s.d(o,"Diamonds",(function(){return Bi})),s.d(o,"Categories",(function(){return zi})),s.d(o,"Customers",(function(){return Ui})),s.d(o,"ContentManagement",(function(){return qi})),s.d(o,"CacheManagement",(function(){return Hi})),s.d(o,"Widgets",(function(){return Vi})),s.d(o,"Attribute",(function(){return Ki})),s.d(o,"Report",(function(){return Wi})),s.d(o,"Newsletter",(function(){return Yi})),s.d(o,"ContactForm",(function(){return Qi})),s.d(o,"Coupons",(function(){return Xi})),s.d(o,"Marketing",(function(){return Ji})),s.d(o,"System",(function(){return Zi})),s.d(o,"Section",(function(){return $i}));var d=s(1),m=s.n(d),u=s(17),j=s.n(u),b=(s(624),s(6)),p=s(40),h=s(380),x=(s(625),s(626),s(627),s(593)),O=s.n(x),g=s(0);var v=()=>Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("div",{className:"spinner-loader",children:Object(g.jsx)("div",{className:"loader"})})}),N=s(175),f=s.n(N);const _=s(759),y="https://api.harmonyjewels.co.uk:3030/api/",w=()=>{const e=JSON.parse(localStorage.getItem("appState"));return e?e.session_token:""},k=e=>({req:_.AES.encrypt(JSON.stringify(e),"Please#dont@share&me").toString()}),S={"Content-Type":"application/json"},C=(e,t)=>(S.Authorization="Bearer "+w(),f.a.post(y+e,k(t),{headers:S,maxBodyLength:1/0,maxContentLength:1/0}).catch((e=>{void 0!==e.response.data.message?gl.b.warning(e.response.data.message):gl.b.warning("Something went wrong.")}))),A=e=>(S.Authorization="Bearer "+w(),f.a.get(y+e,{headers:S}).catch((e=>{console.log(e.response),gl.b.warning("Something went wrong.")}))),P="https://hj-website-media.s3.eu-west-2.amazonaws.com/",D="user/validateuser",M="user/validateToken",R="metal/GetMetal",F="metal/GetMetalAdminList",I="metal/UpdateMetal",E="metal/GetMetalQuality",L="metal/GetMetalQualityAdminList",G="metal/SetMetalQuality",T="metal/DeleteMetalQuality",B="stoneShape/GetStoneShape",z="stoneShape/GetStoneShapeAdminList",U="stoneShape/SetStoneShape",q="stoneShape/DeleteStoneShape",H="diamondMarkup/GetDiamondMarkup",V="diamondMarkup/GetDiamondMarkupAdmin",K="diamondMarkup/SetDiamondMarkup",W="diamondMarkup/DeleteDiamondMarkup",Y="diamondMarkup/GetShapeCategory",Q="stoneQuality/GetStoneQuality",X="stoneQuality/GetStoneQualityAdminList",J="stoneQuality/SetStoneQuality",Z="stoneQuality/DeleteStoneQuality",$="product_size/GetProductSize",ee="product_size/GetProductSizeAdminList",te="product_size/GetProductSizeCategoryList",se="product_size/GetProductSizeExcel",ae="product_size/SetProductSize",ce="product_size/DeleteProductSize",re="category/SearchCategory",le="category/getParentCategory",ne="category/getCategory",ie="category/GetCategoryAdminList",oe="category/getSubCategories",de="category/SetCategory",me="category/UpdateCategory",ue="category/GetCategoryDetail",je="category/DeleteCategory",be="category/ChangeCategoryAttributeOrder",pe="category/BestsellerCategory",he="content-management/GetCmsList",xe="content-management/GetPageDetail",Oe="content-management/GetPage",ge="content-management/AddPage",ve="content-management/UpdatePage",Ne="content-management/DeletePage",fe="content/UploadImages",_e="navigation-menu/GetMenu",ye="navigation-menu/GetAdminNavigationMenuList",we="navigation-menu/AddMenu",ke="navigation-menu/DeleteMenu",Se="navigation-menu/GetMenuDetail",Ce="navigation-menu/UpdateMenu",Ae="navigation-menu/UpdateMenuOrder",Pe="navigation-menu/GenerateSitemap",De="customers/AddCustomer",Me="customers/UpdateCustomer",Re="customers/GetCustomers",Fe="customers/SearchCustomers",Ie="customers/GetCustomersAdminList",Ee="customers/DeleteCustomer",Le="customers/GetCustomerDetail",Ge="customers/GetCustomerExcel",Te="customers/ChangeCustomerStatus",Be="customer-group/SetGroup",ze="customer-group/UpdateGroup",Ue="customer-group/DeleteGroup",qe="customer-group/GetGroups",He="customer-group/GetGroupsAdminList",Ve="customer-group/GetGroupDetail",Ke="customer-group/GetDefaultGroup",We="customer-address/AddAddress",Ye="customer-address/UpdateAddress",Qe="customer-address/GetAddresses",Xe="customer-address/DeleteAddress",Je="country/getCountryList",Ze="country/GetCountryWithCurrency",$e="state/getStateList",et="city/getCityList",tt="attribute/getProductAttributeList",st="attribute/getProductAttributeAdminList",at="attribute/GetProductAttributeDetail",ct="attribute/AddProductAttribute",rt="attribute/UpdateProductAttribute",lt="attribute/DeleteProductAttribute",nt="attribute/SetAttributeOptionOrder",it="attribute/GetAttributeOptions",ot="attribute/GetShapeAttributeOptions",dt="product_attribute_set/get_attribute_set",mt="product_attribute_set/get_attribute_set_admin",ut="product_attribute_set/attribute_set_detail",jt="product_attribute_set/add_attribute_set",bt="product_attribute_set/update_attribute_set",pt="product_attribute_set/remove_attribute_set",ht="product/FetchProductMedia",xt="product/ValidateProductSku",Ot="product/SearchProducts",gt="product/GetProducts",vt="product/GetProductsAdminList",Nt="product/GetAdminProductDetail",ft="product/SetProducts",_t="product/UpdateProducts",yt="product/DeleteProducts",wt="product/ImportProducts",kt="product/CheckProductImages",St="product/GetProductDetailBySku",Ct="product/GetAttributesBySetList",At="banner/GetBannerAdminList",Pt="banner/setbanner",Dt="banner/deletebanner",Mt="banner/getBanner",Rt="banner/getBannerDetails",Ft="product/GetBestsellerItems",It="product/SyncProductMedia",Et="product/SyncProduct",Lt="product/UpdateProductPriceWithExcel",Gt="order/getOrders",Tt="order/getOrdersExcel",Bt="order/getAdminOrders",zt="order/getOrdersDetails",Ut="order/getOrderStatusList",qt="order/getAdminSalesOrders",Ht="order/updateOrderStatus",Vt="order/GetInquiryAdminLists",Kt="order/GetInquiryDetails",Wt="product/GetDiamonds",Yt="diamond/GetDiamondFilters",Qt="cache/getcachekeys",Xt="cache/remove_cacheby_keys",Jt="cache/resetcache",Zt="cache/removeAllCache",$t="cache/generatecachekey",es="coupons/GetCouponList",ts="coupons/GetCouponExcel",ss="coupons/GetCouponAdminList",as="coupons/GetCouponDetail",cs="coupons/AddCoupon",rs="coupons/UpdateCoupon",ls="coupons/DeleteCoupon",ns="catalog-price-rule/AddCatalogPriceRule",is="catalog-price-rule/UpdateCatalogPriceRule",os="catalog-price-rule/DeleteCatalogPriceRule",ds="catalog-price-rule/GetCatalogPriceRuleList",ms="catalog-price-rule/GetCatalogPriceRuleExcel",us="catalog-price-rule/GetCatalogPriceRuleDetail",js="newsletter/GetNewsletterExcel",bs="newsletter/GetSubscribersExcel",ps="newsletter/GetNewsletterList",hs="newsletter/GetSubscriberList",xs="newsletter/DeactivateSubscriber",Os="newsletter/PostNewsletter",gs="newsletter/CancelNewsletter",vs="contact-form/GetContactFormList",Ns="contact-form/GetContactFormListExcel",fs="contact-form/GetContactFormAdminList",_s="contact-form/SendContactResponse",ys="product/GetReviews",ws="product/GetReview",ks="product/UpdateReview",Ss="https://api.instagram.com/oauth/access_token",Cs="https://graph.instagram.com/access_token",As="setting/StoreInstagramToken",Ps="setting/GetInstagramToken",Ds="setting/GetInstagramOptions",Ms="https://api.instagram.com/oauth/authorize",Rs="setting/GetSettingOptions",Fs="setting/GetSettingAdminOptions",Is="setting/UpdateSettingOption",Es="setting/GetSettingOptionDetail",Ls="setting/AddSettingOption",Gs="setting/DeleteSettingOption",Ts="dashboard/getAdmindashboard",Bs="dashboard/BestSellerProduct",zs="dashboard/lastorderProducts",Us="home/getContent",qs="dashboard/MostViewedProducts",Hs="services/get_service",Vs="services/get_service_admin_list",Ks="services/set_service",Ws="services/delete_service",Ys="services/GetAppointmentQRStatisticsList",Qs="services/get_appointment",Xs="services/set_appointment",Js="services/set_appointment",Zs="services/get_service",$s="services/get_appointment_report",ea="services/review_appointment",ta="diamond/VendorDiamondCount",sa="diamond/GetNivodaDiamondFeeds",aa="diamond/SetSoldDiamond",ca="diamond/SetSoldDiamondBySKU",ra="services/service_logs",la="services/start_service",na="services/stop_service",ia="services/import_counts",oa="blog/SetBlogCategory",da="blog/getBlogCategory",ma="blog/GetBlogCategoryById",ua="blog/DeleteBlogCategory",ja="blog/SetBlog",ba="blog/GetBlogList",pa="blog/GetBlogById",ha="blog/DeleteBlog",xa="report/GetLinkStatistics",Oa="product/GetSearchKeyword",ga="product/GetSearchKeywordExcel",va="product/GetLastSearchKeyword",Na="report/getdataanalysis",fa="role_permission/getRoleList",_a="role_permission/deleteRole",ya="role_permission/getRolebyID",wa="role_permission/setrole",ka="user/getUser",Sa="user/getUserExcel",Ca="user/SetUser",Aa="user/GetUsers",Pa="user/DeleteUser",Da="user/GetAppointmentUsers",Ma="role_permission/getPermissionByRole",Ra="role_permission/getPermissionList",Fa="role_permission/deletePermission",Ia="role_permission/getPermissionbyID",Ea="role_permission/setPermission",La="virtual-ring-builder/GetVirtualRingRequestList",Ga="product/UpdateProductPrice",Ta="section/GetSectionAdminList",Ba="section/SetSection",za="section/GetTemplatesList",Ua="section/GetSectionById",qa="section/GetSectionItemById",Ha="section/DeleteSection",Va="section/SetSectionItem",Ka="section/DeleteSectionItem",Wa="section/ClearSectionItems",Ya="product/GenerateAccessToken",Qa="shipping_method/GetShippingRate",Xa="shipping_method/GetShippingRateByID",Ja="shipping_method/SetShippingRate",Za="shipping_method/DeleteShippingRate";var $a=s(512),ec=s.n($a),tc=s(513),sc=s.n(tc);const ac="Dashboard",cc="Diamond Shape",rc="Add Diamond Shape",lc="Edit Diamond Shape",nc="Diamond Quality",ic="Add Diamond Quality",oc="Edit Diamond Quality",dc="Diamond Markup",mc="Add Diamond Markup",uc="Edit Diamond Markup",jc="Metal Type",bc="Add Metal Type",pc="Edit Metal Type",hc="Metal Quality",xc="Add Metal Quality",Oc="Edit Metal Quality",gc="Products",vc="Add Product",Nc="Import Excel",fc="Update Price",_c="Edit Product",yc="Generate CSV",wc="Delete Selected Items",kc="Delete All",Sc="Coupons",Cc="Add Coupon",Ac="Edit Coupon",Pc="Catalog Price Rule",Dc="Add Catalog Price Rule",Mc="Edit Catalog Price Rule",Rc="Related Products",Fc="Create Product Configurations",Ic="Bulk Images, Price and Quantity",Ec="Add Video",Lc="Edit Video",Gc="Product Size",Tc="Add Product Size",Bc="Edit Product Size",zc="Shipping Rate",Uc="Add Shipping Rate",qc="Edit Shipping Rate",Hc="Category",Vc="Add Category",Kc="Edit Category",Wc="Content Management",Yc="Add Content Management",Qc="Edit Content Management",Xc="Pages",Jc="Navigation Menu",Zc="Edit Navigation Menu",$c="Add Customer",er="Edit Customer",tr="Customers",sr="Customer Group",ar="Add Customer Group",cr="Edit Customer Group",rr="Addresses",lr="Add New Address",nr="Edit Address",ir="Single Attribute",or="Add Single Attribute",dr="Edit Single Attribute",mr="Product Attribute Set",ur="Add Product Attribute Set",jr="Edit Product Attribute Set",br="Add Group",pr="Edit Group",hr="Banner",xr="Add Banner",Or="Edit Banner",gr="Diamond",vr="Gemstone",Nr="Pull Diamond",fr="Sold Diamond",_r="Order",yr="Order Inquiry",wr="Order Detail",kr="Inquiry Details",Sr="Cache Management",Cr="Newsletters",Ar="Add Newsletter",Pr="Subscribers",Dr="Contact Form",Mr="Send Response",Rr="Reviews",Fr="Edit Review",Ir="Instagram Token",Er="Generate Instagram Token",Lr="Settings",Gr="Nivoda Diamond Service Logs",Tr="Service Logs",Br="Add Setting Option",zr="Edit Setting Option",Ur="Add Service",qr="Edit Service",Hr="Services",Vr="Appointment",Kr="Edit Appointment",Wr="Appointment Report",Yr="Blog Category",Qr="Add Blog Category",Xr="Edit Blog Category",Jr="Blogs",Zr="Add Blog",$r="Edit Blog",el="Link Statistics",tl="Search Terms",sl="Appointment QR Statistics",al="Roles",cl="Add Role",rl="Edit Role",ll="Users",nl="Add User",il="Edit User",ol="Permissions",dl="Add Permission",ml="Edit Permission",ul="Virtual Ring Builder Request",jl="Section",bl="Pages",pl="Add Section",hl="Edit Section",xl="Add Section Option",Ol="Edit Section Option";var gl=s(265);s(346);const vl="Something went wrong.",Nl="This is required field",fl="Record updated successfully",_l="Record added successfully",yl="Record deleted successfully",wl="Subscriber inactivated successfully",kl="Response Sent Successfully!",Sl="Diamond Imported Successfully!",Cl="Diamond Sold Successfully!",Al="Select atleast one item.",Pl="Confirm?",Dl="Delete record?",Ml="Are you sure you want to Active this record?",Rl="Are you sure you want to Inactive this record?",Fl="Inactive subscriber?",Il="Data will not be retrieved once deleted.",El="Newsletter will not be sent to this selected email.",Ll="Navigation menu updated successfully",Gl="Navigation menu added successfully",Tl="Sitemap generated successfully",Bl="Oops!",zl="Reschedule Link Sent.",Ul="Appointment confirmed successfully.",ql="Appointment rejected successfully.",Hl="(only .png, .jpg, .jpeg formats allowed)",Vl="The file format is not supported.",Kl="Product sheet should not be blank.",Wl="Invalid product sheet.",Yl="10",Ql="9999999999",Xl="You have to select one group to remove by click on group name.",Jl="Default group can not be deleted.",Zl="Default group can not be deleted.",$l="Clear Cache?",en="Clear Cache?",tn="Mark as Sold?",sn="Are you sure to do Mark as Sold?",an="Cache Clear successfully",cn="Reset Cache successfully",rn="Cache generated successfully",ln="Cancel Newsletter?",nn="Newsletter would not be sent on scheduled time.",on="Newsletter cancelled successfully",dn="Product images verified successfully",mn="SKU already exist",un=" Minimum difference between start date and end date should be 1hr.",jn="End Date must be greater than Start Date",bn="Product Price updated successfully",pn="Section added successfully",hn="Section updated successfully",xn="Section deleted successfully",On="Section Option added successfully",gn="Section Option updated successfully",vn="Review updated successfully",Nn="The minimum spend must be less than ",fn="Invalid file",_n="SKU is required",yn="Parent SKU is required",wn="Product title is required",kn="Category is required",Sn="Weight is required",Cn="Attribute set is required",An="Product associated with this attribute set. So can't delete it.",Pn="Product associated with this attribute. So can't delete it.",Dn="Product associated with this ProductSize. So can't delete it.",Mn="Product associated with this option. So can't delete it.",Rn="Price is required",Fn="Invalid price",In="Option-1 value is required",En="Option-2 value is required",Ln="Option-3 value is required",Gn="Can be set carat is required",Tn="Can be set shape is required",Bn={title:Dl,text:Il,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},zn={title:Dl,text:Il,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},Un={title:Fl,text:El,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},qn={title:ln,text:nn,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},Hn={title:$l,text:en,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},Vn={title:tn,text:sn,dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},Kn={title:"Revert Sold?",text:"Are you sure, want to revert as unsold ?",dangerMode:!0,buttons:{cancel:!0,danger:{text:"Ok"}}},Wn="/Appointments",Yn="/Appointments/edit/:id",Qn="/Appointments/report";var Xn=s(596);var Jn=e=>Object(g.jsx)(Xn.a,{value:e.value,displayType:"text",thousandSeparator:!0,prefix:"\xa3"});var Zn=e=>{if(null!==e.value&&""!==e.value&&void 0!==e.value){const t="DD/MM/YYYY, hh:mm A",s=String(e.value).replace(" ","T")+(String(e.value).endsWith("Z")?"":"Z"),a=new Date(s),c=e=>String(e).padStart(2,"0"),r={YYYY:a.getUTCFullYear(),MM:c(a.getUTCMonth()+1),DD:c(a.getUTCDate()),hh:c((a.getUTCHours()+11)%12+1),HH:c(a.getUTCHours()),mm:c(a.getUTCMinutes()),A:a.getUTCHours()>=12?"PM":"AM"};let l=t;return Object.keys(r).forEach((e=>{l=l.replace(e,r[e])})),l}return""},$n=s(544),ei=s.n($n),ti=s(571),si=s(545),ai=s.n(si),ci=s(552),ri=s.n(ci),li=s(1033),ni=s(1038),ii=(s(879),s(880),s(881),s(553),s(554)),oi=s.n(ii);s(561);const di=e=>"bank_transfer"===e?"Bank Transfer":"credit_card"===e?"Credit Card":"paypal"===e?"Paypal":"wallet"===e?"Wallet":e,mi=e=>void 0===e||""===e?null:"string"===typeof e?JSON.parse(e):e,ui=(e,t)=>e=e.sort(((e,s)=>e.attribute_code===t?-1:s.attribute_code===t?1:0)),ji=e=>{const t=JSON.parse(localStorage.getItem("PermissionList")),s=null===JSON.parse(localStorage.appState).permission?[]:JSON.parse(localStorage.appState).permission;return null!==s&&0!==s.length&&null!==t&&0!==t.length||(localStorage.removeItem("appState"),window.location.href="/login"),!!s.map((e=>e.name)).includes(t.filter((e=>"all-master"===e.key)).length>0?t.filter((e=>"all-master"===e.key))[0].name:null)||s.map((e=>e.name)).includes(t.filter((t=>t.key===e)).length>0?t.filter((t=>t.key===e))[0].name:null)},bi=e=>{const t=e.toLowerCase().split(" ");for(let s=0;s(e[s[t]]=e[s[t]]||[],e[s[t]].push(s),e)),{})}const hi=e=>"https://hj-website-media.s3.eu-west-2.amazonaws.com/"+e,xi=e=>{const t=[];Object.keys(e).map((s=>(t[s]=e[s].map((e=>e.id)),!0)));const s=Object.keys(t),a=[];return function e(c,r){if(c===s.length)return void a.push({...r});const l=s[c];for(const s of t[l])r[l]=s,e(c+1,r)}(0,{}),a},Oi=e=>{const t=Object.keys(e),s=[];return function a(c,r){if(c===t.length)return void s.push({...r});const l=t[c];for(const t of e[l])r[l]=t,a(c+1,r)}(0,{}),s},gi=(e,t)=>e.reduce(((e,s)=>{const a=s.attributes.find((e=>e.attribute_code===t));if(a){const t=a.option_id;e[t]||(e[t]=[]),e[t].push(s)}return e}),{}),vi=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let s="";for(let a=0;a{let s=0;return e.map((e=>(e.attributes.filter((e=>e.attribute_code===t)).length>0&&s++,!0))),s>0};var fi=s(562),_i=s.n(fi),yi=s(264),wi=s(1037),ki=s(1031),Si=s(12),Ci=s.n(Si),Ai=s(382),Pi=s(600),Di=s(564);const Mi="all-master",Ri="role_permission",Fi="blogs",Ii="order-list",Ei="test-permission",Li="products",Gi="sales",Ti="earrings",Bi="diamonds",zi="categories",Ui="customers",qi="content_management",Hi="cache_management",Vi="widgets",Ki="attribute",Wi="report",Yi="newsletter",Qi="contact_form",Xi="coupons",Ji="marketing",Zi="system",$i="section";s(565);var eo=s(127),to=s.n(eo),so=s(587);s(566),s(254),s(913);const ao=(e,t)=>{const s=new FileReader;s.readAsDataURL(e),s.onload=function(){t(s.result)},s.onerror=function(e){console.log("Error: ",e)}},co=(e,t)=>{const s={Sheets:{data:Ai.a.json_to_sheet(e)},SheetNames:["data"]},a=Ai.b(s,{bookType:"xlsx",type:"array"}),c=new Blob([a],{type:"application/vnd.ms-excel;charset=utf-8"});Object(Pi.saveAs)(c,t+".xlsx")},ro=e=>e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()));var lo=()=>{const[e,t]=Object(d.useState)([]),[s,r]=Object(d.useState)([]),[l,n]=Object(d.useState)([]),[i,o]=Object(d.useState)([]),[m,u]=Object(d.useState)([]),[j,b]=Object(d.useState)([]);Object(d.useEffect)((()=>{document.title=ac,v(),N(),p(),h(),O(),x()}),[]);const p=()=>{a.getApi(c.DashboardCounts,null).then((e=>{t(e.data.result[0][0])}))},h=()=>{a.getApi(c.BestSellerProduct,null).then((e=>{r(e.data.result)}))},x=()=>{a.getApi(c.GetMostViewProducts,null).then((e=>{b(e.data.result)}))},O=()=>{a.getApi(c.lastorderProducts,null).then((e=>{n(e.data.result)}))},v=()=>{a.postApi(c.GetSearchTerms,{page:1,search:"",page_size:5,sort_column:"",sort_direction:""}).then((e=>{if(!0===e.data.status&&""!==e.data.result){const t=e.data.result[1];o(t)}else o([])}))},N=()=>{a.postApi(c.GetLastSearchTerms).then((e=>{if(!0===e.data.status&&""!==e.data.result){const t=e.data.result[0];u(t)}else u([])}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-4 mx-0 mb-4 card flex-initial",children:[Object(g.jsx)("div",{className:"col my-3 border-right",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"card-body p-3",children:[Object(g.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[Object(g.jsxs)("div",{className:"card-title py-2 mb-0 font-weight-bold",children:[Object(g.jsx)("img",{width:"50px",className:"mr-2",src:P+"assets/images/Orders-icon.svg",alt:" "}),"Online Orders"]}),Object(g.jsx)("div",{className:"d-none text-muted font-20",children:Object(g.jsxs)("select",{className:"form-control select-custom outline-0",children:[Object(g.jsx)("option",{children:"Monthly"}),Object(g.jsx)("option",{children:"Yearly"})]})})]}),Object(g.jsx)("h2",{className:"font-weight-bold pl-5 ml-2 d-flex align-items-center",children:e.total_orders})]})})}),Object(g.jsx)("div",{className:"col my-3",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"card-body p-3",children:[Object(g.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[Object(g.jsxs)("div",{className:"card-title py-2 mb-0 font-weight-bold",children:[Object(g.jsx)("img",{width:"50px",className:"mr-2",src:P+"assets/images/Diamondicon.svg",alt:" "}),"Total Diamonds"]}),Object(g.jsx)("div",{className:"d-none text-muted font-20",children:Object(g.jsxs)("select",{className:"form-control select-custom outline-0",children:[Object(g.jsx)("option",{children:"This Monthly"}),Object(g.jsx)("option",{children:"Yearly"})]})})]}),Object(g.jsx)("div",{className:"total-diamond-part pl-5 ml-2",children:Object(g.jsxs)("h2",{className:" font-weight-bold d-flex align-items-end",children:[e.total_earth_mined_diamonds,Object(g.jsx)("span",{className:"text-gray font-13 py-0 ml-2 mb-1 font-weight-normal",children:"Natural Diamonds"})]})}),Object(g.jsx)("div",{className:"total-diamond-part pt-1 pl-5 ml-2",children:Object(g.jsxs)("h2",{className:" font-weight-bold d-flex align-items-end mb-0",children:[e.total_lab_grown_diamonds,Object(g.jsx)("span",{className:"text-gray font-13 py-0 ml-2 mb-1 font-weight-normal",children:"Lab Diamonds"})]})})]})})}),Object(g.jsx)("div",{className:"col my-3 border-left",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"card-body p-3",children:[Object(g.jsx)("div",{className:"d-flex align-items-center justify-content-between",children:Object(g.jsxs)("div",{className:"card-title py-2 mb-0 font-weight-bold",children:[Object(g.jsx)("img",{width:"50px",className:"mr-2",src:P+"assets/images/Purchase-icon.svg",alt:" "}),"Total Products"]})}),Object(g.jsx)("h2",{className:"font-weight-bold pl-5 ml-2 d-flex align-items-center",children:e.total_products})]})})}),Object(g.jsx)("div",{className:"col my-3 border-left",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"card-body p-3",children:[Object(g.jsx)("div",{className:"d-flex align-items-center justify-content-between",children:Object(g.jsxs)("div",{className:"card-title py-2 mb-0 font-weight-bold",children:[Object(g.jsx)("img",{width:"50px",className:"mr-2",src:P+"assets/images/Customers-icon.svg",alt:" "}),"Customers"]})}),Object(g.jsx)("h2",{className:"font-weight-bold pl-5 ml-2 d-flex align-items-center",children:e.total_customers})]})})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-12 col-xl-6",children:Object(g.jsxs)("div",{className:"card p-3 grid-margin",children:[Object(g.jsx)("div",{className:"d-flex border-bottom align-items-center justify-content-between",children:Object(g.jsx)("div",{className:"card-title py-2 mb-2 font-weight-bold card-border",children:"Best Sellers"})}),Object(g.jsx)("div",{className:"tab-content",id:"myTabContent",children:Object(g.jsx)("div",{className:"tab-pane fade show active",id:"bestseller",role:"tabpanel","aria-labelledby":"bestseller-tab",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{width:"15%",children:"Image"}),Object(g.jsx)("th",{children:"Name"}),Object(g.jsx)("th",{children:"SKU"}),Object(g.jsx)("th",{width:"15%",children:"Count"})]})}),Object(g.jsx)("tbody",{children:s.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("img",{src:e.base_image,className:"mr-2 product-img",alt:"image"})}),Object(g.jsx)("td",{className:"text-left",children:Object(g.jsx)("span",{children:e.name})}),Object(g.jsx)("td",{children:e.sku}),Object(g.jsx)("td",{children:e.Quantity})]},Math.random())))})]})})})})]})}),Object(g.jsx)("div",{className:"col-md-12 col-xl-6",children:Object(g.jsxs)("div",{className:"card p-3 grid-margin",children:[Object(g.jsx)("div",{className:"d-flex border-bottom align-items-center justify-content-between",children:Object(g.jsx)("div",{className:"card-title py-2 mb-2 font-weight-bold card-border",children:"Most Viewed Products"})}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{width:"15%",children:"Image"}),Object(g.jsx)("th",{children:"Name"}),Object(g.jsx)("th",{children:"SKU"}),Object(g.jsx)("th",{width:"15%",children:"Count"})]})}),Object(g.jsx)("tbody",{children:j.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("img",{src:e.base_image,className:"mr-2 product-img",alt:"image"})}),Object(g.jsx)("td",{className:"text-left",children:Object(g.jsx)("span",{children:ro(e.name)})}),Object(g.jsx)("td",{children:e.sku}),Object(g.jsx)("td",{children:e.clicks})]},Math.random())))})]})})]})})]}),Object(g.jsx)("div",{className:"row pb-3",children:Object(g.jsx)("div",{className:"col-xl-12",children:Object(g.jsxs)("div",{className:"card p-3 grid-margin",children:[Object(g.jsxs)("ul",{className:"nav nav-tabs mb-4",id:"myTab",role:"tablist",children:[Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link active",id:"lastorders-tab","data-toggle":"tab",href:"#lastorders",role:"tab","aria-controls":"lastorders","aria-selected":"true",children:"Last Orders"})}),Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link",id:"lastsearchterm-tab","data-toggle":"tab",href:"#lastsearchterm",role:"tab","aria-controls":"lastsearchterm","aria-selected":"false",children:"Last Search Terms"})}),Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link",id:"topsearchterm-tab","data-toggle":"tab",href:"#topsearchterm",role:"tab","aria-controls":"topsearchterm","aria-selected":"false",children:"Top Search Terms"})})]}),Object(g.jsxs)("div",{className:"tab-content",id:"myTabContent",children:[Object(g.jsx)("div",{className:"tab-pane fade show active",id:"lastorders",role:"tabpanel","aria-labelledby":"lastorders-tab",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{width:"15%",children:"Image"}),Object(g.jsx)("th",{children:"Item"}),Object(g.jsx)("th",{children:"Customer"}),Object(g.jsx)("th",{width:"15%",children:"Total"}),Object(g.jsx)("th",{children:"Order date"})]})}),Object(g.jsx)("tbody",{children:l.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("img",{src:e.base_image,className:"mr-2 product-img",alt:"image"})}),Object(g.jsx)("td",{className:"text-left",children:Object(g.jsx)("span",{children:e.name})}),Object(g.jsx)("td",{children:e.customer_name}),Object(g.jsx)("td",{children:"\xa3"+e.price}),Object(g.jsxs)("td",{children:[" ",Object(g.jsx)(Zn,{value:e.created_at})]})]},Math.random())))})]})})}),Object(g.jsx)("div",{className:"tab-pane fade",id:"lastsearchterm",role:"tabpanel","aria-labelledby":"lastsearchterm-tab",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"w-25",children:"Keyword"}),Object(g.jsx)("th",{className:"w-25",children:"Number of Uses"}),Object(g.jsx)("th",{className:"w-25",children:"Number of Result"}),Object(g.jsx)("th",{className:"w-25",children:"Last Search Date"})]})}),Object(g.jsx)("tbody",{children:m.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("span",{children:e.keyword})}),Object(g.jsx)("td",{children:Object(g.jsx)("span",{children:e.no_of_users})}),Object(g.jsx)("td",{children:e.no_of_result}),Object(g.jsxs)("td",{children:[" ",Object(g.jsx)(Zn,{value:e.date})]})]},t)))})]})})}),Object(g.jsx)("div",{className:"tab-pane fade",id:"topsearchterm",role:"tabpanel","aria-labelledby":"topsearchterm-tab",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"w-25",children:"Keyword"}),Object(g.jsx)("th",{className:"w-25",children:"Number of Uses"}),Object(g.jsx)("th",{className:"w-25",children:"Number of Result"}),Object(g.jsx)("th",{className:"w-25",children:"Last Search Date"})]})}),Object(g.jsx)("tbody",{children:void 0!==i&&i.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("span",{children:e.keyword})}),Object(g.jsx)("td",{children:Object(g.jsx)("span",{children:e.no_of_users})}),Object(g.jsx)("td",{children:e.no_of_result}),Object(g.jsxs)("td",{children:[" ",Object(g.jsx)(Zn,{value:e.updated_at})]})]},t)))})]})})})]})]})})})]})};var no=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),i=[{name:"Shape Name",selector:e=>e.name},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/diamondshape/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>O(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[o,u]=Object(d.useState)({page:1,search:"",page_size:10}),[j,p]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.DiamondShape,h()}),[o]);const h=()=>{const e={page:o.page,search:o.search,page_size:o.page_size};a.postApi(c.GetStoneShapeAdminList,e).then((e=>{if(!0===e.data.status){const a=e.data.result[1];t(a),n(!s),p(e.data.result[0][0].total_row)}}))},x=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Shape Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>u({...o,search:e.target.value})}))),O=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0};a.postApi(c.DeleteDiamondShape,e).then((e=>{gl.b.success(l.RecordDeleted),h(),n(!s)}))}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.DiamondShape," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/diamondshape/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Diamond Shape"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:i,data:e,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:j,onChangeRowsPerPage:e=>{u({...o,page_size:e})},onChangePage:e=>{u({...o,page:e})},subHeader:!0,subHeaderComponent:x})})})})})})]})};var io=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),[n,i]=Object(d.useState)(!1),o=Object(d.useRef)(),[m,u]=Object(d.useState)({id:0,name:"",status:0});Object(d.useEffect)((()=>{document.title=r.AddDiamondShape,null!=e.id&&(document.title=r.EditDiamondShape,j())}),[e.id]);const j=()=>{const t={id:e.id};a.postApi(c.GetDiamondShape,t).then((e=>{e.data.result&&(u(e.data.result[0][0]),i(!n))}))},h=e=>t=>{u("status"===e?{...m,[e]:t.target.checked}:{...m,[e]:t.target.value}),i(!n)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",null==e.id?r.AddDiamondShape:r.EditDiamondShape," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Diamond Shape"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",min:"1",maxLength:"100",onChange:h("name"),onKeyUp:h("name"),value:m.name,onBlur:()=>s.current.showMessageFor("Diamond Shape"),placeholder:"Diamond Shape"}),s.current.message("Diamond Shape",m.name,"required|alpha_num_space",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:h("status"),id:"EnableProduct",checked:m.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",ref:o,onClick:r=>{var d;if(!s.current.allValid())return s.current.showMessages(),void i(!n);o.current&&o.current.setAttribute("disabled","disabled");const u={id:m.id,name:m.name,status:null!==(d=m.status)&&void 0!==d?d:0};a.postApi(c.SetDiamondShape,u).then((s=>{if(s.data.message)return gl.b.warning(s.data.message),i(!n),void o.current.removeAttribute("disabled");null==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),i(!n),t.push("/system/diamondshape")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/diamondshape",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var oo=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),i=[{name:"Carat From",selector:e=>e.from_carat},{name:"Carat To",selector:e=>e.to_carat},{name:"Markup Type",selector:e=>"percentage"===e.markup_type?"Percentage":"Amount"},{name:"Type",selector:e=>1===e.is_lab_diamond?"Lab Grown":"Earth Mined"},{name:"Markup",selector:e=>e.markup},{name:"Cost",selector:e=>e.fix_cost},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/diamondmarkup/edit/"+e.ID,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>O(t,e.ID),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[o,u]=Object(d.useState)({page:1,search:"",page_size:10}),[j,p]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.DiamondMarkup,h()}),[o]);const h=()=>{const e={page:o.page,search:o.search,page_size:o.page_size};a.postApi(c.GetDiamondMarkupAdmin,e).then((e=>{if(!0===e.data.status){const a=e.data.result[1];t(a),n(!s),p(e.data.result[0][0].total_row)}}))},x=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Carat From, Carat To, Markup Type.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>u({...o,search:e.target.value})}))),O=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0};a.postApi(c.DeleteDiamondMarkup,e).then((e=>{gl.b.success(l.RecordDeleted),h(),n(!s)}))}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.DiamondMarkup," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/diamondmarkup/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Diamond Markup"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:i,data:e,pagination:!0,paginationServer:!0,paginationTotalRows:j,persistTableHead:!0,onChangeRowsPerPage:e=>{u({...o,page_size:e})},onChangePage:e=>{u({...o,page:e})},subHeader:!0,subHeaderComponent:x})})})})})})]})};var mo=m.a.createContext();var uo=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),n=Object(d.useContext)(mo),[i,o]=Object(d.useState)([]),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)({ID:0,from_carat:"",to_carat:"",markup_type:"percentage",markup:0,fix_cost:0,is_lab_diamond:!1,shape_category_id:""});Object(d.useEffect)((()=>{document.title=r.AddDiamondMarkup,O(),null!=e.id&&(document.title=r.EditDiamondMarkup,x())}),[e.id]);const x=()=>{const t={id:e.id};a.postApi(c.GetDiamondMarkup,t).then((e=>{e.data.result&&(h(e.data.result[0][0]),u(!m))}))},O=()=>{a.getApi(c.GetShapeCategory).then((e=>{e.data.result&&o(e.data.result)}))},v=e=>t=>{"status"===e?h({...j,[e]:t.target.checked}):"is_lab_diamond"===e?"0"===t.target.value?h({...j,[e]:!1}):h({...j,[e]:!0}):h({...j,[e]:t.target.value}),u(!m)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditDiamondMarkup:r.AddDiamondMarkup," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Carat From"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"from_carat",min:"0",onChange:v("from_carat"),onKeyUp:v("from_carat"),value:j.from_carat,onBlur:()=>s.current.showMessageFor("Carat From"),placeholder:"Carat From"}),s.current.message("Carat From",j.from_carat,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Carat To"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"to_carat",min:"0",onChange:v("to_carat"),onKeyUp:v("to_carat"),value:j.to_carat,onBlur:()=>s.current.showMessageFor("Carat To"),placeholder:"Carat To"}),s.current.message("Carat To",j.to_carat,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Markup Type"}),Object(g.jsxs)("select",{className:"form-control",onChange:v("markup_type"),name:"markup_type",value:j.markup_type,children:[Object(g.jsx)("option",{value:"percentage",children:"%"}),Object(g.jsx)("option",{value:"amount",children:"Amount"})]}),s.current.message("Markup Type",j.markup_type,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("label",{children:["Markup ","percentage"===j.markup_type?"(%)":""]}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"markup",min:"0",onChange:v("markup"),onKeyUp:v("markup"),value:j.markup,onBlur:()=>s.current.showMessageFor("Markup"),placeholder:"Markup"}),s.current.message("Markup",j.markup,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Cost"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"fix_cost",min:"0",onChange:v("fix_cost"),onKeyUp:v("fix_cost"),value:j.fix_cost,onBlur:()=>s.current.showMessageFor("Cost"),placeholder:"Cost"}),s.current.message("Cost",j.fix_cost,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Type Of Diamond"}),Object(g.jsxs)("select",{className:"form-control",name:"is_lab_diamond",onChange:v("is_lab_diamond"),value:1===j.is_lab_diamond?"1":"0",children:[Object(g.jsx)("option",{value:"0",children:"Earth Mined"}),Object(g.jsx)("option",{value:"1",children:"Lab Grown"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Shape"}),Object(g.jsxs)("select",{className:"form-control",name:"shape_category_id",onChange:v("shape_category_id"),value:j.shape_category_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),i.map((e=>Object(g.jsx)("option",{value:e.id,children:e.name},e.id)))]}),s.current.message("Shape",j.shape_category_id,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:r=>{if(!s.current.allValid())return s.current.showMessages(),void u(!m);const i={id:j.ID,from_carat:parseFloat(j.from_carat).toFixed(3),to_carat:parseFloat(j.to_carat).toFixed(3),markup_type:j.markup_type,markup:parseInt(j.markup),fix_cost:parseInt(j.fix_cost),is_lab_diamond:j.is_lab_diamond,shape_category_id:j.shape_category_id,created_by:n.id};a.postApi(c.SetDiamondMarkup,i).then((s=>{if(s.data.message)return gl.b.warning(s.data.message),void u(!m);void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),u(!m),t.push("/system/diamondmarkup")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/diamondmarkup",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var jo=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)(!1),n=[{name:"Metal Name",selector:e=>e.metal_type},{name:"Price",selector:e=>Object(g.jsx)(Jn,{value:e.metal_price})},{name:"Labour charge",selector:e=>Object(g.jsx)(Jn,{value:e.metal_labour_charge})},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:Object(g.jsxs)(b.b,{to:"/system/metal/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]})})}],[i,o]=Object(d.useState)({page:1,search:"",page_size:10}),[u,j]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.Metal,p()}),[i]);const p=()=>{const e={page:i.page,search:i.search,page_size:i.page_size};a.postApi(c.GetMetalAdminList,e).then((e=>{if(!0===e.data.status){const a=e.data.result[1];t(a),l(!s),j(e.data.result[0][0].total_row)}}))},h=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Metal Name, Price, Labour Charge.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>o({...i,search:e.target.value})})));return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Metal," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:n,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:u,onChangeRowsPerPage:e=>{o({...i,page_size:e})},onChangePage:e=>{o({...i,page:e})},subHeader:!0,subHeaderComponent:h})})})})})})]})};var bo=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)({id:0,metal_type:"",metal_price:0,metal_labour_charge:0});Object(d.useEffect)((()=>{document.title=r.EditMetal,null!=e.id&&u()}),[e.id]);const u=()=>{const t={id:e.id};a.postApi(c.GetMetal,t).then((e=>{e.data.result&&(m(e.data.result[0][0]),i(!n))}))},j=e=>{const t=e.target.name,s=e.target.value;o[t]=s,i(!n)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.EditMetal," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Metal Type"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"metal_type",min:"1",maxLength:"100",onChange:j,value:o.metal_type,placeholder:"Metal Type"}),s.current.message("Metal Type",o.metal_type,"required",{classNaame:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Metal Price(\xa3)"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"metal_price",min:"1",maxLength:"7",onChange:j,value:o.metal_price,placeholder:"Metal Type"}),s.current.message("Metal Price",o.metal_price,"required|numeric",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Metal Labour Charge(\xa3)"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"metal_labour_charge",onChange:j,value:o.metal_labour_charge,placeholder:"Metal Labour Charge"}),s.current.message("Metal Labour Charge",o.metal_labour_charge,"required",{className:"error"})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{if(!s.current.allValid()){const e=Object.keys(s.current.fields);return Object.values(s.current.fields).forEach(((t,a)=>{a&&s.current.showMessageFor(e[a])})),void i(!n)}const r={id:o.id,metal_type:o.metal_type,metal_price:o.metal_price,metal_labour_charge:o.metal_labour_charge};a.postApi(c.UpdateMetalDetail,r).then((e=>{if(e.data.message)return gl.b.warning(e.data.message),void i(!n);gl.b.success(l.RecordUpdated),i(!n),t.push("/system/metal")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/metal",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var po=()=>Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsx)("h3",{className:"page-title",children:"New Product"}),Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Atrribute"," "]}),Object(g.jsxs)("button",{type:"button",className:"btn btn-primary btn-fw rounded",children:[" ","Save"," "]})]})]}),Object(g.jsxs)("div",{className:"alert alert-warning alert-dismissible fade show",role:"alert",children:["It's time to"," ",Object(g.jsx)("strong",{children:Object(g.jsx)("u",{children:"change your password"})}),Object(g.jsx)("button",{type:"button",className:"close","data-dismiss":"alert","aria-label":"Close",children:Object(g.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-sm-12 stretch-card grid-margin",children:Object(g.jsx)("div",{className:"card border",children:Object(g.jsx)("div",{className:"card-body p-5",children:Object(g.jsxs)("form",{children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-3 col-form-label",children:"Enable Product"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"EnableProduct",checked:!0}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6"}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Attribute Set"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Attribute"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Categories"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Categories"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Product Name"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"SKU"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Metal"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"14K Rose Gold"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Stone Clarity"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"High"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Carat"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"0.5 MM"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Ring Size"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Ring Size"})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Price"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Weight"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:" "})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Quality"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Price"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-3 col-form-label",children:"Trending"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"customTrending",checked:!0}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"customTrending",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-3 col-form-label",children:"Best Sellers"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"customBSellers"}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"customBSellers",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Ready to ship"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("select",{className:"form-control",children:Object(g.jsx)("option",{children:" "})})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-3 col-form-label",children:"Free Shipping"}),Object(g.jsx)("div",{className:"col-sm-4",children:Object(g.jsx)("div",{className:"form-check mt-3",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"freeshippingRadios",id:"freeshippingRadios1",value:"",checked:!0})," ","Yes"," "]})})}),Object(g.jsx)("div",{className:"col-sm-5",children:Object(g.jsx)("div",{className:"form-check mt-3",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"freeshippingRadios",id:"freeshippingRadios2",value:"option2"})," ","No"," "]})})})]})})]}),Object(g.jsx)("div",{className:"row grid-margin",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{id:"accordion",children:[Object(g.jsxs)("div",{className:"card shadow-none",children:[Object(g.jsx)("div",{className:"card-header",id:"headingOne",children:Object(g.jsx)("h5",{className:"mb-0",children:Object(g.jsxs)("a",{className:"text-dark d-flex justify-content-between font-14","data-toggle":"collapse","data-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne",children:["Content ",Object(g.jsx)("i",{className:"mdi mdi-chevron-up"})]})})}),Object(g.jsx)("div",{id:"collapseOne",className:"collapse show","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("p",{children:[" ","Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS."]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none",children:[Object(g.jsx)("div",{className:"card-header",id:"headingTwo",children:Object(g.jsx)("h5",{className:"mb-0",children:Object(g.jsxs)("a",{className:"text-dark d-flex justify-content-between font-14 collapsed","data-toggle":"collapse","data-target":"#collapseTwo","aria-expanded":"false","aria-controls":"collapseTwo",children:["Configuration ",Object(g.jsx)("i",{className:"mdi mdi-chevron-up"})]})})}),Object(g.jsx)("div",{id:"collapseTwo",className:"collapse","aria-labelledby":"headingTwo","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("p",{children:[" ","Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS."]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none",children:[Object(g.jsx)("div",{className:"card-header",id:"headingThree",children:Object(g.jsx)("h5",{className:"mb-0",children:Object(g.jsxs)("a",{className:"text-dark d-flex justify-content-between font-14 collapsed","data-toggle":"collapse","data-target":"#collapseThree","aria-expanded":"false","aria-controls":"collapseThree",children:["Attributes ",Object(g.jsx)("i",{className:"mdi mdi-chevron-up"})]})})}),Object(g.jsx)("div",{id:"collapseThree",className:"collapse","aria-labelledby":"headingThree","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("p",{children:[" ","Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS."]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none",children:[Object(g.jsx)("div",{className:"card-header",id:"headingFour",children:Object(g.jsx)("h5",{className:"mb-0",children:Object(g.jsxs)("a",{className:"text-dark d-flex justify-content-between font-14 collapsed","data-toggle":"collapse","data-target":"#collapseFour","aria-expanded":"false","aria-controls":"collapseFour",children:["Images and Videos ",Object(g.jsx)("i",{className:"mdi mdi-chevron-up"})]})})}),Object(g.jsx)("div",{id:"collapseFour",className:"collapse","aria-labelledby":"headingFour","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body"})})]})]})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-3 col-form-label",children:"Enable Product"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"EnableProduct",checked:!0}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6"}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Attribute Set"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Attribute"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Categories"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Categories"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Product Name"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"SKU"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Metal"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"14K Rose Gold"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Stone Clarity"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"High"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Carat"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"0.5 MM"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Ring Size"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:"Select Ring Size"})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Price"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Weight"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",id:"",children:Object(g.jsx)("option",{children:" "})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Quality"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Price"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-5 col-form-label",children:"Trending"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"customTrending",checked:!0}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"customTrending",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-5 col-form-label",children:"Best Sellers"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsxs)("div",{className:"custom-control custom-switch pt-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"customBSellers"}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"customBSellers",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Ready to ship"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("select",{className:"form-control",children:Object(g.jsx)("option",{children:" "})})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Free Shipping"}),Object(g.jsx)("div",{className:"col-sm-3",children:Object(g.jsx)("div",{className:"form-check mt-3",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"freeshippingRadios",id:"freeshippingRadios1",value:"",checked:!0})," ","Yes"," "]})})}),Object(g.jsx)("div",{className:"col-sm-3",children:Object(g.jsx)("div",{className:"form-check mt-3",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"freeshippingRadios",id:"freeshippingRadios2",value:"option2"})," ","No"," "]})})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Quality"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"",className:"col-sm-5 col-form-label",children:"Quality"}),Object(g.jsx)("div",{className:"col-sm-7",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"",placeholder:" "})})]})})})]})})})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Default form"}),Object(g.jsx)("p",{className:"card-description",children:"Basic form layout"}),Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername1",children:"Username"}),Object(g.jsx)("input",{type:"text",className:"form-control",id:"exampleInputUsername1",placeholder:"Username"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:"Email address"}),Object(g.jsx)("input",{type:"email",className:"form-control",id:"exampleInputEmail1",placeholder:"Email"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputPassword1",children:"Password"}),Object(g.jsx)("input",{type:"password",className:"form-control",id:"exampleInputPassword1",placeholder:"Password"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputConfirmPassword1",children:"Confirm Password"}),Object(g.jsx)("input",{type:"password",className:"form-control",id:"exampleInputConfirmPassword1",placeholder:"Password"})]}),Object(g.jsx)("div",{className:"form-check form-check-flat form-check-primary",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input"})," ","Remember me"," "]})}),Object(g.jsxs)("button",{type:"submit",className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)("button",{className:"btn btn-light",children:"Cancel"})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Horizontal Form"}),Object(g.jsx)("p",{className:"card-description",children:"Horizontal form layout"}),Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-3 col-form-label",children:"Email"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"exampleInputUsername2",placeholder:"Username"})})]}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail2",className:"col-sm-3 col-form-label",children:"Email"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"email",className:"form-control",id:"exampleInputEmail2",placeholder:"Email"})})]}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputMobile",className:"col-sm-3 col-form-label",children:"Mobile"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control",id:"exampleInputMobile",placeholder:"Mobile number"})})]}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputPassword2",className:"col-sm-3 col-form-label",children:"Password"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"password",className:"form-control",id:"exampleInputPassword2",placeholder:"Password"})})]}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputConfirmPassword2",className:"col-sm-3 col-form-label",children:"Re Password"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"password",className:"form-control",id:"exampleInputConfirmPassword2",placeholder:"Password"})})]}),Object(g.jsx)("div",{className:"form-check form-check-flat form-check-primary",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input"})," ","Remember me"," "]})}),Object(g.jsxs)("button",{type:"submit",className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)("button",{className:"btn btn-light",children:"Cancel"})]})]})})}),Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Basic form elements"}),Object(g.jsx)("p",{className:"card-description",children:"Basic form elements"}),Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputName1",children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",id:"exampleInputName1",placeholder:"Name"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail3",children:"Email address"}),Object(g.jsx)("input",{type:"email",className:"form-control",id:"exampleInputEmail3",placeholder:"Email"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputPassword4",children:"Password"}),Object(g.jsx)("input",{type:"password",className:"form-control",id:"exampleInputPassword4",placeholder:"Password"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleSelectGender",children:"Gender"}),Object(g.jsxs)("select",{className:"form-control",id:"exampleSelectGender",children:[Object(g.jsx)("option",{children:"Male"}),Object(g.jsx)("option",{children:"Female"})]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"File upload"}),Object(g.jsx)("input",{type:"file",name:"img[]",className:"file-upload-default"}),Object(g.jsxs)("div",{className:"input-group col-xs-12",children:[Object(g.jsx)("input",{type:"text",className:"form-control file-upload-info",disabled:!0,placeholder:"Upload Image"}),Object(g.jsx)("span",{className:"input-group-append",children:Object(g.jsxs)("button",{className:"file-upload-browse btn btn-primary",type:"button",children:[" ","Upload"," "]})})]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputCity1",children:"City"}),Object(g.jsx)("input",{type:"text",className:"form-control",id:"exampleInputCity1",placeholder:"Location"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleTextarea1",children:"Textarea"}),Object(g.jsx)("textarea",{className:"form-control",id:"exampleTextarea1",rows:"4"})]}),Object(g.jsxs)("button",{type:"submit",className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)("button",{className:"btn btn-light",children:"Cancel"})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Input size"}),Object(g.jsxs)("p",{className:"card-description",children:[" ","Add classes like ",Object(g.jsx)("code",{children:".form-control-lg"})," and ",Object(g.jsx)("code",{children:".form-control-sm"}),"."," "]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Large input"}),Object(g.jsx)("input",{type:"text",className:"form-control form-control-lg",placeholder:"Username","aria-label":"Username"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Default input"}),Object(g.jsx)("input",{type:"text",className:"form-control",placeholder:"Username","aria-label":"Username"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Small input"}),Object(g.jsx)("input",{type:"text",className:"form-control form-control-sm",placeholder:"Username","aria-label":"Username"})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Select size"}),Object(g.jsxs)("p",{className:"card-description",children:[" ","Add classes like ",Object(g.jsx)("code",{children:".form-control-lg"})," and ",Object(g.jsx)("code",{children:".form-control-sm"}),"."," "]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleFormControlSelect1",children:"Large select"}),Object(g.jsxs)("select",{className:"form-control form-control-lg",id:"exampleFormControlSelect1",children:[Object(g.jsx)("option",{children:"1"}),Object(g.jsx)("option",{children:"2"}),Object(g.jsx)("option",{children:"3"}),Object(g.jsx)("option",{children:"4"}),Object(g.jsx)("option",{children:"5"})]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleFormControlSelect2",children:"Default select"}),Object(g.jsxs)("select",{className:"form-control",id:"exampleFormControlSelect2",children:[Object(g.jsx)("option",{children:"1"}),Object(g.jsx)("option",{children:"2"}),Object(g.jsx)("option",{children:"3"}),Object(g.jsx)("option",{children:"4"}),Object(g.jsx)("option",{children:"5"})]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleFormControlSelect3",children:"Small select"}),Object(g.jsxs)("select",{className:"form-control form-control-sm",id:"exampleFormControlSelect3",children:[Object(g.jsx)("option",{children:"1"}),Object(g.jsx)("option",{children:"2"}),Object(g.jsx)("option",{children:"3"}),Object(g.jsx)("option",{children:"4"}),Object(g.jsx)("option",{children:"5"})]})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Basic input groups"}),Object(g.jsx)("p",{className:"card-description",children:"Basic bootstrap input groups"}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text",children:"@"})}),Object(g.jsx)("input",{type:"text",className:"form-control",placeholder:"Username","aria-label":"Username","aria-describedby":"basic-addon1"})]})}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text bg-primary text-white",children:"$"})}),Object(g.jsx)("input",{type:"text",className:"form-control","aria-label":"Amount (to the nearest dollar)"}),Object(g.jsx)("div",{className:"input-group-append",children:Object(g.jsx)("span",{className:"input-group-text",children:".00"})})]})}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text",children:"$"})}),Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text",children:"0.00"})}),Object(g.jsx)("input",{type:"text",className:"form-control","aria-label":"Amount (to the nearest dollar)"})]})}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("input",{type:"text",className:"form-control",placeholder:"Recipient's username","aria-label":"Recipient's username","aria-describedby":"basic-addon2"}),Object(g.jsx)("div",{className:"input-group-append",children:Object(g.jsxs)("button",{className:"btn btn-sm btn-primary",type:"button",children:[" ","Search"," "]})})]})}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsxs)("div",{className:"input-group-prepend",children:[Object(g.jsxs)("button",{className:"btn btn-sm btn-outline-primary dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",children:[" ","Dropdown"," "]}),Object(g.jsxs)("div",{className:"dropdown-menu",children:[Object(g.jsx)("a",{className:"dropdown-item",href:"#",children:"Action"}),Object(g.jsx)("a",{className:"dropdown-item",href:"#",children:"Another action"}),Object(g.jsx)("a",{className:"dropdown-item",href:"#",children:"Something else here"}),Object(g.jsx)("div",{role:"separator",className:"dropdown-divider"}),Object(g.jsx)("a",{className:"dropdown-item",href:"#",children:"Separated link"})]})]}),Object(g.jsx)("input",{type:"text",className:"form-control","aria-label":"Text input with dropdown button"})]})}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("input",{type:"text",className:"form-control",placeholder:"Find in facebook","aria-label":"Recipient's username","aria-describedby":"basic-addon2"}),Object(g.jsx)("div",{className:"input-group-append",children:Object(g.jsx)("button",{className:"btn btn-sm btn-facebook",type:"button",children:Object(g.jsx)("i",{className:"mdi mdi-facebook"})})})]})})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsxs)("div",{className:"card",children:[Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Checkbox Controls"}),Object(g.jsxs)("p",{className:"card-description",children:[" ","Checkbox and radio controls (default appearance is in primary color)"," "]}),Object(g.jsx)("form",{children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input"})," ","Default"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Checked"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",disabled:!0})," ","Disabled"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",disabled:!0,checked:!0})," ","Disabled checked"," "]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"optionsRadios",id:"optionsRadios1",value:""})," ","Default"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"optionsRadios",id:"optionsRadios2",value:"option2",checked:!0})," ","Selected"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"optionsRadios2",id:"optionsRadios3",value:"option3",disabled:!0})," ","Disabled"," "]})}),Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"optionsRadio2",id:"optionsRadios4",value:"option4",disabled:!0,checked:!0})," ","Selected and disabled"," "]})})]})})]})})]}),Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsxs)("p",{className:"card-description",children:[" ","Add className ",Object(g.jsx)("code",{children:".form-check"})," htmlFor checkbox and radio controls in theme colors"," "]}),Object(g.jsx)("form",{children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("div",{className:"form-check form-check-primary",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Primary"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-success",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Success"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-info",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Info"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-danger",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Danger"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-warning",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Warning"," "]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("div",{className:"form-check form-check-primary",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"ExampleRadio1",id:"ExampleRadio1",checked:!0})," ","Primary"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-success",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"ExampleRadio2",id:"ExampleRadio2",checked:!0})," ","Success"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-info",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"ExampleRadio3",id:"ExampleRadio3",checked:!0})," ","Info"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-danger",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"ExampleRadio4",id:"ExampleRadio4",checked:!0})," ","Danger"," "]})}),Object(g.jsx)("div",{className:"form-check form-check-warning",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"ExampleRadio5",id:"ExampleRadio5",checked:!0})," ","Warning"," "]})})]})})]})})]})]})}),Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Inline forms"}),Object(g.jsxs)("p",{className:"card-description",children:[" ","Use the ",Object(g.jsx)("code",{children:".form-inline"})," className to display a series of labels, form controls, and buttons on a single horizontal row"," "]}),Object(g.jsxs)("form",{className:"form-inline",children:[Object(g.jsx)("label",{className:"sr-only",htmlFor:"inlineFormInputName2",children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control mb-2 mr-sm-2",id:"inlineFormInputName2",placeholder:"Jane Doe"}),Object(g.jsx)("label",{className:"sr-only",htmlFor:"inlineFormInputGroupUsername2",children:"Username"}),Object(g.jsxs)("div",{className:"input-group mb-2 mr-sm-2",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("div",{className:"input-group-text",children:"@"})}),Object(g.jsx)("input",{type:"text",className:"form-control",id:"inlineFormInputGroupUsername2",placeholder:"Username"})]}),Object(g.jsx)("div",{className:"form-check mx-sm-2",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",checked:!0})," ","Remember me"," "]})}),Object(g.jsxs)("button",{type:"submit",className:"btn btn-primary mb-2",children:[" ","Submit"," "]})]})]})})}),Object(g.jsx)("div",{className:"col-12 grid-margin",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Horizontal Two column"}),Object(g.jsxs)("form",{className:"form-sample",children:[Object(g.jsx)("p",{className:"card-description",children:"Personal info"}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"First Name"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Last Name"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Gender"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("select",{className:"form-control",children:[Object(g.jsx)("option",{children:"Male"}),Object(g.jsx)("option",{children:"Female"})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Date of Birth"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{className:"form-control",placeholder:"dd/mm/yyyy"})})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Category"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("select",{className:"form-control",children:[Object(g.jsx)("option",{children:"Category1"}),Object(g.jsx)("option",{children:"Category2"}),Object(g.jsx)("option",{children:"Category3"}),Object(g.jsx)("option",{children:"Category4"})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Membership"}),Object(g.jsx)("div",{className:"col-sm-4",children:Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"membershipRadios",id:"membershipRadios1",value:"",checked:!0})," ","Free"," "]})})}),Object(g.jsx)("div",{className:"col-sm-5",children:Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"radio",className:"form-check-input",name:"membershipRadios",id:"membershipRadios2",value:"option2"})," ","Professional"," "]})})})]})})]}),Object(g.jsx)("p",{className:"card-description",children:"Address"}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Address 1"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"State"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Address 2"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Postcode"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"City"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsx)("input",{type:"text",className:"form-control"})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-sm-3 col-form-label",children:"Country"}),Object(g.jsx)("div",{className:"col-sm-9",children:Object(g.jsxs)("select",{className:"form-control",children:[Object(g.jsx)("option",{children:"America"}),Object(g.jsx)("option",{children:"Italy"}),Object(g.jsx)("option",{children:"Russia"}),Object(g.jsx)("option",{children:"Britain"})]})})]})})]})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Select 2"}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Single select box using select 2"}),Object(g.jsxs)("select",{className:"js-example-basic-single w-100",children:[Object(g.jsx)("option",{value:"AL",children:"Alabama"}),Object(g.jsx)("option",{value:"WY",children:"Wyoming"}),Object(g.jsx)("option",{value:"AM",children:"America"}),Object(g.jsx)("option",{value:"CA",children:"Canada"}),Object(g.jsx)("option",{value:"RU",children:"Russia"})]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Multiple select using select 2"}),Object(g.jsxs)("select",{className:"js-example-basic-multiple w-100",multiple:"multiple",children:[Object(g.jsx)("option",{value:"AL",children:"Alabama"}),Object(g.jsx)("option",{value:"WY",children:"Wyoming"}),Object(g.jsx)("option",{value:"AM",children:"America"}),Object(g.jsx)("option",{value:"CA",children:"Canada"}),Object(g.jsx)("option",{value:"RU",children:"Russia"})]})]})]})})}),Object(g.jsx)("div",{className:"col-md-6 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("h4",{className:"card-title",children:"Typeahead"}),Object(g.jsx)("p",{className:"card-description",children:"A simple suggestion engine"}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("label",{children:"Basic"}),Object(g.jsx)("div",{id:"the-basics",children:Object(g.jsx)("input",{className:"typeahead",type:"text",placeholder:"States of USA"})})]}),Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("label",{children:"Bloodhound"}),Object(g.jsx)("div",{id:"bloodhound",children:Object(g.jsx)("input",{className:"typeahead",type:"text",placeholder:"States of USA"})})]})]})]})})})]})]});var ho=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),o=[{name:"Metal Quality",selector:e=>e.metal_quality},{name:"Fineness(%)",selector:e=>e.fineness},{name:"Rate",selector:e=>Object(g.jsx)(Jn,{value:e.rate})},{name:"Labour Charge",selector:e=>Object(g.jsx)(Jn,{value:e.labour_charges})},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/metalquality/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>v(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[u,j]=Object(d.useState)({page:1,search:"",page_size:10}),[p,h]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.MetalQuality,x()}),[u]);const x=()=>{const e={page:u.page,search:u.search,page_size:u.page_size};a.postApi(c.GetMetalQualityAdminList,e).then((e=>{if(!0===e.data.status){const s=e.data.result[1];t(s),i(!n),h(e.data.result[0][0].total_row)}}))},O=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Metal Quality, Fineness(%).",className:"form-control col-md-3",placeholder:"Search",onChange:e=>j({...u,search:e.target.value})}))),v=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};a.postApi(c.DeleteMetalQuality,e).then((e=>{gl.b.success(l.RecordDeleted),x(),i(!n)}))}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.MetalQuality," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/metalquality/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Metal Quality"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:o,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:p,onChangeRowsPerPage:e=>{j({...u,page_size:e})},onChangePage:e=>{j({...u,page:e})},subHeader:!0,subHeaderComponent:O})})})})})})]})};var xo=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),[s,n]=Object(d.useState)(!1),i=Object(d.useRef)(new ec.a),[o,m]=Object(d.useState)([]),[u,j]=Object(d.useState)(),h=Object(d.useRef)(),[x,O]=Object(d.useState)({id:0,metal_quality_option_id:"",metal_type_id:"",gold_rate:"",fineness:"0",weight:"1",rate:"0",labour_charges:"",status:0});Object(d.useEffect)((()=>{document.title=r.AddMetalQuality,v(),N()}),[e.id]);const v=()=>{a.postApi(c.GetMetal,null).then((t=>{m(t.data.result[0]),null!=e.id&&(document.title=r.EditMetalQuality,f())}))},N=()=>{a.postApi(c.GetProductAttributeDetail,{attribute_code:"Metal_quality"}).then((e=>{j(JSON.parse(e.data.result[0][0].attribute_options)),n(!s)}))},f=()=>{const t={id:e.id};a.postApi(c.GetMetalQuality,t).then((e=>{e.data.result&&(O(e.data.result[0][0]),n(!s))}))},_=e=>t=>{if("status"===e)O({...x,[e]:t.target.checked});else if("metal_type_id"===e)for(let e=0;e{e.preventDefault()},className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Metal Quality"}),Object(g.jsxs)("select",{className:"form-control",id:"",name:"metal_quality_option_id",onChange:_("metal_quality_option_id"),value:x.metal_quality_option_id,children:[Object(g.jsx)("option",{children:"Select Metal"}),null!=u?Object.keys(u).map(((e,t)=>Object(g.jsx)("option",{value:e,children:u[e]},e))):""]}),i.current.message("Metal Quality",x.metal_quality_option_id,"required|alpha_num_space",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Metal"}),Object(g.jsxs)("select",{className:"form-control",id:"",name:"metal_type_id",onChange:_("metal_type_id"),value:x.metal_type_id,children:[Object(g.jsx)("option",{children:"Select Metal"}),o.map((e=>Object(g.jsx)("option",{value:e.id,children:e.metal_type},e.id)))]}),i.current.message("Metal",x.metal_type_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Gold Price(\xa3)"}),Object(g.jsx)("input",{type:"text",className:"form-control",id:"gold_rate",name:"gold_rate",min:"1",maxLength:"7",readOnly:"readOnly",onChange:_("gold_rate"),onKeyUp:_("gold_rate"),onBlur:()=>i.current.showMessageFor("Gold Rate"),value:x.gold_rate,placeholder:"Gold Price"}),i.current.message("Gold Rate",x.gold_rate,"required|numeric",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Fineness(%)"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"fineness",min:"1",maxLength:"7",onChange:_("fineness"),onKeyUp:_("fineness"),onBlur:()=>i.current.showMessageFor("Fineness"),value:x.fineness,placeholder:"Fineness"}),i.current.message("Fineness",x.fineness,"required|numeric",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Weight (kt)"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"weight",min:"1",maxLength:"10",readOnly:"readOnly",onChange:_("weight"),onKeyUp:_("weight"),onBlur:()=>i.current.showMessageFor("Weight"),value:x.weight,placeholder:"Weight"}),i.current.message("Weight",x.weight,"required|numeric",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Rate(\xa3)"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"rate",min:"1",maxLength:"7",readOnly:"readOnly",onChange:_("rate"),onKeyUp:_("rate"),onBlur:()=>i.current.showMessageFor("Rate"),value:x.rate,placeholder:"Rate"}),i.current.message("Rate",x.rate,"required|numeric",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Labour Charge(\xa3)"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"labour_charges",min:"1",maxLength:"7",onChange:_("labour_charges"),onKeyUp:_("labour_charges"),onBlur:()=>i.current.showMessageFor("Labour Charge"),value:x.labour_charges,placeholder:"Labour Charge"}),i.current.message("Labour Charge",x.labour_charges,"required|numeric",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:_("status"),id:"EnableProduct",checked:x.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",ref:h,onClick:r=>{var o;if(r.preventDefault(),!i.current.allValid())return i.current.showMessages(),void n(!s);h.current&&h.current.setAttribute("disabled","disabled");const d={id:x.id,metal_quality_option_id:x.metal_quality_option_id,metal_type_id:x.metal_type_id,gold_rate:x.gold_rate,fineness:x.fineness,weight:x.weight,rate:x.rate,labour_charges:x.labour_charges,status:null!==(o=x.status)&&void 0!==o?o:0};a.postApi(c.SetMetalQuality,d).then((a=>{if(a.data.message)return gl.b.warning(a.data.message),n(!s),void h.current.removeAttribute("disabled");void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),n(!s),t.push("/system/metalquality")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/metalquality",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var Oo=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),o=[{name:"Clarity",selector:e=>e.clarity},{name:"Color",selector:e=>e.color},{name:"Stone Quality",selector:e=>e.stone_quality},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/diamondquality/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>v(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[u,j]=Object(d.useState)({page:1,search:"",page_size:10}),[p,h]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.DiamondQuality,x()}),[u]);const x=()=>{const e={page:u.page,search:u.search,page_size:u.page_size};a.postApi(c.GetStoneQualityAdminList,e).then((e=>{if(!0===e.data.status){const s=e.data.result[1];t(s),i(!n),h(e.data.result[0][0].total_row)}}))},O=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Clarity, Color.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>j({...u,search:e.target.value})}))),v=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};a.postApi(c.DeleteDiamondQuality,e).then((e=>{gl.b.success(l.RecordDeleted),x(),i(!n)}))}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.DiamondQuality," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/diamondquality/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Diamond Quality"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:o,data:e,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:p,onChangeRowsPerPage:e=>{j({...u,page_size:e})},onChangePage:e=>{j({...u,page:e})},subHeader:!0,subHeaderComponent:O})})})})})})]})};var go=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(),n=Object(d.useRef)(new ec.a),[i,o]=Object(d.useState)(!1),[m,u]=Object(d.useState)({id:0,stone_quality:"",color:"",clarity:"",status:0});Object(d.useEffect)((()=>{document.title=r.AddDiamondQuality,null!=e.id&&(document.title=r.EditDiamondQuality,j())}),[e.id]);const j=()=>{const t={id:e.id};a.postApi(c.GetDiamondQuality,t).then((e=>{console.log(e),e.data.result&&(u(e.data.result[0][0]),o(!i))}))},h=e=>t=>{u("status"===e?{...m,[e]:t.target.checked}:{...m,[e]:t.target.value}),o(!i)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditDiamondQuality:r.AddDiamondQuality," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Diamond Quality"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"stone_quality",min:"1",maxLength:"25",onChange:h("stone_quality"),onKeyUp:h("stone_quality"),onBlur:()=>n.current.showMessageFor("Diamond Quality"),defaultValue:m.stone_quality,placeholder:"Diamond Quality"}),n.current.message("Diamond Quality",m.stone_quality,"required|alpha_num_dash",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Clarity"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"clarity",min:"1",maxLength:"10",onChange:h("clarity"),onKeyUp:h("clarity"),onBlur:()=>n.current.showMessageFor("Clarity"),defaultValue:m.clarity,placeholder:"Clarity"}),n.current.message("Clarity",m.clarity,"required|alpha",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Color"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"color",min:"1",maxLength:"10",onChange:h("color"),onKeyUp:h("color"),onBlur:()=>n.current.showMessageFor("Color"),defaultValue:m.color,placeholder:"Color"}),n.current.message("Color",m.color,"required|alpha",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:h("status"),id:"EnableProduct",checked:m.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:s,type:"button",onClick:r=>{var d;if(!n.current.allValid())return n.current.showMessages(),void o(!i);s.current&&s.current.setAttribute("disabled","disabled");const u={id:m.id,stone_quality:m.stone_quality,color:m.color,clarity:m.clarity,status:null!==(d=m.status)&&void 0!==d?d:0};a.postApi(c.SetDiamondQuality,u).then((a=>{if(a.data.message)return gl.b.warning(a.data.message),o(!i),void s.current.removeAttribute("disabled");null==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),o(!i),t.push("/system/diamondquality")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/diamondquality",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var vo=()=>{const[e,t]=Object(d.useState)(1),[s,n]=Object(d.useState)(),[i,o]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!1),[p,h]=Object(d.useState)(!0),[x,O]=Object(d.useState)(""),N=[{name:"Name",sortField:"Name",selector:e=>e.name,sortable:!0},{name:"Rate",selector:e=>e.rate},{name:"Min Order Amount",selector:e=>e.min_freeshipping_amount},{name:"Create Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),sortField:"created_at",sortable:!0},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/shippingrate/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{className:"text-dark",onClick:t=>{C(t,e.id)},title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],f=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name, Rate, Min Order Amount.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{O(e.target.value)}),1e3)}))),[_,y]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[w,k]=Object(d.useState)();Object(d.useEffect)((()=>{j(!0),document.title=r.ShippingRate,S()}),[_,x]);const S=()=>{const e={page:_.page,search:x,page_size:_.page_size,sort_column:_.sort_column,sort_direction:_.sort_direction};h(!0),a.postApi(c.GetShippingRate,e).then((e=>{if(h(!1),!0===e.data.status&&""!==e.data.result){const t=e.data.result;n(t[1]),o(!i),k(e.data.result[0][0].total)}else n([]),k(0)}))},C=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t};h(!0),a.postApi(c.DeleteShippingRate,e).then((e=>{h(!1),gl.b.success(l.RecordDeleted),S(),o(!i)}))}}))};return u?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ShippingRate," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/shippingrate/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddShippingRate," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:N,data:s,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:w,onChangeRowsPerPage:e=>{y({..._,page:1,page_size:e})},onChangePage:e=>{t(e),y({..._,page:e})},subHeader:!0,subHeaderComponent:f,onSort:(e,t)=>{y({..._,sort_column:e.sortField,sort_direction:t})},paginationDefaultPage:e,sortServer:!0,progressPending:p,progressComponent:Object(g.jsx)(v,{})})})})})})})]}):Object(g.jsx)(v,{})};var No=()=>{const[e,t]=Object(d.useState)(!1),s=Object(p.useHistory)(),n=Object(d.useRef)(new ec.a),i=Object(p.useParams)(),o=Object(d.useRef)(),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)({id:0,name:"",rate:"",min_freeshipping_amount:"",status:0}),[x,O]=Object(d.useState)(!1);Object(d.useEffect)((()=>{u(!0),document.title=r.AddShippingRate,null!=i.id&&(document.title=r.EditShippingRate,N())}),[i.id]);const N=()=>{const e={_id:i.id};t(!0),a.postApi(c.GetShippingRateByID,e).then((e=>{if(t(!1),e.data.result){const t=e.data.result[0];h(t[0])}}))},f=e=>t=>{h("status"===e?{...j,[e]:t.target.checked}:{...j,[e]:t.target.value}),O(!x)},_=e=>{"Minus"!==e.code&&"NumpadSubtract"!==e.code&&"KeyE"!==e.code||e.preventDefault()};return!m||e?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",null==i.id?r.AddShippingRate:r.EditShippingRate," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:s.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",value:j.name,onChange:f("name"),placeholder:"Enter Value",className:"form-control"}),n.current.message("Name",j.name,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Rate"}),Object(g.jsx)("input",{type:"number",value:j.rate,onChange:f("rate"),placeholder:"Enter Value",className:"form-control",min:0,onKeyPress:_}),n.current.message("Rate",j.rate,"required|number",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Min Order Amount"}),Object(g.jsx)("input",{type:"number",value:j.min_freeshipping_amount,onChange:f("min_freeshipping_amount"),placeholder:"Enter Value",className:"form-control",min:0,onKeyPress:_}),n.current.message("Min Free Shipping Amount",j.min_freeshipping_amount,"required|number",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6 ",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:f("status"),id:"EnableProduct",checked:j.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:o,type:"button",onClick:e=>{if(!n.current.allValid())return n.current.showMessages(),void O(!x);o.current&&o.current.setAttribute("disabled","disabled");const r={id:i.id,name:j.name.trim(),rate:j.rate,min_freeshipping_amount:j.min_freeshipping_amount,status:j.status};t(!0),a.postApi(c.SetShippingRate,r).then((e=>{if(t(!1),""!==e.data.result[0][0].detail)return gl.b.warning(e.data.result[0][0].detail),O(!x),void o.current.removeAttribute("disabled");null==i.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),O(!x),s.push("/system/shippingrate")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/shippingrate",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})},fo=s(149),_o=s.n(fo);var yo=()=>{var e,t,s,n,i,o,u,j,h,x,O,N,f,_;const y=Object(p.useLocation)(),[w,k]=Object(d.useState)([]),S=Object(d.useContext)(mo),[C,A]=Object(d.useState)(!1),[P,D]=Object(d.useState)(!1),[M,R]=Object(d.useState)(0),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)(!1),[,G]=Object(d.useState)(0),[T,B]=Object(d.useState)(y.state?0===parseInt(y.state.state.page)?1:parseInt(y.state.state.page):1),z=Object(p.useHistory)(),[U,q]=Object(d.useState)([]),[H,V]=Object(d.useState)([]),K=Object(d.useRef)(new ec.a),[W,Y]=Object(d.useState)(!1),[Q,X]=Object(d.useState)(!0),[J,Z]=Object(d.useState)(void 0!==(null===(e=y.state)||void 0===e||null===(t=e.state)||void 0===t?void 0:t.categoryIds)?JSON.parse(y.state.state.categoryIds):[]),[$,ee]=Object(d.useState)(""),[te,se]=Object(d.useState)([]),[ae,ce]=Object(d.useState)(!1),re={name:void 0!==(null===(s=y.state)||void 0===s||null===(n=s.state)||void 0===n?void 0:n.name)?y.state.state.name:"",sku:void 0!==(null===(i=y.state)||void 0===i||null===(o=i.state)||void 0===o?void 0:o.sku)?y.state.state.sku:"",priceTo:void 0!==(null===(u=y.state)||void 0===u||null===(j=u.state)||void 0===j?void 0:j.priceTo)?y.state.state.priceTo:"",priceFrom:void 0!==(null===(h=y.state)||void 0===h||null===(x=h.state)||void 0===x?void 0:x.priceFrom)?y.state.state.priceFrom:"",page:T,page_size:20,attribute_set_id:void 0!==(null===(O=y.state)||void 0===O||null===(N=O.state)||void 0===N?void 0:N.attribute_set_id)?y.state.state.attribute_set_id:0,vendor:void 0!==(null===(f=y.state)||void 0===f||null===(_=f.state)||void 0===_?void 0:_.vendor)?y.state.state.vendor:"",status:null},[le,ne]=Object(d.useState)(re),ie=[{name:"Image",selector:function(e,t,s){return Object(g.jsx)("img",{className:"my-2",width:"95px",height:"95px",src:e.base_image})}},{name:"SKU",selector:e=>e.sku,wrap:!0},{name:"Name",selector:e=>ro(e.name),wrap:!0},{name:"Attribute Set",selector:e=>e.attribute_set_name},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),wrap:!0},{name:"Action",selector:function(e,t,s){return Object(g.jsxs)("div",{className:"action-btn",children:[(0===parseInt(e.parent_product_id)||null===e.parent_product_id)&&Object(g.jsxs)(b.b,{to:"/products/edit/"+e.id+"?page="+T+"&sku="+le.sku+"&name="+le.name+"&aid="+le.attribute_set_id+"&priceto="+le.priceTo+"&pricefrom="+le.priceFrom+"&cid="+JSON.stringify(J)+"&vendor="+le.vendor,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>be(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}}],oe=Object(d.useRef)(null),de=Object(d.useRef)(null);Object(d.useEffect)((()=>{Y(!0),document.title=r.Products,ue(),je(),me()}),[le,y]);const me=()=>{X(!0),a.postApi(c.GetProductAttributeSetAdminList,{page:1,search:"",page_size:50,sort_column:"",sort_direction:""}).then((e=>{if(X(!1),!0===e.data.status){const t=e.data.result[1].filter((e=>e.is_product_exist));V(t)}}))},ue=()=>{const e={sku:le.sku,name:le.name,priceFrom:null!==le.priceFrom&&Number(le.priceFrom)>0?Number(le.priceFrom):0,priceTo:null!==le.priceTo?Number(le.priceTo):"-",page:0===le.page?1:le.page,page_size:le.page_size,category:J?J.join(","):"",attribute_set_id:le.attribute_set_id,vendor:le.vendor,status:le.status};X(!0),a.postApi(c.GetProductsAdminList,e).then((e=>{try{if(!0===e.data.status){const t=e.data.result[1];k([]),k(t),R(e.data.result[0][0].total_row),G(0),A(!C),X(!1)}}catch(t){console.error(t),X(!1)}}))},je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a.postApi(c.GetCategory,null).then((t=>{if(t.data.result){const s=[],a=c=>t.data.result[0].filter((e=>1!==e.is_diamond_category)).filter((e=>e.parent_id===c&&e.status)).map((t=>{const c=a(t.id);0===c.length&&s.push(t.id);const r=c.length>0&&c.every((e=>e.checked))||e.includes(t.id);return{label:t.name,value:t.id,checked:r,children:c}})),c=a(1);q(c)}}))},be=async(e,t,s)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){e&&pe(t)}))},pe=e=>{const t={id:e,IsDeleted:!0,Userid:S.id,is_delete_all:!0===E?1:0};a.postApi(c.DeleteProducts,t).then((e=>{gl.b.success(l.RecordDeleted),L(!1),ue(),I([]),A(!C)}))},he=e=>t=>{const s=l.pricelength,a=l.pricehighest;t.target.value.length>s&&("priceTo"===e||"priceFrom"===e)?"priceFrom"===e&&t.target.value>a?de.current.value=t.target.value.slice(0,s):"priceTo"===e&&t.target.value>a&&(oe.current.value=t.target.value.slice(0,s)):le[e]=t.target.value,A(!C)},xe=(e,t)=>{const s=t.toLowerCase();return e.map((e=>{const t=e.label.toLowerCase().includes(s);let a=null;return e.children&&(a=xe(e.children,s)),t||null!==a&&a.length>0?{...e,children:a}:null})).filter((e=>null!==e))},Oe=xe(U,$);Object(d.useEffect)((()=>{E&&pe("")}),[E]);const ge=m.a.forwardRef(((e,t)=>{let{onClick:s,...a}=e;return Object(g.jsx)("div",{className:"form-check",children:Object(g.jsx)("input",{htmlFor:"select-all",type:"checkbox",className:"form-check-input",ref:t,onClick:s,checked:!0,...a})})})),ve=e=>{"Minus"!==e.code&&"NumpadSubtract"!==e.code||e.preventDefault()};return W?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("h3",{className:"page-title mb-3",children:[" ",r.Products," "]}),Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)(b.b,{onClick:async e=>{e.preventDefault(),void 0!==F&&0!==F.length||E?sc()(l.SwalDeleteProp).then((function(e){if(e){const e=[];F.length>0?(F.forEach((t=>e.push(t.id))),pe(e.join(","))):pe("")}})):gl.b.warning(l.SelectAtlestOneItem)},className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.DeleteSelected," "]}),Object(g.jsxs)(b.b,{onClick:e=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){e&&L(!0)}))},className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.DeleteAll," "]})]}),Object(g.jsx)("div",{className:"btn-group ml-auto"}),Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)(b.b,{to:"/products/updateprice",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.UpdatePrice," "]}),Object(g.jsxs)(b.b,{to:"/products/add?page="+T+"&sku="+le.sku+"&name="+le.name+"&aid="+le.attribute_set_id+"&priceto="+le.priceTo+"&pricefrom="+le.priceFrom+"&cid="+JSON.stringify(J),className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddProducts," "]}),Object(g.jsxs)(b.b,{to:"#",onClick:e=>(e=>{e.preventDefault(),D(!P)})(e),className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})]})]}),Object(g.jsx)("div",{className:P?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"SKU"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:he("sku"),value:le.sku})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Name"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:he("name"),value:le.name})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),Object(g.jsxs)("div",{className:"custom-dropdown text-left",children:[Object(g.jsx)("button",{type:"button",className:ae||"text-left form-control custom-select",onClick:()=>{ce(ae?"":"text-left form-control custom-select show")},children:"Select Category"}),Object(g.jsxs)("div",{className:"dropdown-menu p-1 mt-3",children:[Object(g.jsx)("input",{className:"form-control p-1 mb-2",placeholder:"Search...",type:"text",value:$,onChange:e=>{ee(e.target.value.toLowerCase())}}),Object(g.jsx)(_o.a,{checked:J,expandOnClick:!0,expanded:te,nodes:Oe,onCheck:e=>{Z(e)},onExpand:e=>{se(e)},icons:{parentClose:null,parentOpen:null,leaf:null}})]})]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Price"})}),Object(g.jsxs)("div",{className:"form-group mb-2 row align-items-center",children:[Object(g.jsx)("div",{className:"col-md-5 pr-md-2",children:Object(g.jsx)("input",{type:"number",min:1,ref:de,className:"form-control",placeholder:"From",value:le.priceFrom,onChange:he("priceFrom"),onKeyPress:ve})}),Object(g.jsxs)("div",{className:"col-md-6 pl-md-3",children:[Object(g.jsx)("input",{type:"number",min:0,className:"form-control",placeholder:"To",onChange:he("priceTo"),ref:oe,value:le.priceTo,onKeyPress:ve,name:"priceTo"}),K.current.message("priceTo",le.priceTo,"required|numeric|min:0,max:999,num",{className:"error"})]})]})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Attribute Set"}),Object(g.jsxs)("select",{className:"form-control custom-select",name:"attribute_set_id",value:le.attribute_set_id,onChange:he("attribute_set_id"),children:[Object(g.jsx)("option",{value:"",children:"--Select--"}),H.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]})]})}),Object(g.jsx)("div",{className:"col-md-3 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Status"})}),Object(g.jsxs)("select",{className:"form-control",name:"status",onChange:he("status"),children:[Object(g.jsx)("option",{children:"Select"}),Object(g.jsx)("option",{value:"1",children:"Active"}),Object(g.jsx)("option",{value:"0",children:"Inactive"})]})]})}),Object(g.jsx)("div",{className:"col-md-3 p-4",children:Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)(b.b,{className:"btn btn-dark btn-fw-130 rounded mr-2",onClick:e=>ue(e),children:[" ","Apply"," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(b.b,{className:"btn btn-primary btn-fw-130 rounded mr-2",onClick:e=>(z.push(y.pathname,null),Z([]),ne({name:"",sku:"",priceTo:"",priceFrom:"",page:T,page_size:20,attribute_set_id:0,vendor:""}),A(!C),oe.current.value="",de.current.value="",void ee("")),children:[" ","Reset"," "]})})]})})]})})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:ie,data:w,progressPending:Q,progressComponent:Object(g.jsx)(v,{}),selectableRows:!0,pagination:!0,paginationServer:!0,paginationPerPage:20,paginationTotalRows:M,onChangeRowsPerPage:e=>{B(1),ne({...le,page:1,page_size:e})},onChangePage:e=>{B(e),ne({...le,page:e})},onSelectedRowsChange:e=>{I(e.selectedRows),G(e.selectedRows.length)},selectableRowsComponent:ge,paginationDefaultPage:T})})})})})})]}):Object(g.jsx)(v,{})};s(917);var wo=e=>{const[t,s]=Object(d.useState)(new ec.a),[a]=Object(d.useState)(!1),[c]=Object(d.useState)(void 0!==e.props.CurrentImageVariant?e.props.CurrentImageVariant:[]),[r,l]=Object(d.useState)(void 0!==e.props.ProductMedia?e.props.ProductMedia.images:[]),[n,i]=Object(d.useState)(void 0!==e.props.ProductMedia?e.props.ProductMedia.video:[]),o=e.props.SelectedMediaFiles,[m,u]=Object(d.useState)(e.props.SelectedMediaFiles),[j,b]=Object(d.useState)(!1),[p,h]=Object(d.useState)(""),[x,O]=Object(d.useState)(!1),[v,N]=Object(d.useState)("current-option"),[f,_]=Object(d.useState)(""),y=()=>{u(o),b(!j),e.closeMediaPopup(!0),w()},w=()=>{l([]),i([])},k=e=>t=>{const s=t.target,a=s.value;"attribute_option"===e?_(a):"images"===e?s.checked?u((e=>({...e,images:[...e.images,a]}))):u((e=>({...e,images:e.images.filter((e=>e!==a))}))):s.checked?u({...m,[e]:t.target.value}):u({...m,[e]:""}),b(!j)},S=e=>{"current-option"===e.target.value&&s(new ec.a),N(e.target.value)};return Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)(li.a,{id:"product-media-modal",size:"lg",show:e.props.IsShowImagesVideoModal,onHide:y,"aria-labelledby":"contained-modal-title-vcenter",centered:!0,backdrop:"static",scrollable:!0,children:[Object(g.jsxs)(li.a.Header,{children:[Object(g.jsx)("div",{children:Object(g.jsx)("h6",{children:"Select Media"})}),Object(g.jsx)("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:e=>y(),children:Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[Object(g.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Object(g.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),Object(g.jsx)(li.a.Body,{children:Object(g.jsxs)("div",{className:"container-fluid",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("input",{type:"text",name:"search",className:"form-control",placeholder:"Search...",onChange:e=>(e=>{const t=e.target.value;t.length>=2?h(t.toLowerCase()):h("")})(e)})})}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsx)("h4",{children:"Images"}),Object(g.jsx)("hr",{}),Object(g.jsxs)("div",{className:"d-flex align-items-center",children:[Object(g.jsx)("input",{type:"checkbox",id:"chkSelectAllImage",name:"images",onChange:t=>(t=>{t.target.checked?m.images=""===p?e.props.ProductMedia.images:e.props.ProductMedia.images.filter((e=>e.toLowerCase().indexOf(p)>-1)):m.images=[],b(!j)})(t)}),Object(g.jsx)("label",{htmlFor:"chkSelectAllImage",className:"fs-14 mb-0 ml-1",children:"Select All"})]})]})}),Object(g.jsx)("div",{className:"row mt-3 upload-media-row",children:r.length>0?r.map(((e,t)=>{if(""!==p&&e.split("/").pop().toLowerCase().indexOf(p)<0)return!0;const s=new URL(e).pathname.split("/").pop();return Object(g.jsx)("div",{className:"col-md-4 col-lg-3 col-xl-2 upload-media-col",children:Object(g.jsxs)("div",{className:"upload-media-repeat",children:[Object(g.jsx)("input",{type:"checkbox",className:"upload-media-checkbox",id:"image_"+t,name:"images",onChange:k("images"),value:e,checked:m.images.includes(e)}),Object(g.jsxs)("label",{htmlFor:"image_"+t,children:[Object(g.jsx)("div",{className:"col-12",children:Object(g.jsx)("img",{src:e,width:150,height:150})}),Object(g.jsx)("p",{children:s}),m.base_image===e?Object(g.jsx)("span",{children:"Main Image"}):Object(g.jsx)("button",{type:"button",className:"btn",onClick:t=>((e,t)=>{const s="base_image";u({...m,[s]:t}),b(!j)})(0,e),children:"Set as Main Image"})]})]})},Math.random())})):Object(g.jsx)("div",{className:"col-md-12",children:"No images found on AWS"})}),Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("h4",{children:"Video"})})}),Object(g.jsx)("div",{className:"row upload-media-row",children:n.length>0?n.map(((e,t)=>{if(""!==p&&e.toLowerCase().indexOf(p)<0)return!0;const s=new URL(e).pathname.split("/").pop();return Object(g.jsx)("div",{className:"col-md-4 col-lg-3 col-xl-2 upload-media-col",children:Object(g.jsxs)("div",{className:"upload-media-repeat",children:[Object(g.jsx)("input",{type:"checkbox",className:"upload-media-checkbox",id:"video_"+t,name:"video",onChange:k("video"),value:e,checked:m.video===e}),Object(g.jsx)("label",{htmlFor:"video_"+t,children:Object(g.jsxs)("div",{className:"col-12",children:[Object(g.jsx)("video",{width:150,height:150,autoPlay:!0,children:Object(g.jsx)("source",{src:e,type:"video/mp4"})}),Object(g.jsx)("p",{children:s})]})})]})},Math.random())})):Object(g.jsx)("div",{className:"col-md-12",children:"No Videos found on AWS"})})]})}),Object(g.jsxs)(li.a.Footer,{children:[Object(g.jsx)(ni.a,{variant:"primary",disabled:a,onClick:t=>{""!==e.props.index?O(!0):e.onSubmitMedia(m,"")},children:"Submit"}),Object(g.jsx)(ni.a,{variant:"primary",onClick:e=>y(),children:"Close"})]})]}),Object(g.jsxs)(li.a,{show:x,onHide:e=>O(!1),centered:!0,children:[Object(g.jsx)(li.a.Header,{closeButton:!0,children:Object(g.jsx)(li.a.Title,{children:"Apply Image To?"})}),Object(g.jsx)(li.a.Body,{children:Object(g.jsxs)("div",{className:"container-fluid",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("input",{type:"radio",name:"apply_type",value:"current-option",id:"current-option",onChange:e=>S(e)}),Object(g.jsx)("label",{htmlFor:"current-option",children:"\xa0Current Option Only"})]}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("input",{type:"radio",name:"apply_type",value:"specific",id:"apply-specific",onChange:e=>S(e)}),Object(g.jsx)("label",{htmlFor:"apply-specific",children:"\xa0By Specific Option"})]})]}),"specific"===v&&Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsx)("label",{children:"Select Option:"}),Object(g.jsxs)("select",{className:"form-control",name:"attribute_option",onChange:k("attribute_option"),value:f,children:[Object(g.jsx)("option",{value:"",children:"Select"}),c.map((e=>Object(g.jsx)("option",{value:e.option_id,children:e.attribute_name+" - "+e.option_value},Math.random())))]}),t.message("Option",f,"required",{className:"error"})]})})]})}),Object(g.jsxs)(li.a.Footer,{children:[Object(g.jsx)(ni.a,{variant:"primary",disabled:a,onClick:s=>(s=>{if(!t.allValid())return t.showMessages(),void b(!j);t.hideMessages(),b(!j),e.onSubmitMedia(m,f)})(),children:"Apply"}),Object(g.jsx)(ni.a,{variant:"primary",onClick:e=>O(!1),children:"Close"})]})]})]})};s(572),s(202);let ko={};var So=()=>{const e=Object(p.useLocation)(),t=Object(p.useParams)(),s=new URLSearchParams(e.search),n=s.get("name"),o=s.get("aid"),m=s.get("priceto"),u=s.get("pricefrom"),j=s.get("cid"),b=s.get("vendor"),h=s.get("sku"),x=s.get("page"),O=Object(p.useHistory)(),[N,f]=Object(d.useState)(!1),_=Object(d.useRef)(new ec.a),y=Object(d.useContext)(mo),w=Object(d.useRef)(),[k,S]=Object(d.useState)(!1),[C,A]=Object(d.useState)(!1),[P,D]=Object(d.useState)([]),[M,R]=Object(d.useState)([]),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)([]),[G,T]=Object(d.useState)([]),[B,z]=Object(d.useState)([]),[U,q]=Object(d.useState)([]),[H,V]=Object(d.useState)({images:[],video:[]}),[K,W]=Object(d.useState)({images:[],video:""}),[Y,Q]=Object(d.useState)(),[X,J]=Object(d.useState)(),[Z,$]=Object(d.useState)([]),[ee,te]=Object(d.useState)([]),[se,ae]=Object(d.useState)([]),[ce,re]=Object(d.useState)([]),[le,ne]=Object(d.useState)([]),[ie,oe]=Object(d.useState)(""),[de,me]=Object(d.useState)([]),[ue,je]=Object(d.useState)(),be=Object(d.useRef)([]),[pe,he]=Object(d.useState)(0),[xe,Oe]=Object(d.useState)(!1),[ge,ve]=Object(d.useState)([]),[Ne,fe]=Object(d.useState)([]),[_e,ye]=Object(d.useState)({id:0,description:"",attribute_set_id:"",name:"",sku:"",parent_sku:"",price:"",meta_title:"",meta_keywords:"",meta_description:"",weight:"",weight_unit:"lb",is_sold:0,is_gift_card:0,is_readytoship:0,qty:"",status:1,can_be_set_with:[],product_details:[],side_diamonds_size:"",side_diamonds_pieces:"",side_diamonds_weight:"",side_diamonds_weight_unit:"lb",images:[],videos:[],size_type:"",gender:"",vendor:"Harmony Jewels",product_description:""}),[we,ke]=Object(d.useState)(""),[Se,Ce]=Object(d.useState)([]),[Ae,Pe]=Object(d.useState)(!1),[De,Me]=Object(d.useState)(""),[Re,Fe]=Object(d.useState)(!1),[Ie,Ee]=Object(d.useState)([]),[Le,Ge]=Object(d.useState)([]),[Te,Be]=Object(d.useState)([]),[ze,Ue]=Object(d.useState)([]),[qe,He]=Object(d.useState)([]);console.log(ze,qe),Object(d.useEffect)((()=>{document.title=r.AddProducts,Ve(),rt(),Qe(),Ke(),void 0!==t.id?(document.title=r.EditProducts,Je()):lt()}),[t.id]),Object(d.useEffect)((()=>{Xe()}),[Le]),Object(d.useEffect)((()=>{const e=_e.product_details.map((e=>"".concat(e.label,":").concat(e.value))).join("\n");Me(e),A(!C)}),[_e]);const Ve=()=>{a.getApi(c.GetCountryList).then((e=>{try{Ee(e.data.result)}catch(t){console.error(t)}}))},Ke=()=>{a.postApi(c.GetProductSizeCategoryList).then((e=>{if(!0===e.data.status){const t=e.data.result[0];me(t),A(!C)}}))},We=(e,t)=>{const s=t.toLowerCase();return e.map((e=>{const t=e.label.toLowerCase().includes(s);let a=null;return e.children&&(a=We(e.children,s)),t||null!==a&&a.length>0?{...e,children:a}:null})).filter((e=>null!==e))},Ye=We(M,we),Qe=()=>{a.postApi(c.GetShapeAttributeOptions,null).then((e=>{ve(e.data.result)}))},Xe=()=>{if(0!==Ie.length){const e=Ie.filter((e=>Le.includes(e.id)));Be(e)}},Je=()=>{const e={id:t.id};f(!0),a.postApi(c.GetAdminProductDetail,e).then((async e=>{var t;const s=e.data.result[0][0];if(void 0!==e.data.result[4][0]){const t=e.data.result[4][0].standalone_attributes;console.log(t),Ue(t)}$e(s.sku);const a=s.countryIds;Ge(a),ct(s.attribute_set_id),null!==i.GetJSON(e.data.result[1][0].related_products)&&i.GetJSON(e.data.result[1][0].related_products).length>0&&q(e.data.result[1][0].related_products);const c=[];e.data.result[2].map(((e,t)=>{c.push(e);let s=e.attributes;s=[...new Map(s.map((e=>[e.option_id,e]))).values()];let a=e.product_attribute_values;a=[...new Map(a.map((e=>[e.option_id,e]))).values()];const r=a.map((e=>e.option_id)),l=r.join("_");return c[t].id=l,c[t].attributes=s,c[t].product_attribute_values=a,!0}));const r=c.length>0?null===(t=c[0])||void 0===t?void 0:t.category_ids:[];""!==r&&null!==r&&r.length>0?($(r.split(",").map(String)),lt(r.split(",").map(Number))):($(r),lt(r));const l=[],n=[],o=[],d=[];c.length>0&&c.map(((e,t)=>{if(0===t&&e.attributes.filter((e=>0===e.is_standalone)).map((e=>(l.filter((t=>t.attribute_code===e.attribute_code)).length<1&&l.push({attribute_code:e.attribute_code,attribute_name:e.attribute_name}),!0))),e.attributes.map((t=>(t.sku=e.sku,t.price=e.price,t.base_image=e.base_image,t.other_images=e.other_images,t.video=e.video,(n.length<1||n.filter((e=>e.attribute_id===t.attribute_id&&e.option_id===t.option_id)).length<1)&&n.push(t),!0))),null!==e.other_image&&e.other_image.length>0&&e.other_image.map((e=>{const t=e.split("/").pop();return o.filter((t=>t.image===e)).length<1&&o.push({name:t,image:e}),!0})),null!==e.video&&""!==e.video&&d.filter((t=>t.video===e.video)).length<1){const t=e.video.split("/").pop();d.push({name:t,video:e.video})}return!0}));if(s.images=o,s.videos=d,ye(s),e.data.result[3].length>0){const t=e.data.result[3][0].selected_attributes.filter((e=>0===e.is_standalone)),s=e.data.result[3][0].selected_attributes.filter((e=>1===e.is_standalone)),a=[];s.map((e=>{const t=Object.keys(e),s="is_standalone"!==t[0]?t[0]:t[1];return a[s]=e[s],!0})),He(a);const c=[];t.map((e=>{const t=Object.keys(e);return c[t[0]]=e[t[0]],!0})),ne(c)}let m={};n.map(((e,t)=>{const s=n.filter((t=>t.attribute_code===e.attribute_code)).map((e=>e.option_id));return m[e.attribute_code]=s,!0}));const u=Object.keys(m);u.sort();let j=u[0];void 0!==s.variation_group_by_property&&null!==s.variation_group_by_property&&""!==s.variation_group_by_property&&u.indexOf(s.variation_group_by_property)>-1&&(j=s.variation_group_by_property),m=i.groupByProperty(c,j),te(m),ae(n),re(l),n.length>0&&(n.filter((e=>e.attribute_code===j)).length>0?(st(j),oe(j)):(st(n[0].attribute_code),oe(n[0].attribute_code))),f(!1)}))},Ze=e=>{const t=e.target.name,s=e.target.value;"status"===t||"is_sold"===t||"view_360"===t||"is_gift_card"===t||"is_readytoship"===t?ye({..._e,[t]:e.target.checked}):"attribute_set_id"===t?(ye({..._e,[t]:s}),ct(s)):ye("vendor"===t?{..._e,[t]:s}:{..._e,[t]:s}),A(!C)},$e=e=>{const t={sku:e};a.postApi(c.FetchProductMedia,t).then((e=>{V(e.data.result)}))},et=(e,t,s,a)=>{let c=se.filter((e=>e.attribute_code!==t));e.map((e=>(c.push({attribute_code:t,attribute_name:a,attribute_id:s,option_id:e.id,option_value:e.name}),!0)));const r={...qe};delete r[t];const l=ze.filter((e=>e.attribute_code!==t));Ue(l),He(r),ae(c),ne({...le,[t]:e}),c=tt(c);let n=[];Object.values(c).length>1?Object.values(c).map((e=>(e.map((e=>(n.push(e),!0))),!0))):n=Object.values(c)[0];let o=ie;void 0!==n?(""===o&&(o=n[0].attributes[0].attribute_code,oe(o)),i.isGroupByPropertyExist(n,o)||(o=n[0].attributes[0].attribute_code,oe(o)),n=i.groupByProperty(n,o),te(n),ko=n):(te({}),ko={})},tt=e=>{let t={};e.map(((s,a)=>{const c=e.filter((e=>e.attribute_code===s.attribute_code)).map((e=>e.option_id));return t[s.attribute_code]=c,!0}));const s=i.generateCombination(t);t=[];const a=[];s.map(((s,c)=>{var r,l;const n=Object.keys(s),o=[],d=[];n.map((t=>{const c=e.filter((e=>e.attribute_code===t)).length>0?e.filter((e=>e.attribute_code===t))[0].attribute_name:"",r=e.filter((e=>e.attribute_code===t&&e.option_id===s[t])).length>0?e.filter((e=>e.attribute_code===t&&e.option_id===s[t]))[0].option_value:"",l=e.filter((e=>e.attribute_code===t&&e.option_id===s[t])).length>0?e.filter((e=>e.attribute_code===t&&e.option_id===s[t]))[0].option_id:"",n=e.filter((e=>e.attribute_code===t&&e.option_id===s[t])).length>0?e.filter((e=>e.attribute_code===t&&e.option_id===s[t]))[0].attribute_id:"",i=e.filter((e=>e.attribute_code===t&&e.option_id===s[t])).length>0?e.filter((e=>e.attribute_code===t&&e.option_id===s[t]))[0].attribute_name:"";return o.push({option_name:c,option_value:r,option_id:l,attribute_id:n,attribute_code:t,attribute_name:i,option_ids:e.filter((e=>e.attribute_code===t)).map((e=>e.option_id))}),d.push({attribute_id:n,option_id:l}),a.filter((e=>e.attribute_code===t)).length<1&&a.push({attribute_code:t,attribute_name:c}),!0}));const m=d.map((e=>e.option_id)).map(Number),u=m.join("_"),j=[];Object.values(ko).length>0&&Object.values(ko).map((e=>(e.map((e=>(j.push(e),!0))),!0)));const b=s[ie],p=(null===(r=Object.keys(ko))||void 0===r?void 0:r.length)>0&&(null===(l=ko[b])||void 0===l?void 0:l.length)>0?ko[b][0].price:0,h=i.generateRandomString(4);return t.push({id:u,attributes:o,product_attribute_values:d,sku:_e.sku+"-"+h,model_number:j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e))))).length>0?j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e)))))[0].model_number:"",price:j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e))))).length>0?j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e)))))[0].price:p,base_image:j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e))))).length>0?j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e)))))[0].base_image:"",other_images:j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e))))).length>0?j.filter((e=>e.id.split("_").map(Number).every((e=>m.includes(e)))))[0].other_images:[]}),!0})),re(a);const c=Object.keys(s[0])[0];return t=i.groupByProperty(t,c),t},st=e=>{let t=[];Object.values(ko).length>1?Object.values(ko).map((e=>(e.map((e=>(t.push(e),!0))),!0))):t=Object.values(ko)[0],t=i.groupByProperty(t,e),te(t),ko=t},at=(e,t,s)=>{var a,c;Q(s),s=""===s?0:s;const r=void 0!==ko[t][s].other_images?ko[t][s].other_images:[],l=null!==(a=ko[t][s].base_image)&&void 0!==a?a:"";""!==l&&r.push(l),W({base_image:l,images:r,video:null!==(c=ko[t][s].video)&&void 0!==c?c:""}),S(!0),je(ko[t][s].attributes),J(t)},ct=e=>{if(""!==e){const t={set_id:e};a.postApi(c.GetAttributesBySetList,t).then((e=>{const t=e.data.result[0],s=[];return t.map((e=>("dropdown"!==e.input_type&&"radio"!==e.input_type&&"range_slider"!==e.input_type&&"text_swatch"!==e.input_type||s.push({attribute_id:e.attribute_id,attribute_code:e.attribute_code,attribute_name:e.attribute_name,options:e.attribute_option}),!0))),I(s),L(t.filter((e=>"text"===e.input_type))),A(!C),s}))}},rt=()=>{a.getApi(c.GetProductAttributeSetList).then((e=>{D(e.data.result[0].filter((e=>1===e.status))),A(!C)}))},lt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a.postApi(c.GetCategory,null).then((t=>{if(t.data.result){const s=[],a=c=>t.data.result[0].filter((e=>e.parent_id===c&&e.status)).map((t=>{const c=a(t.id);0===c.length&&s.push(t.id);const r=c.length>0&&c.every((e=>e.checked))||e.includes(t.id);return{label:t.name,value:t.id,checked:r,children:c}})),c=a(1);R(c);const r=e.filter((e=>s.includes(e)));$(r)}}))};Object(d.useEffect)((()=>{ko=ee}),[ee]);const nt=e=>async t=>{t.preventDefault();const s=ee;if("sku"===t.target.name)s[e].map((e=>e.sku=t.target.value));else if("price"===t.target.name)s[e].map((e=>e.price=t.target.value));else if("image"===t.target.name){be.current[e].src=URL.createObjectURL(t.target.files[0]);const a=await new Promise(((e,s)=>{ao(t.target.files[0],(t=>{e(t)}))}));s[e].map((e=>e.image=a))}te(s),ko=s,A(!C)},it=(e,t)=>async s=>{s.preventDefault();let a=s.target.value;"image"===s.target.name&&(a=await new Promise(((e,t)=>{ao(s.target.files[0],(t=>{e(t)}))})));const c=ee;c[e][t][s.target.name]=a,te(c),ko=c},ot=e=>t=>{t.preventDefault();let s=_e.can_be_set_with;s=s.filter((function(t,s){return s!==e}));const a="can_be_set_with";ye({..._e,[a]:s}),A(!C)},dt=e=>t=>{t.preventDefault();const s=_e.can_be_set_with;s[e]={...s[e],[t.target.name]:t.target.value};const a="can_be_set_with";ye({..._e,[a]:s}),A(!C)};window.addEventListener("fileUploadWithPreview:imagesAdded",(async function(e){e.preventDefault();const t=e.detail;if(f(!0),"productImages"===t.uploadId){const e=[],s=t.cachedFileArray.map((async t=>{const s=t.type;if("image/jpeg"===s||"image/jpg"===s||"image/png"===s){const s=await new Promise(((e,s)=>{ao(t,(t=>{e(t)}))})),a=t.name.includes(":")?t.name.split(":")[0]:t.name;return e.push({name:a,image:s}),s}}));await Promise.all(s),f(!1);const a="images";ye({..._e,[a]:e})}})),window.addEventListener("fileUploadWithPreview:imageDeleted",(async function(e){e.preventDefault();const t=e.detail;if(f(!0),"productImages"===t.uploadId){const e=[],s=t.cachedFileArray.map((async t=>{const s=t.type;if("image/jpeg"===s||"image/jpg"===s||"image/png"===s){const s=await new Promise(((e,s)=>{ao(t,(t=>{e(t)}))})),a=t.name.includes(":")?t.name.split(":")[0]:t.name;return e.push({name:a,image:s}),s}}));await Promise.all(s),f(!1);const a="images";ye({..._e,[a]:e}),A(!C)}}));const mt=(e,t,s,a)=>{const c=ze.filter((e=>e.attribute_code!==t));e.map((e=>(c.push({attribute_code:t,attribute_name:a,attribute_id:s,option_id:e.id,option_value:e.name}),!0))),Ue(c),He({...qe,[t]:e})},ut=e=>t=>{t.preventDefault();let s=_e.product_details;s=s.filter((function(t,s){return s!==e}));const a="product_details";ye({..._e,[a]:s}),A(!C)},jt=e=>t=>{t.preventDefault();const s=_e.product_details;s[e]={...s[e],[t.target.name]:t.target.value};const a="product_details";ye({..._e,[a]:s}),A(!C)},bt=(e,t,s,a)=>{e.preventDefault();const c=ko;c[t][a].isdisable=1===c[t][a].isdisable?0:1,ko=c,A(!C)},pt=e=>{38!==e.keyCode&&40!==e.keyCode||e.preventDefault()},ht=()=>{O.push("/products",{state:{page:0===parseInt(x)?1:parseInt(x),name:n,sku:h,attribute_set_id:o,priceTo:m,priceFrom:u,categoryIds:j,vendor:b}})},xt=e=>{Be(e),Ge(e.map((e=>e.id)))};return Object(g.jsxs)(g.Fragment,{children:[N&&Object(g.jsx)(v,{}),Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==t.id?r.EditProducts:r.AddProducts," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:ht,children:[" ","Back"," "]})})]}),Object.keys(Ne).length>0&&Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsxs)("div",{className:"alert alert-danger w-100",role:"alert",children:[Object(g.jsx)("h5",{children:"Product have below errors:"}),Object.keys(Ne).map((e=>Object(g.jsxs)("p",{className:"mb-1",children:[Object(g.jsx)("b",{children:e})," : ",Ne[e]]},Math.random())))]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Attribute Set"}),Object(g.jsxs)("select",{className:"form-control custom-select",name:"attribute_set_id",value:_e.attribute_set_id,onChange:Ze,children:[Object(g.jsx)("option",{value:"",children:"--Select--"}),P.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]}),_.current.message("Attribute Set",_e.attribute_set_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Product Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:Ze,defaultValue:_e.name,placeholder:"Name"}),_.current.message("Name",_e.name,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"SKU"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"sku",onChange:Ze,onBlur:e=>{if(""!==e.target.value.trim()){const s={sku:e.target.value,id:void 0!==t.id?t.id:0};a.postApi(c.ValidateProductSku,s).then((t=>{t.data.result[0].total_sku>0?Oe(!0):(Oe(!1),$e(e.target.value))}))}},defaultValue:_e.sku,placeholder:"SKU"}),xe&&Object(g.jsx)("div",{className:"error",children:l.SkuAlreadyExists}),_.current.message("SKU",_e.sku,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),Object(g.jsxs)("div",{className:"custom-dropdown text-left",children:[Object(g.jsx)("button",{type:"button",className:Ae||"text-left form-control custom-select",onClick:()=>{Pe(Ae?"":"text-left form-control custom-select show")},children:"Select Category"}),Object(g.jsxs)("div",{className:"dropdown-menu",children:[Object(g.jsx)("input",{className:"form-control m-1",placeholder:"Search...",type:"text",value:we,onChange:e=>{ke(e.target.value.toLowerCase())}}),Object(g.jsx)(_o.a,{checked:Z,expandOnClick:!0,expanded:Se,nodes:Ye,onCheck:e=>{$(e)},onExpand:e=>{Ce(e)},icons:{parentClose:null,parentOpen:null,leaf:null}}),_.current.message("Category",Z,"required",{className:"error"})]})]})]})}),Object(g.jsx)("div",{className:_e.is_gift_card?"d-none":"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Weight"}),Object(g.jsx)("div",{className:"d-flex align-items-center",children:Object(g.jsx)("input",{type:"number",className:"form-control",name:"weight",min:"0.1",onChange:Ze,defaultValue:_e.weight,placeholder:"Weight"})})]})}),Object(g.jsx)("div",{className:"col-md-1",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is Sold"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_sold",onChange:Ze,id:"is_sold",checked:_e.is_sold}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_sold",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-1",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername3",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:Ze,id:"status",checked:_e.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"status",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-1",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is RTS"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_readytoship",onChange:Ze,id:"is_readytoship",checked:_e.is_readytoship}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_readytoship",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-2",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is Gift Card"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_gift_card",onChange:Ze,id:"is_gift_card",checked:_e.is_gift_card}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_gift_card",children:" "})]})})]})})]}),Object(g.jsxs)("div",{id:"accordion",className:"custom-accordion",children:[Object(g.jsxs)("div",{className:"card shadow-none border-top border-bottom",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Content"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseOne",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("textarea",{name:"description",className:"form-control",onChange:Ze,defaultValue:_e.description,id:"",rows:"6",placeholder:"Description"})]})})})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#product_size","aria-expanded":"true","aria-controls":"product_size",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Product Size"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"product_size",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Country"}),Object(g.jsx)(_i.a,{onSelect:e=>xt(e),onRemove:e=>xt(e),options:Ie,selectedValues:Te,displayValue:"name"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Size Type"}),Object(g.jsxs)("select",{className:"form-control custom-select",name:"size_type",value:_e.size_type,onChange:Ze,children:[Object(g.jsx)("option",{value:"",children:"-- Select --"}),de.map((e=>Object(g.jsx)("option",{value:e.type,children:e.type},Math.random())))]})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Gender"}),Object(g.jsxs)("select",{className:"form-control custom-select",name:"gender",value:_e.gender,onChange:Ze,children:[Object(g.jsx)("option",{value:"",children:"-- Select --"}),Object(g.jsx)("option",{value:"1",children:"Male"}),Object(g.jsx)("option",{value:"2",children:"Female"}),Object(g.jsx)("option",{value:"3",children:"Unisex"})]})]})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#product_details","aria-expanded":"true","aria-controls":"product_details",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Product Details"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"product_details",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsxs)("div",{className:"card-body p-3 pt-0 font-dark",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Product Description"}),Object(g.jsx)("textarea",{name:"product_description",className:"form-control",onChange:Ze,defaultValue:_e.product_description,id:"",rows:"4",placeholder:"Product Description"})]})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-3 order-lg-2",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-md-9 text-right",children:[!Re&&Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white",onClick:e=>(e=>{e.preventDefault();const t=_e.product_details;t.push({label:"",value:""});const s="product_details";ye({..._e,[s]:t}),A(!C)})(e),children:"+ Add New"}),Re&&Object(g.jsx)("button",{type:"button",onClick:e=>(()=>{const e=De.split("\n"),t=[..._e.product_details];e.forEach((e=>{const[s,a]=e.split(":").map((e=>e.trim()));if(s&&a){const e=t.findIndex((e=>e.label.toLowerCase()===s.toLowerCase()));-1!==e?t[e].value=a:t.push({label:s,value:a})}})),ye({..._e,product_details:t}),Fe(!1),Me(""),A(!C)})(),className:"btn btn-custom text-white",children:"Apply"})]}),Object(g.jsx)("div",{className:"col-md-3 text-right",children:Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white p-2",onClick:()=>{Fe(!Re)},children:Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})})})]})}),Object(g.jsxs)("div",{className:"col-md-9 order-lg-1",children:[Object(g.jsx)("div",{className:"row",children:Re&&Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsx)("div",{children:Object(g.jsx)("textarea",{className:"form-control pd-textarea",value:De,onChange:e=>(e=>{Me(e.target.value)})(e),rows:"8",placeholder:"Enter label:value pairs\r (e.g. height:3)"})})})}),Object(g.jsx)("div",{className:"row",children:!Re&&null!==_e.product_details&&_e.product_details.map(((e,t)=>Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"_label_"+t,children:"Label"}),Object(g.jsx)("input",{type:"text",name:"label",className:"form-control",id:"_label_"+t,value:e.label,onChange:jt(t)}),_.current.message("label",e.label,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"_value_"+t,children:"Value"}),Object(g.jsx)("input",{type:"text",name:"value",className:"form-control",id:"_value_"+t,value:e.value,onChange:jt(t)}),_.current.message("Value",e.value,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-auto pr-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block mt-4 w-48",onClick:ut(t),children:"X"})})]})))})]})]})]})})]}),F.length>0&&""!==_e.sku&&Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseTwo","aria-expanded":"true","aria-controls":"collapseTwo",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Configurations"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseTwo",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsxs)("div",{className:"card-body p-3 pt-0 font-dark",children:[Object(g.jsx)("div",{className:"row mb-3",children:Object(g.jsx)("div",{className:"col-md-9",style:{fontSize:"14px"},children:"Configurable products allow customers to choose options (Ex: 14K White Gold). You need to create a simple product for each configuration (Ex: a product for each quality)."})}),Object(g.jsx)("div",{className:"row my-2",children:F.map((e=>Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("div",{className:"mb-1 d-flex align-items-center",children:[Object(g.jsx)("label",{className:"mb-0",children:e.attribute_name}),Object(g.jsx)("small",{className:"note ml-1 mt-0 pt-0",children:" ("+e.attribute_code+")"}),Object(g.jsx)("a",{className:"pointer ml-auto float-right fs-14 custom-color",onClick:t=>(e=>{const t=F.filter((t=>t.attribute_code===e));let s=se.filter((t=>t.attribute_code!==e));t[0].options.map((a=>(s.push({attribute_code:e,attribute_name:t[0].attribute_name,attribute_id:t[0].attribute_id,option_id:a.id,option_value:a.name}),!0))),ae(s),ne({...le,[e]:t[0].options}),s=tt(s);let a=[];Object.values(s).length>1?Object.values(s).map((e=>(e.map((e=>(a.push(e),!0))),!0))):a=Object.values(s)[0];const c=a[0].attributes[0].attribute_code;oe(c),a=i.groupByProperty(a,c),Object.values(a).length>0&&(te(a),ko=a,A(!C))})(e.attribute_code),children:"Select All"})]}),Object(g.jsx)(_i.a,{onSelect:t=>et(t,e.attribute_code,e.attribute_id,e.attribute_name),onRemove:t=>et(t,e.attribute_code,e.attribute_id,e.attribute_name),options:e.options,selectedValues:le[e.attribute_code],displayValue:"name"})]})},Math.random())))}),Object(g.jsxs)("div",{className:"row mt-2 mb-4 align-items-center",children:[Object(g.jsx)("div",{className:"col-auto form-group mb-0",children:Object(g.jsx)("label",{htmlFor:"group_by",children:"Group By"})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsx)("select",{className:"form-control custom-select",name:"group_by",onChange:e=>{oe(e.target.value),st(e.target.value),A(!C)},value:ie,children:ce.map((e=>Object(g.jsx)("option",{value:e.attribute_code,children:e.attribute_name},Math.random())))})})]}),Object(g.jsxs)("div",{className:"table-responsive",children:[Object(g.jsx)("table",{className:"table table-configuration",children:Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-center",style:{width:"30%"},children:"Variant"}),Object(g.jsx)("th",{className:"text-center",style:{width:"20%"},children:"Price"}),Object(g.jsx)("th",{className:"text-center",style:{width:"20%"},children:"System SKU"}),Object(g.jsx)("td",{})]})})}),Object(g.jsx)(so.a,{activeKey:pe,onSelect:e=>he(e),className:"custom-product-accordion",children:Object.keys(ee).map(((e,t)=>{var s,a,c,r,l,n,o,d,m,u;return Object(g.jsx)(g.Fragment,{children:void 0!==ko&&void 0!==ko[e]&&ko[e].length>0&&Object(g.jsxs)(so.a.Item,{eventKey:e,children:[Object(g.jsx)(so.a.Header,{children:Object(g.jsx)("div",{className:"accordion-header-div",onClick:()=>{var e;he((e="0")===pe?null:e)},children:Object(g.jsx)("table",{className:"table","data-index":t,children:Object(g.jsx)("tbody",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{style:{width:"30%"},children:Object(g.jsxs)("div",{className:"d-flex justify-content-center variant-image-label",children:[Object(g.jsx)("img",{className:"variant_img pointer",onClick:t=>at(0,e,""),src:null!==(null===(s=ko[e][0])||void 0===s?void 0:s.base_image)&&""!==(null===(a=ko[e][0])||void 0===a?void 0:a.base_image)&&void 0!==(null===(c=ko[e][0])||void 0===c?void 0:c.base_image)?null===(r=ko[e][0])||void 0===r?void 0:r.base_image:i.setImage("assets/images/default.png")}),Object(g.jsxs)("div",{className:"ml-2 text-left variant-count-label",children:[void 0!==ko[e][t]?(null===(l=ko[e][t])||void 0===l?void 0:l.attributes.filter((e=>e.attribute_code===ie)).length)>0&&Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("h6",{children:null===(n=ko[e][t])||void 0===n?void 0:n.attributes.filter((e=>e.attribute_code===ie))[0].option_value})}):(null===(o=ko[e][0])||void 0===o?void 0:o.attributes.filter((e=>e.attribute_code===ie)).length)>0&&Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("h6",{children:null===(d=ko[e][0])||void 0===d?void 0:d.attributes.filter((e=>e.attribute_code===ie))[0].option_value})}),ee[e].length+" variants"," ",Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12"})]})]})}),Object(g.jsx)("td",{style:{width:"20%"},children:Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text form-control text-dark bg-white pr-1 pt-3",children:"$"})}),Object(g.jsx)("input",{type:"number",name:"price",className:"border-left-0 pl-0 border form-control",defaultValue:null!==(m=ko[e][0])&&void 0!==m&&m.price?null===(u=ko[e][0])||void 0===u?void 0:u.price:0,min:0,onClick:e=>e.stopPropagation(),onChange:nt(e),onWheel:e=>e.target.blur(),onKeyDown:e=>pt(e)})]})}),Object(g.jsx)("td",{style:{width:"20%"}}),Object(g.jsx)("td",{})]})})})})}),Object(g.jsx)(so.a.Body,{children:Object(g.jsx)("table",{className:"table",children:Object(g.jsx)("tbody",{children:ee[e].map(((t,s)=>{var a,c,r,l,n,o,d,m,u,j,b,p,h;return Object(g.jsxs)("tr",{"data-toggle":"collapse",className:"accordion-toggle","data-target":"#attribute_option_"+e,children:[Object(g.jsx)("td",{className:"text-center",style:{width:"30%"},children:Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{className:"d-flex justify-content-center variant-image-label",children:[Object(g.jsx)("img",{className:"variant_img pointer",onClick:t=>at(0,e,s),src:null!==(null===(a=ko[e][s])||void 0===a?void 0:a.base_image)&&""!==(null===(c=ko[e][s])||void 0===c?void 0:c.base_image)&&void 0!==(null===(r=ko[e][s])||void 0===r?void 0:r.base_image)?null===(l=ko[e][s])||void 0===l?void 0:l.base_image:i.setImage("assets/images/default.png")}),Object(g.jsx)("div",{className:"ml-2 text-left variant-count-label",children:Object(g.jsx)("h6",{className:"demo pl-3 fs-14",children:(null===(n=ko[e][s])||void 0===n?void 0:n.attributes.length)>1?[...new Set(null===(o=ko[e][s])||void 0===o?void 0:o.attributes.filter((e=>e.attribute_code!==ie)).map((e=>e.option_value)))].join("/"):[...new Set(null===(d=ko[e][s])||void 0===d?void 0:d.attributes.map((e=>e.option_value)))].join("/")})})]}),Object(g.jsx)("input",{type:"file",accept:"image/*",id:"variant_image_"+e+"_"+s,name:"image",onChange:it(e,s)})]})}),Object(g.jsxs)("td",{style:{width:"20%"},children:[Object(g.jsxs)("div",{className:"input-group",children:[Object(g.jsx)("div",{className:"input-group-prepend",children:Object(g.jsx)("span",{className:"input-group-text form-control text-dark bg-white pr-1 pt-3",children:"$"})}),Object(g.jsx)("input",{type:"number",name:"price",className:"border-left-0 pl-0 border form-control",defaultValue:null!==(m=ko[e][s])&&void 0!==m&&m.price?null===(u=ko[e][s])||void 0===u?void 0:u.price:0,min:0,onChange:it(e,s),onWheel:e=>e.target.blur(),onKeyDown:e=>pt(e)})]}),_.current.message("Price",null===(j=ko[e][s])||void 0===j?void 0:j.price,"required",{className:"error"})]}),Object(g.jsxs)("td",{style:{width:"20%"},children:[Object(g.jsx)("input",{type:"text",name:"sku",disabled:!0,className:"form-control",defaultValue:null===(b=ko[e][s])||void 0===b?void 0:b.sku,onChange:it(e,s)}),_.current.message("Child SKU",null===(p=ko[e][s])||void 0===p?void 0:p.sku,"required|not_in:".concat(_e.sku),{className:"error",messages:{not_in:"Child product SKU should not be the same as main SKU."}})]}),Object(g.jsx)("td",{children:1===(null===(h=ko[e][s])||void 0===h?void 0:h.isdisable)?Object(g.jsx)("button",{type:"button",className:"btn btn-success",onClick:t=>{var a;return bt(t,e,null===(a=ko[e][s])||void 0===a||a.id,s)},children:"undo"}):Object(g.jsx)("button",{type:"button",className:"btn btn-danger",onClick:t=>{var a;return bt(t,e,null===(a=ko[e][s])||void 0===a||a.id,s)},children:Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})})})]},Math.random())}))})})})]},e)})}))})]})]})})]}),F.length>0&&""!==_e.sku&&Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#standalone_attributes","aria-expanded":"true","aria-controls":"standalone_attributes",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Standalone Attribute"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"standalone_attributes",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsx)("div",{className:"row my-2",children:F.filter((e=>!ce.some((t=>t.attribute_code===e.attribute_code)))).map((e=>Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("div",{className:"mb-1 d-flex align-items-center",children:[Object(g.jsx)("label",{className:"mb-0",children:e.attribute_name}),Object(g.jsx)("small",{className:"note ml-1 mt-0 pt-0",children:" ("+e.attribute_code+")"}),Object(g.jsx)("a",{className:"pointer ml-auto float-right fs-14 custom-color",onClick:t=>(e=>{const t=F.filter((t=>t.attribute_code===e)),s=ze.filter((t=>t.attribute_code!==e));t[0].options.map((a=>(s.push({attribute_code:e,attribute_name:t[0].attribute_name,attribute_id:t[0].attribute_id,option_id:a.id,option_value:a.name}),!0))),Ue(s),He({...qe,[e]:t[0].options})})(e.attribute_code),children:"Select All"})]}),Object(g.jsx)(_i.a,{onSelect:t=>mt(t,e.attribute_code,e.attribute_id,e.attribute_name),onRemove:t=>mt(t,e.attribute_code,e.attribute_id,e.attribute_name),options:e.options,selectedValues:qe[e.attribute_code],displayValue:"name"})]})},Math.random())))})})})]}),E.length>0&&Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseThird","aria-expanded":"true","aria-controls":"collapseThird",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Attributes"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseThird",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:E.map(((e,t)=>Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"attribute_"+e.attribute_id,children:e.attribute_name}),Object(g.jsx)("input",{type:"text",name:e.attribute_code,onChange:e=>((e,t)=>{e.preventDefault();const s=E;s[t].attribute_value=e.target.value,L(s)})(e,t),defaultValue:e.attribute_value,id:"attribute_"+e.attribute_id,className:"form-control"})]})})},Math.random())))})})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseFifth","aria-expanded":"true","aria-controls":"collapseFifth",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Search Engine Optimization"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseFifth",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"meta_title",onChange:Ze,defaultValue:_e.meta_title,placeholder:"Meta Title"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Keywords"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"meta_keywords",onChange:Ze,defaultValue:_e.meta_keywords,placeholder:"Meta Keywords"})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Description"}),Object(g.jsx)("textarea",{name:"meta_description",className:"form-control",onChange:Ze,defaultValue:_e.meta_description,id:"",rows:"3",placeholder:"Meta Description"})]})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom overflow-initial mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseSix","aria-expanded":"true","aria-controls":"collapseSix",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Related Products"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseSix",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Related products are shown to customers in addition to the item the customer is looking at."}),Object(g.jsx)(Di.ReactTags,{selected:U,suggestions:B,onDelete:e=>{const t=U.slice(0);t.splice(e,1),q(t),T(t.map((e=>e.value))),A(!C)},onAdd:e=>{const t=[...U,e];q(t),T(t.map((e=>e.value))),A(!C)},onInput:e=>{if(void 0===e||e.trim().length<3)return z();new Promise((t=>{const s={term:e};a.postApi(c.SearchProducts,s).then((e=>{let s=[];s=e.data.result.length>0?e.data.result.map((e=>({value:e.id,label:e.name+" - "+e.sku}))):[],z(s),A(!C),t(s)}))}))},placeholderText:"Enter SKU or Product Name"})]})})})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#can_be_set_with","aria-expanded":"true","aria-controls":"can_be_set_with",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Can Be Set With"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"can_be_set_with",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-2 order-lg-2",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12 text-right",children:Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white",onClick:e=>(e=>{e.preventDefault();const t=_e.can_be_set_with;t.push({shape:"",carat_from:"",carat_to:""});const s="can_be_set_with";ye({..._e,[s]:t}),A(!C)})(e),children:"+ Add New"})})})}),Object(g.jsx)("div",{className:"col-md-10 order-lg-1",children:Object(g.jsx)("div",{className:"row",children:_e.can_be_set_with.map(((e,t)=>Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"shape_"+t,children:"Shape"}),Object(g.jsxs)("select",{className:"form-control custom-select",name:"shape",id:"shape_"+t,onChange:dt(t),value:e.shape,children:[Object(g.jsx)("option",{value:"",children:"Select"}),ge.map((e=>Object(g.jsx)("option",{value:e.value,disabled:_e.can_be_set_with.filter((t=>t.shape===e.value)).length>0,children:e.value},Math.random())))]})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"carat_from_"+t,children:"Carat From"}),Object(g.jsx)("input",{type:"number",name:"carat_from",className:"form-control",id:"carat_from_"+t,value:e.carat_from,onChange:dt(t),min:.1,step:"0.1"}),_.current.message("Carat From",e.carat_from,"numeric|min:0.1,num",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"carat_to_"+t,children:"Carat To"}),Object(g.jsx)("input",{type:"number",name:"carat_to",className:"form-control",id:"carat_to_"+t,value:e.carat_to,onChange:dt(t),min:.1,step:"0.1"}),_.current.message("Carat To",e.carat_to,"numeric|min:0.1,num",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-auto pr-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block mt-4 w-48",onClick:ot(t),children:"X"})})]})))})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2 d-none",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#side_diamonds","aria-expanded":"true","aria-controls":"side_diamonds",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Side Diamond Details"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"side_diamonds",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"side_diamonds_size",children:"Diamond Size"}),Object(g.jsx)("input",{type:"text",name:"side_diamonds_size",className:"form-control",id:"side_diamonds_size",value:_e.side_diamonds_size,onChange:Ze})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"side_diamonds_pieces",children:"Diamond Pieces"}),Object(g.jsx)("input",{type:"number",name:"side_diamonds_pieces",className:"form-control",id:"side_diamonds_pieces",value:_e.side_diamonds_pieces,onChange:Ze,min:0})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"side_diamonds_weight",children:"Diamond Weight"}),Object(g.jsx)("div",{className:"d-flex align-items-center",children:Object(g.jsx)("input",{type:"number",name:"side_diamonds_weight",className:"form-control",id:"side_diamonds_weight",value:_e.side_diamonds_weight,onChange:Ze,min:0,step:"0.1"})})]})})]})})})]})]}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("button",{type:"button",onClick:e=>{if(!_.current.allValid()){const e=[];return Object.keys(_.current.errorMessages).map((t=>(null!==_.current.errorMessages[t]&&(e[t]=_.current.errorMessages[t]),!0))),fe(e),window.scrollTo({top:0,behavior:"smooth"}),void A(!C)}fe({});const s={id:_e.id,attribute_set_id:_e.attribute_set_id,is_configured:ko.length>0?1:0,parent_product_id:ko.length>0?0:_e.parent_product_id,description:_e.description,is_sold:!0===_e.is_sold||"1"===_e.is_sold?1:0,is_gift_card:!0===_e.is_gift_card||"1"===_e.is_gift_card?1:0,is_readytoship:!0===_e.is_readytoship||"1"===_e.is_readytoship?1:0,meta_description:_e.meta_description,meta_keywords:_e.meta_keywords,meta_title:_e.meta_title,name:_e.name,parent_sku:_e.parent_sku,sku:_e.sku,status:!0===_e.status||1===parseInt(_e.status)?1:0,weight:null!==_e.weight&&""!==_e.weight?parseFloat(_e.weight).toFixed(2):0,weight_unit:_e.weight_unit,Userid:y.id,attribute_options:ko,category_id:Z,related_products:G,can_be_set_with:_e.can_be_set_with,can_be_set_with_shape:_e.can_be_set_with.length>0?_e.can_be_set_with.map((e=>e.shape)):[],side_diamonds_size:_e.side_diamonds_size,side_diamonds_pieces:_e.side_diamonds_pieces,side_diamonds_weight:_e.side_diamonds_weight,side_diamonds_weight_unit:_e.side_diamonds_weight_unit,images:_e.images,videos:_e.videos,variation_group_by_property:ie,product_details:_e.product_details.length>0?_e.product_details:[],size_type:_e.size_type,gender:""===_e.gender?0:_e.gender,vendor:_e.vendor,countryids:JSON.stringify(Le).replaceAll("[","").replaceAll("]",""),standalone_attributes:0!==ze.length?ze:[],product_description:_e.product_description};f(!0),w.current&&w.current.setAttribute("disabled","disabled"),a.postApi(c.SetProducts,s).then((e=>{var s;f(!1),w.current.removeAttribute("disabled"),Array.isArray(e.data.result)?(sc()({title:l.oops,content:(s=e.data.result,Object(g.jsxs)("div",{children:[Object(g.jsx)("p",{children:Object(g.jsx)("b",{children:"Below product images not uploaded!"})}),s.map(((e,t)=>Object(g.jsx)("p",{className:"mb-1",children:e},Math.random())))]})),icon:"error",buttons:{cancel:!0,confirm:!1}}),A(!C)):e.data.result.message?gl.b.error(e.data.result.message):(void 0===t.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),A(!C),O.push("/products",{state:{page:0===parseInt(x)?1:parseInt(x),name:n,sku:h,attribute_set_id:o,priceTo:m,priceFrom:u,categoryIds:j,vendor:b}}))}))},className:"btn btn-custom text-white mr-2",ref:w,children:"Submit"}),Object(g.jsx)("button",{type:"button",className:"btn btn-primary",onClick:ht,children:"Cancel"})]})})]})})})})}),k&&Object(g.jsx)(wo,{props:{IsShowImagesVideoModal:k,ProductMedia:H,index:Y,SelectedMediaFiles:K,CurrentImageVariant:ue},closeMediaPopup:e=>{S(!1)},onSubmitMedia:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=e.images,a=void 0!==e.base_image&&""!==e.base_image?e.base_image:s[0],c=ee;""!==Y?""!==t?c[X].map(((r,l)=>!(""!==t&&r.attributes.filter((e=>e.option_id===parseInt(t))).length>0)||(c[X][l].base_image=a,c[X][l].other_images=s.filter((e=>e!==a)),c[X][l].video=e.video,!0))):(c[X][Y].base_image=a,c[X][Y].other_images=s.filter((e=>e!==s.base_image)),c[X][Y].video=e.video):c[X].map(((t,r)=>(c[X][r].base_image=a,c[X][r].other_images=s.filter((e=>e!==a)),c[X][r].video=e.video,!0))),te(c),ko=c,S(!1),A(!C)}})]})]})},Co=s(1032),Ao=s.p+"static/media/Product_Sheet.161f57cb.xlsx";var Po=()=>{const e=Object(d.useContext)(mo),t=Object(p.useHistory)(),[s,n]=Object(d.useState)(!1),o=Object(d.useRef)(new ec.a),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)({excel_sheet:[]});Object(d.useEffect)((()=>{document.title=r.ImportExcel}),[]);const N=e=>Object(g.jsx)("div",{children:Object.keys(e).map(((t,s)=>Object(g.jsxs)("p",{className:"mb-1",children:["Line- ",t+1,": ",e[t].map((e=>{let{messages:t}=e;return t})).join(",")]},Math.random())))}),f=(e,t)=>Object(g.jsx)("div",{children:e.length>0&&Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("b",{children:"Base image not uploaded for below SKU:"}),e.map((e=>Object(g.jsx)("p",{className:"mb-1",children:e},Math.random())))]})});return m?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.ImportExcel," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Upload Excel"}),Object(g.jsx)("input",{type:"file",name:"excel_sheet",onChange:e=>{O({...x,excel_sheet:e.target.files[0]}),n(!s)},accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",style:{display:"block"},className:"form-control"}),Object(g.jsx)("label",{className:"mt-1",style:{"font-size":"12px"},children:"(Only .xlsx, .xls file type is allowed)"}),o.current.message("Sheet",x.excel_sheet,"required",{className:"error"}),j&&Object(g.jsx)("div",{className:"error",children:l.formatnotsupport}),Object(g.jsx)("a",{href:Ao,className:"float-right",style:{"font-size":"12px",color:"#000000d4","text-decoration":"underline"},download:!0,children:"Example Sheet"})]})})}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{className:"btn btn-light mr-3",type:"button",onClick:()=>{if(!o.current.allValid())return o.current.showMessages(),void n(!s);const r=/(?:\.([^.]+))?$/.exec(x.excel_sheet.name)[1];["xlsx","xls"].indexOf(r)<0?h(!0):(h(!1),u(!0),Object(Co.a)(x.excel_sheet).then((r=>{const o=r[0];r.splice(0,1);const d=r,m=[];if(d.length<1)return u(!1),void sc()({title:l.oops,text:l.blankfile,icon:"error",buttons:{cancel:!0,confirm:!1}});for(let e=0;e{if(null===t.parent_sku){const a=null!==t.category&&t.category.indexOf("|")>=0?t.category.split("|"):[t.category],c=null!==t.sub_category&&t.sub_category.indexOf("|")>=0?t.sub_category.split("|"):[t.sub_category];var s=[];a.forEach((e=>{s.indexOf(e)<0&&s.push(e)}));const r=null!==t.attributes&&t.attributes.indexOf("|")>=0?t.attributes.split("|"):null,l=[];""!==r&&null!==r&&r.length>0&&r.forEach((e=>{const t=e.split(":");l.push({title:t[0].trim(),value:t[1].trim()})})),j[t.sku]={sku:t.sku,name:t.product_title,weight:t.weight,weight_unit:t.weight_unit,is_configured:1,description:t.description,short_description:t.description,is_readytoship:t.stock>0?1:0,is_sold:0,meta_description:t.meta_description,meta_keywords:t.meta_keywords,meta_title:t.meta_title,qty:t.stock>0?t.stock:0,price:t.price,status:1,Userid:e.id,category:s.join("|"),sub_category:c.join("|"),side_diamonds_size:t.side_diamonds_size,side_diamonds_pieces:t.side_diamonds_pieces,side_diamonds_weight:t.side_diamonds_weight,side_diamonds_weight_unit:t.side_diamonds_weight_unit,parent_sku:null,related_products:null!==t.related_skus?t.related_skus:"",attribute_set:t.attribute_set,options:[],can_be_set_with_shape:t.can_be_set_with_shape,can_be_set_with_carat:t.can_be_set_with_carat,attributes:l,is_gift_card:null!==t.is_gift_card&&""!==t.is_gift_card&&"yes"===t.is_gift_card.toLowerCase()?1:0}}else if(void 0!==j[t.parent_sku]){const s=[];let a=[];null!==t.options&&""!==t.options&&(a=t.options.split("|"),a.map((e=>{const t=e.split(":");return s.push({option_name:t[0],option_value:t[1]}),!0}))),j[t.sku]={sku:t.sku,model_number:t.model_number,name:j[t.parent_sku].name,weight:j[t.parent_sku].weight,weight_unit:j[t.parent_sku].weight_unit,is_configured:0,description:j[t.parent_sku].description,short_description:j[t.parent_sku].short_description,is_readytoship:t.stock>0?1:0,is_sold:0,meta_description:j[t.parent_sku].meta_description,meta_keywords:j[t.parent_sku].meta_keywords,meta_title:j[t.parent_sku].meta_title,qty:1,price:t.price,status:1,Userid:e.id,category:j[t.parent_sku].category,sub_category:j[t.parent_sku].sub_category,side_diamonds_size:j[t.parent_sku].side_diamonds_size,side_diamonds_pieces:j[t.parent_sku].side_diamonds_pieces,side_diamonds_weight:j[t.parent_sku].side_diamonds_weight,side_diamonds_weight_unit:j[t.parent_sku].side_diamonds_weight_unit,size:j[t.parent_sku].size,parent_sku:t.parent_sku,related_products:j[t.parent_sku].related_products,attribute_set:j[t.parent_sku].attribute_set,options:s,attributes:j[t.parent_sku].attributes,can_be_set_with_shape:j[t.parent_sku].can_be_set_with_shape,can_be_set_with_carat:j[t.parent_sku].can_be_set_with_carat,is_gift_card:j[t.parent_sku].is_gift_card}}return!0}));const b=[];if(m.map(((t,s)=>{if(""!==t.sku&&null!==t.sku||b.push({line:s+1,messages:l.RequiredSku}),""===t.product_title||null===t.product_title||""!==t.attribute_set&&null!==t.attribute_set||b.push({line:s+1,messages:l.RequiredAttributeSet}),""!==t.product_title&&null!==t.product_title||""!==t.parent_sku&&null!==t.parent_sku||b.push({line:s+1,messages:l.RequiredParentSku}),""===t.attribute_set||null===t.attribute_set||""!==t.product_title&&null!==t.product_title||b.push({line:s+1,messages:l.RequiredProductTitle}),""===t.product_title||null===t.product_title||""!==t.category&&null!==t.category||b.push({line:s+1,messages:l.RequiredCategory}),""===t.parent_sku||null===t.parent_sku||""!==t.price&&null!==t.price?""!==t.parent_sku&&null!==t.parent_sku&&isNaN(parseInt(t.price))&&b.push({line:s+1,messages:l.InvalidPrice}):b.push({line:s+1,messages:l.RequiredPrice}),""===t.option1_name||null===t.option1_name||""!==t.option1_value&&null!==t.option1_value||b.push({line:s+1,messages:l.RequiredOption1Value}),""===t.option2_name||null===t.option2_name||""!==t.option2_value&&null!==t.option2_value||b.push({line:s+1,messages:l.RequiredOption2Value}),""===t.option3_name||null===t.option3_name||""!==t.option3_value&&null!==t.option3_value||b.push({line:s+1,messages:l.RequiredOption3Value}),""!==t.can_be_set_with_shape&&""===t.can_be_set_with_carat&&b.push({line:s+1,messages:l.RequiredCanBeSetCarat}),""===t.can_be_set_with_shape&&""!==t.can_be_set_with_carat&&b.push({line:s+1,messages:l.RequiredCanBeSetShape}),null===t.parent_sku){const s=null!==t.category&&t.category.indexOf("|")>=0?t.category.split("|"):[t.category],c=null!==t.sub_category&&t.sub_category.indexOf("|")>=0?t.sub_category.split("|"):[t.sub_category];var a=[];s.forEach((e=>{a.indexOf(e)<0&&a.push(e)}));const r=null!==t.attributes&&t.attributes.indexOf("|")>=0?t.attributes.split("|"):null,l=[];""!==r&&null!==r&&r.length>0&&r.forEach((e=>{const t=e.split(":");l.push({title:t[0].trim(),value:t[1].trim()})})),j[t.sku]={sku:t.sku,name:t.product_title,weight:t.weight,weight_unit:t.weight_unit,is_configured:1,description:t.description,short_description:t.description,is_readytoship:t.stock>0?1:0,is_sold:0,meta_description:t.meta_description,meta_keywords:t.meta_keywords,meta_title:t.meta_title,qty:t.stock>0?t.stock:0,price:t.price,status:1,Userid:e.id,category:a.join("|"),sub_category:c.join("|"),side_diamonds_size:t.side_diamonds_size,side_diamonds_pieces:t.side_diamonds_pieces,side_diamonds_weight:t.side_diamonds_weight,side_diamonds_weight_unit:t.side_diamonds_weight_unit,parent_sku:null,related_products:null!==t.related_skus?t.related_skus:"",total_colors:0,attribute_set:t.attribute_set,can_be_set_with_shape:t.can_be_set_with_shape,can_be_set_with_carat:t.can_be_set_with_carat,attributes:l,is_gift_card:t.is_gift_card}}else if(void 0!==j[t.parent_sku]){const s=null!==t.attributes&&t.attributes.indexOf("|")>=0?t.attributes.split("|"):null,a=[];""!==s&&null!==s&&s.length>0&&s.forEach((e=>{const t=e.split(":");a.push({title:t[0].trim(),value:t[1].trim()})}));const c=[];let r=[];null!==t.options&&""!==t.options&&(r=t.options.split("|"),r.map((e=>{const t=e.split(":");return c.push({option_name:t[0],option_value:t[1]}),!0}))),j[t.sku]={sku:t.sku,model_number:t.model_number,name:j[t.parent_sku].name,weight:j[t.parent_sku].weight,weight_unit:j[t.parent_sku].weight_unit,stone_weight:j[t.parent_sku].stone_weight,stone_pieces:j[t.parent_sku].stone_pieces,is_configured:0,description:j[t.parent_sku].description,short_description:j[t.parent_sku].short_description,is_readytoship:t.stock>0?1:0,is_sold:0,meta_description:j[t.parent_sku].meta_description,meta_keywords:j[t.parent_sku].meta_keywords,meta_title:j[t.parent_sku].meta_title,qty:t.stock>0?t.stock:0,price:t.price,status:1,Userid:e.id,category:j[t.parent_sku].category,sub_category:j[t.parent_sku].sub_category,side_diamonds_size:j[t.parent_sku].side_diamonds_size,side_diamonds_pieces:j[t.parent_sku].side_diamonds_pieces,side_diamonds_weight:j[t.parent_sku].side_diamonds_weight,side_diamonds_weight_unit:j[t.parent_sku].side_diamonds_weight_unit,size:j[t.parent_sku].size,parent_sku:t.parent_sku,related_products:j[t.parent_sku].related_products,total_colors:0,attribute_set:j[t.parent_sku].attribute_set,options:c,attributes:j[t.parent_sku].attributes,can_be_set_with_shape:j[t.parent_sku].can_be_set_with_shape,can_be_set_with_carat:j[t.parent_sku].can_be_set_with_carat,is_gift_card:j[t.parent_sku].is_gift_card}}return!0})),b.length>0){u(!1);const e=i.groupBy(b,"line");sc()({title:l.oops,content:N(e),icon:"error",buttons:{cancel:!0,confirm:!1}})}else{const e=[];Object.values(j).map((e=>{if(null===e.parent_sku||""===e.parent_sku){const t=Object.values(j).filter((t=>t.parent_sku===e.sku));j[e.sku].child_skus=t.length>0?t.map((e=>e.sku)).join(","):""}return!0}));for(const t in j)e.push(j[t]);e.length>0?a.postApi(c.ImportProducts,e).then((e=>{if(u(!1),e.data.message)return gl.b.warning(e.data.message),void n(!s);if(void 0!==e.data.result.sku_without_images){const t=e.data.result.sku_without_images,s=e.data.result.sku_without_video;(t.length>0||s.length>0)&&sc()({title:l.oops,content:f(t),icon:"error",buttons:{cancel:!0,confirm:!1}})}else if(e.data.result[0].length>0&&!e.data.result[0][0].result){const t=i.groupBy(e.data.result[0],"line");console.log(t),sc()({title:l.oops,content:N(t),html:!0,icon:"error",buttons:{cancel:!0,confirm:!1}})}else gl.b.success(l.RecordAdded),n(!s),t.push("/products")})):(u(!1),sc()({title:l.oops,text:l.blankfile,icon:"error",buttons:{cancel:!0,confirm:!1}}))}})))},children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/products",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var Do=()=>{const e=Object(d.useContext)(mo),t=Object(p.useHistory)(),s=Object(d.useRef)(null),n=Object(d.useRef)(new ec.a),[i,o]=Object(d.useState)(!1),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)({excel_sheet:[]});Object(d.useEffect)((()=>{document.title=r.UpdatePrice}),[]);return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.UpdatePrice," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Upload Excel"}),Object(g.jsx)("input",{type:"file",name:"excel_sheet",onChange:e=>{h({...j,excel_sheet:e.target.files[0]}),u(!m)},accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",style:{display:"block"},className:"form-control",ref:s}),Object(g.jsx)("label",{className:"mt-1",style:{"font-size":"12px"},children:"(Only .xlsx file type is allowed)"}),n.current.message("Sheet",j.excel_sheet,"required",{className:"error"}),i&&Object(g.jsx)("div",{className:"error",children:l.formatnotsupport})]})})}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{className:"btn btn-custom text-white mr-2",type:"button",onClick:()=>{if(!n.current.allValid())return n.current.showMessages(),void u(!m);const t=/(?:\.([^.]+))?$/.exec(j.excel_sheet.name)[1];if(["xlsx","xls"].indexOf(t)<0)return o(!0),void(s.current.value="");o(!1),Object(Co.a)(j.excel_sheet).then((t=>{const r=t[0];t.splice(0,1);const n=t,i=[];if(n.length<1)return void sc()({title:l.oops,text:l.blankfile,icon:"error",buttons:{cancel:!0,confirm:!1}});for(let e=0;enull!==e.model&&(null!==e.price_14k&&!isNaN(e.price_14k)||null!==e.price_18k&&!isNaN(e.price_18k)||null!==e.plat&&!isNaN(e.plat)))),d=i.filter((e=>null===e.model||(null===e.price_14k||isNaN(e.price_14k))&&(null===e.price_18k||isNaN(e.price_18k))&&(null===e.plat||isNaN(e.plat)))),m=d.map((e=>e.model));if(0!==d.length&&sc()({title:l.oops||"Error",text:"Invalid Price For Model : "+m.join(", "),buttons:{Cancel:{text:"Cancel",value:!1,visible:!0,closeModal:!0}}}).then((e=>{!1===e&&(s.current.value="")})),0===d.length&&null!==o&&o.length>0){const t={product_price_data:o,Userid:e.id};a.postApi(c.UpdateProductPriceWithExcel,t).then((e=>{try{if(e.data.result){const t=e.data.result[0].map((e=>e.model_number));0!==t.length&&sc()({title:l.oops||"Error",text:"Invalid Model in Sheet : "+t.join(", "),buttons:{Cancel:!0}}),gl.b.success(l.RecordAdded),h({...j,excel_sheet:[]}),s.current.value=""}else e.data.result.message&&gl.b.error(e.data.result.message)}catch(t){console.error()}}))}}))},children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/products",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var Mo=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),p=[{name:"Type",sortField:"Type",selector:e=>e.type},{name:"Country",selector:e=>e.country},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/productsize/edit/"+e.type+"?country="+e.country_id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>{e.is_product_exist?t.preventDefault():y(t,e.type)},to:"",className:e.is_product_exist?"text-dark disabled":"text-dark",title:e.is_product_exist?l.ProductSizeDeleteError:"Delete",disabled:e.is_product_exist,children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[h,x]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[O,N]=Object(d.useState)();Object(d.useEffect)((()=>{o(!0),document.title=r.ProductSize,f()}),[h]);const f=()=>{a.postApi(c.GetProductSizeCategoryList).then((e=>{if(j(!1),!0===e.data.status){const a=e.data.result[0];t(a),N(a.length),n(!s)}}))},_=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Size, Category Name, Country.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>x({...h,search:e.target.value})}))),y=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={_type:t};j(!0),a.postApi(c.DeleteProductSize,e).then((e=>{j(!1),gl.b.success(l.RecordDeleted),f(),n(!s)}))}}))};return i?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ProductSize," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/productsize/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddProductSize," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:p,data:e,pagination:!0,persistTableHead:!0,paginationTotalRows:O,onChangeRowsPerPage:e=>{x({...h,page:1,page_size:e})},onChangePage:e=>{x({...h,page:e})},subHeader:!0,subHeaderComponent:_,onSort:(e,t)=>{x({...h,sort_column:e.sortField,sort_direction:t})},sortServer:!0,progressPending:u,progressComponent:Object(g.jsx)(v,{})})})})})})})]}):Object(g.jsx)(v,{})};var Ro=()=>{const e=Object(p.useParams)(),t=new URLSearchParams(location.search).get("country");console.log(t);const s=Object(p.useHistory)(),n=Object(d.useRef)(),i=Object(d.useRef)(new ec.a),[o,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),[h,x]=Object(d.useState)([]),[O,N]=Object(d.useState)([]),[f,_]=Object(d.useState)([]),[y,w]=Object(d.useState)([]),[k,S]=Object(d.useState)([]),[C,A]=Object(d.useState)(""),[P,D]=Object(d.useState)(!1),[M,R]=Object(d.useState)([]),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)({id:0,size:"",status:0,category_id:"",SizeType:"",country_id:"",CategoryName:"",MaleSize:"",FemaleSize:"",UnisexSize:""});Object(d.useEffect)((()=>{m(!0),document.title=r.AddProductSize,G(),null!=e.id?(document.title=r.EditProductSize,z()):T()}),[e.id]);const G=e=>{j(!0),a.getApi(c.GetCountryList).then((e=>{j(!1),I(e.data.result)}))},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a.postApi(c.GetCategory,null).then((t=>{if(j(!1),t.data.result){const s=t.data.result[0].filter((e=>1===e.parent_id&&0===e.is_diamond_category)),a=[];s.map((s=>{const c=t.data.result[0].filter((e=>e.parent_id===s.id)),r=[];return c.map((s=>{const a=t.data.result[0].filter((e=>e.parent_id===s.id)),c=[];return a.map((t=>(c.push({label:t.name,value:t.id,checked:e.indexOf(t.id)>=0,children:[]}),!0))),r.push({label:s.name,value:s.id,checked:e.indexOf(s.id)>=0,children:c}),!0})),a.push({label:s.name,value:s.id,children:r,checked:e.indexOf(s.id)>=0}),!0})),R(a)}}))},B=e=>t=>{L("status"===e?{...E,[e]:t.target.checked}:{...E,[e]:t.target.value}),D(!P)},z=()=>{const s={_type:e.id,_country:t};j(!0),a.postApi(c.GetProductSize,s).then((e=>{if(j(!1),e.data.result){const t=e.data.result[0];L(e.data.result[0][0]),_(t.filter((e=>1===e.gender_type))[0].sizes.map((e=>e))),w(t.filter((e=>2===e.gender_type))[0].sizes.map((e=>e))),S(t.filter((e=>3===e.gender_type))[0].sizes.map((e=>e))),N(e.data.result[0].map((e=>e.size))),x(e.data.result[0][0].category_id),T([e.data.result[0][0].category_id]),D(!P)}}))},U=(e,t)=>{"Enter"===e.key&&("MaleSize"===t?(_([...f,E.MaleSize]),L({...E,MaleSize:""})):"FemaleSize"===t?(w([...y,E.FemaleSize]),L({...E,FemaleSize:""})):"UnisexSize"===t&&(S([...k,E.UnisexSize]),L({...E,UnisexSize:""})))},q=(e,t,s)=>{N(O.filter(((e,s)=>s!==t))),sc()(l.SwalDeleteProp).then((function(e){e&&("MaleSize"===s?_(f.filter(((e,s)=>s!==t))):"FemaleSize"===s?w(y.filter(((e,s)=>s!==t))):"UnisexSize"===s&&S(k.filter(((e,s)=>s!==t))))}))};return!o||u?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",null==e.id?r.AddProductSize:r.EditProductSize," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:s.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Size Type"}),Object(g.jsx)("input",{type:"text",value:E.SizeType,onChange:B("SizeType"),placeholder:"Enter Value",className:"form-control"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Select Country"}),Object(g.jsxs)("select",{className:"form-control",name:"template_id",onChange:B("country_id"),value:E.country_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),F.length>0&&F.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Male Size"}),Object(g.jsxs)("div",{className:"tag-input-container",children:[f.map(((e,t)=>Object(g.jsxs)("div",{className:"tag",children:[e,Object(g.jsx)("span",{className:"remove-tag",onClick:()=>q(0,t,"MaleSize"),children:"\xd7"})]},t))),Object(g.jsx)("input",{type:"text",value:E.MaleSize,onChange:B("MaleSize"),onKeyDown:e=>U(e,"MaleSize"),placeholder:"Enter Value",className:"tag-input"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Female Size"}),Object(g.jsxs)("div",{className:"tag-input-container",children:[y.map(((e,t)=>Object(g.jsxs)("div",{className:"tag",children:[e,Object(g.jsx)("span",{className:"remove-tag",onClick:()=>q(0,t,"FemaleSize"),children:"\xd7"})]},t))),Object(g.jsx)("input",{type:"text",value:E.FemaleSize,onChange:B("FemaleSize"),onKeyDown:e=>U(e,"FemaleSize"),placeholder:"Enter Value",className:"tag-input"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Unisex Size"}),Object(g.jsxs)("div",{className:"tag-input-container",children:[k.map(((e,t)=>Object(g.jsxs)("div",{className:"tag",children:[e,Object(g.jsx)("span",{className:"remove-tag",onClick:()=>q(0,t,"UnisexSize"),children:"\xd7"})]},t))),Object(g.jsx)("input",{type:"text",value:E.UnisexSize,onChange:B("UnisexSize"),onKeyDown:e=>U(e,"UnisexSize"),placeholder:"Enter Value",className:"tag-input"})]})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6 ",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:B("status"),id:"EnableProduct",checked:E.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:n,type:"button",onClick:t=>{n.current&&n.current.setAttribute("disabled","disabled");const r={type:E.SizeType,MaleSize:f,FemaleSize:y,UnisexSize:k,status:E.status,countryId:E.country_id};j(!0),a.postApi(c.SetProductSize,r).then((t=>{if(j(!1),t.data.message)return gl.b.warning(t.data.message),D(!P),void n.current.removeAttribute("disabled");null==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),D(!P),s.push("/system/productsize")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/productsize",className:"btn btn-primary",children:"Cancel"})]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6 d-none ",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Product Size"}),Object(g.jsxs)("div",{className:"tag-input-container",children:[O.map(((e,t)=>Object(g.jsxs)("div",{className:"tag",children:[e,Object(g.jsx)("span",{className:"remove-tag",onClick:()=>q(0,t),children:"\xd7"})]},t))),Object(g.jsx)("input",{type:"text",value:C,onChange:e=>A(e.target.value),onKeyDown:U,placeholder:"Enter Value",className:"tag-input",disabled:!0})]})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6 d-none",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),M.length>0&&Object(g.jsx)(ei.a,{data:M,mode:"hierarchical",onChange:(e,t)=>{const s=[];if(t.length>0)for(let a=0;a(s.indexOf(e.value)>=0?M[t].checked=!0:M[t].checked=!1,e.children.map(((e,a)=>(s.indexOf(e.value)>=0?M[t].children[a].checked=!0:M[t].children[a].checked=!1,e.children.map(((e,c)=>(s.indexOf(e.value)>=0?M[t].children[a].children[c].checked=!0:M[t].children[a].children[c].checked=!1,!0))),!0))),!0)))},className:"bootstrap-demo w-100",disabled:!0}),i.current.message("Category Name",h,"required",{className:"error"})]})})})]})})})})})]})};var Fo=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(!1),[j,p]=Object(d.useState)(1),[h,x]=Object(d.useState)(!0),[O,N]=Object(d.useState)(""),[f,_]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[y,w]=Object(d.useState)(),k=[{name:"Name",sortable:!0,sortField:"name",wrap:!0,selector:e=>e.name},{name:"Slug",selector:e=>e.slug,wrap:!0},{name:"Parent Category",selector:e=>1!==e.parent_id?e.parent_category:"-",wrap:!0},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),wrap:!0},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/categories/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],S=()=>{const e={page:f.page,search:O,page_size:f.page_size,sort_column:f.sort_column,sort_direction:f.sort_direction};x(!0),a.postApi(c.GetCategoryAdminList,e).then((e=>{if(x(!1),!0===e.data.status){var s;const a=e.data.result[0];t(a),w(null===(s=e.data)||void 0===s?void 0:s.result[0][0].total_category),u(!o)}}))};Object(d.useEffect)((()=>{i(!0),document.title=r.Category,S(),u(!o)}),[f,O]);const C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name, Slug, Parent Category.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{N(e.target.value)}),1e3)}))),A=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};x(!0),a.postApi(c.DeleteCategory,e).then((e=>{x(!1),gl.b.success(l.RecordDeleted),S(),u(!o)}))}}))};return n?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Category," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/categories/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Category"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:k,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,progressPending:h,progressComponent:Object(g.jsx)(v,{}),paginationTotalRows:y,onChangeRowsPerPage:e=>{p(1),_({...f,page:1,page_size:e})},onChangePage:e=>{p(e),_({...f,page:e})},paginationDefaultPage:j,subHeader:!0,subHeaderComponent:C,onSort:(e,t)=>{_({...f,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})},Io=s(298),Eo=s.n(Io),Lo=(s(987),s(605)),Go=s.n(Lo);const To={readonly:!1,height:300,toolbarButtonSize:"middle",toolbarAdaptive:!1,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,toolbar:["bold","italic","underline","strikethrough","ul","ol","link","image","video","source"]};var Bo=e=>{let{value:t="",onChange:s,config:a={},placeholder:c="",showHtmlToggle:r=!0,saveButtonLabel:l="Save HTML",className:n=""}=e;const[i,o]=Object(d.useState)(0),m=Object(d.useRef)(null);return Object(d.useEffect)((()=>{o((e=>e+1))}),[t]),Object(g.jsx)("div",{className:n,children:Object(g.jsx)(Go.a,{ref:m,value:t||"",config:{...To,...a,height:300},tabIndex:1,onBlur:e=>s(e)},"".concat(i))})};var zo=()=>{var e;const t=Object(p.useParams)(),s=Object(p.useHistory)(),[n,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)(!0),x=Object(d.useRef)(new ec.a),[O,N]=Object(d.useState)(!1),[f,_]=Object(d.useState)(!0),[y,w]=Object(d.useState)(""),[k,S]=Object(d.useState)([]),[C,A]=Object(d.useState)([]),[P,D]=Object(d.useState)(""),[M,R]=Object(d.useState)(""),[F,I]=Object(d.useState)(!0),[E,L]=Object(d.useState)(!0),[G,T]=Object(d.useState)(!1),[B,z]=Object(d.useState)(""),[U,q]=Object(d.useState)(!0),[H,V]=Object(d.useState)(!0),[K,W]=Object(d.useState)(!1),[Y,Q]=Object(d.useState)(""),[X,J]=Object(d.useState)(!0),[Z,$]=Object(d.useState)(!0),[ee,te]=Object(d.useState)(!1),[se,ae]=Object(d.useState)(""),[ce,re]=Object(d.useState)(!0),[le,ne]=Object(d.useState)(!0),[ie,oe]=Object(d.useState)(!1),de=Object(d.useRef)(),[me,ue]=Object(d.useState)(""),[je,be]=Object(d.useState)(""),[pe,he]=Object(d.useState)("");console.log(pe);const[xe,Oe]=Object(d.useState)({id:0,name:"",title:"",slug:"",image:"",parent_id:1,abbreviation:"",meta_title:"",meta_description:"",meta_keyword:"",status:0,is_diamond_category:0,is_gemstone_category:0,is_mto_category:0,is_gift_card:0,order_no:"",options:[],faqs:[],explore_more:[],size_attribute_id:0,after_products_1:"",after_products_2:"",offer_banner_slug_1:"",offer_banner_slug_2:"",footer_title:""}),ge={toolbar:[["bold","italic","underline"],["link"]]},ve=["bold","italic","underline","strike","link"];Object(d.useEffect)((()=>{i.validatePermission(o.Categories)||s.push("/"),u(!0),N(!O),document.title=r.AddCategory,void 0!==t.id?(document.title=r.EditCategory,Pe()):(setTimeout((()=>{Ae(),Ce(),ke(),Se()}),1e3),De()),Me()}),[t.id]),Object(d.useEffect)((()=>{Fe()}),[k]);const Ne=e=>t=>{t.preventDefault();const s=xe.faqs;s[e]={...s[e],[t.target.name]:t.target.value};const a="faqs";Oe({...xe,[a]:s}),N(!O)},fe=e=>t=>{const s=xe.faqs;s[e]={...s[e],value:t};const a="faqs";Oe({...xe,[a]:s}),N(!O)},_e=e=>t=>{t.preventDefault();let s=xe.faqs;s=s.filter((function(t,s){return s!==e}));const a="faqs";Oe({...xe,[a]:s}),N(!O)},ye=e=>t=>{t.preventDefault();const s=xe.explore_more;s[e]={...s[e],[t.target.name]:t.target.value};const a="explore_more";Oe({...xe,[a]:s}),N(!O)},we=e=>t=>{t.preventDefault();let s=xe.explore_more;s=s.filter((function(t,s){return s!==e}));const a="explore_more";Oe({...xe,[a]:s}),N(!O)},ke=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("DesktopBanner",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),J(!0)):new ti.a("DesktopBanner",{text:{chooseFile:"Choose Image..."}})},Se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("MobileBanner",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),re(!0)):new ti.a("MobileBanner",{text:{chooseFile:"Choose Image..."}})},Ce=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("offer1image",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),q(!0)):new ti.a("offer1image",{text:{chooseFile:"Choose Image..."}})},Ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("offer2image",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),I(!0)):new ti.a("offer2image",{text:{chooseFile:"Choose Image..."}})};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){if("offer2image"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{R(e)})),I(!0),L(!0),T(!1)):(T(!0),I(!0),R("")):(R(""),I(!0),L(!1),T(!1))}else if("offer1image"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{z(e)})),q(!0),V(!0),W(!1)):W(!0):(z(""),q(!0),V(!1),W(!1))}else if("MobileBanner"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{ae(e)})),re(!0),ne(!0),oe(!1)):(oe(!0),re(!0),ae("")):(ae(""),re(!0),ne(!1),oe(!1))}else if("DesktopBanner"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{Q(e)})),J(!0),$(!0),te(!1)):(te(!0),J(!0),Q("")):(Q(""),J(!0),$(!1),te(!1))}})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){"offer2image"===e.detail.uploadId?(R(""),L(!0),T(!1)):"offer1image"===e.detail.uploadId?(z(""),V(!0),W(!1)):"DesktopBanner"===e.detail.uploadId?(Q(""),$(!0),te(!1)):"MobileBanner"===e.detail.uploadId&&(ae(""),ne(!0),oe(!1))}));const Pe=()=>{const e={id:t.id};h(!0),a.postApi(c.GetCategory,e).then((e=>{if(h(!1),e.data.result){var t;const s=e.data.result;he(null===(t=s[0])||void 0===t?void 0:t.footer_cms_content),ue(s[0].footer_description),be(s[0].description),Oe(s[0]),De(s[0].parent_id),setTimeout((()=>{""!==s[0].offer_image_1?Ce(s[0].offer_image_1):Ce(),""!==s[0].offer_image_2?Ae(s[0].offer_image_2):Ae(),""!==s[0].DesktopBannerImage?ke(s[0].DesktopBannerImage):ke(),""!==s[0].MobileBannerImage?Se(s[0].MobileBannerImage):Se()}),1e3),D(s[0].image),w(s[0].image),N(!O)}}))},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;h(!0),a.postApi(c.GetCategory,null).then((s=>{if(h(!1),s.data.result){const a=s.data.result[0].filter((e=>1===e.parent_id)),c=[];a.map((a=>{const r=s.data.result[0].filter((e=>e.parent_id===a.id)),l=[];r.map((a=>{const c=s.data.result[0].filter((e=>e.parent_id===a.id)),r=[];c.map((s=>{let a=!1;return(void 0!==t.id&&xe.parent_id===s.id||e===s.id)&&(a=!0),r.push({label:s.name,value:s.id,checked:a,children:null}),!0}));let n=!1;return(void 0!==t.id&&xe.parent_id===a.id||e===a.id)&&(n=!0),l.push({label:a.name,value:a.id,checked:n,children:r}),!0}));let n=!1;return(void 0!==t.id&&xe.parent_id===a.id||e===a.id)&&(n=!0),c.push({label:a.name,value:a.id,children:l,checked:n}),!0})),S(c)}}))},Me=()=>{h(!0),a.postApi(c.GetProductAttributeList,{}).then((e=>{h(!1),A(e.data.result[0]),N(!O)}))},Re=e=>t=>{Oe("status"===e||"is_diamond_category"===e||"is_gemstone_category"===e||"is_mto_category"===e||"is_gift_card"===e?{...xe,[e]:t.target.checked}:{...xe,[e]:t.target.value}),N(!O),Fe()},Fe=e=>{k.map(((e,t)=>(e.value===xe.parent_id?k[t].checked=!0:k[t].checked=!1,e.children.map(((e,s)=>(e.value===xe.parent_id?k[t].children[s].checked=!0:k[t].children[s].checked=!1,!0))),!0)))},Ie=e=>t=>{t.preventDefault();let s=[...xe.options];s=s.filter((t=>t.id!==e)),xe.options=s,N(!O)},Ee={position:"relative",padding:"10px 15px",fontSize:"15px",border:"1px solid #f9fafa",background:"#f9fafa",cursor:"move"};function Le(e){return e.trim().replace(/(?<=.)\s(?=.)/g,"-")}return!n||j?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==t.id?r.EditCategory:r.AddCategory]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:s.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:Re("name"),onKeyUp:Re("name"),onBlur:()=>x.current.showMessageFor("Name"),defaultValue:xe.name,placeholder:"Name"}),x.current.message("Name",xe.name,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",onChange:Re("title"),onKeyUp:Re("title"),defaultValue:xe.title,placeholder:"Title"}),x.current.message("Title",xe.title,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)(Eo.a,{theme:"snow",value:je,onChange:e=>{be(e),N(!O)},modules:ge,formats:ve,style:{height:100,marginBottom:"70px"}})]})}),Object(g.jsx)("div",{className:"col-md-8",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Slug"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"slug",onChange:Re("slug"),onKeyUp:Re("slug"),onBlur:()=>x.current.showMessageFor("Slug"),defaultValue:xe.slug,placeholder:"Slug"}),x.current.message("Slug",xe.slug,"required|max:70",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Parent Category"}),k.length>0&&Object(g.jsx)(ei.a,{data:k,onChange:(e,t)=>{t.length>0?xe.parent_id=t[0].value:xe.parent_id=1},mode:"radioSelect",className:"bootstrap-demo w-100"})]})})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:Re("status"),id:"EnableProduct",checked:xe.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is Diamond Category"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_diamond_category",onChange:Re("is_diamond_category"),id:"is_diamond_category",checked:xe.is_diamond_category}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_diamond_category",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is Gemstone Category"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_gemstone_category",onChange:Re("is_gemstone_category"),id:"is_gemstone_category",checked:xe.is_gemstone_category}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_gemstone_category",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is MTO Category"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_mto_category",onChange:Re("is_mto_category"),id:"is_mto_category",checked:xe.is_mto_category}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_mto_category"})]})})]})}),Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Is Gift Card Category"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_gift_card",onChange:Re("is_gift_card"),id:"is_gift_card",checked:xe.is_gift_card}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"is_gift_card"})]})})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{id:"accordion",className:"custom-accordion",children:[Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseZero","aria-expanded":"true","aria-controls":"collapseZero",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Media"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseZero",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[" ",Object(g.jsxs)("div",{className:"col d-none",children:[Object(g.jsx)("div",{className:"form-group mb-0 mt-3",children:Object(g.jsxs)("label",{children:["Image Icon"," ",Object(g.jsx)("small",{className:"note ml-1 ",children:"(only .svg format is allowed)"})]})}),Object(g.jsxs)("div",{className:"form-group mt-4",children:[Object(g.jsx)("input",{type:"file",accept:"image/svg+xml",name:"categoryimage",className:"form-control mr-2 option-image-file ",id:"category_image",style:{display:"block"},ref:de,onChange:e=>(async e=>{if("image/svg+xml"===e.target.files[0].type){const t=await new Promise(((t,s)=>{ao(e.target.files[0],(e=>{t(e)}))}));D(t),w(t),N(!O),_(!0)}else _(!1)})(e)}),Object(g.jsxs)("div",{className:"btn-remove-image ",children:[Object(g.jsx)(b.b,{className:"custom-file-container__image-clear float-right",title:"Remove Image",onClick:e=>((e,t)=>{_(!0),e.preventDefault(),w(null),D(" "),t.current&&(t.current.value="")})(e,de),children:"\xd7"}),Object(g.jsxs)("div",{className:"menu-svg-icon",children:[" ",Object(g.jsx)("img",{src:P})]})]}),Object(g.jsx)("div",{style:f?{display:"none"}:{},className:"error",children:"The file format is not supported."})]})]}),Object(g.jsx)("div",{className:"col",children:Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsxs)("label",{children:["Desktop Banner",Object(g.jsx)("small",{className:"note ml-1",children:"(Only PNG, JPEG, JPG format allowed.)"})]}),Object(g.jsx)("div",{className:"custom-file-container mb-2","data-upload-id":"DesktopBanner"}),Object(g.jsx)("div",{style:X?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:Z?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:ee?{}:{display:"none"},className:"error pt-0 pb-2",children:"Maximum file size should be 2MB."})]})}),Object(g.jsx)("div",{className:"col",children:Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsxs)("label",{children:["Mobile Banner",Object(g.jsx)("small",{className:"note ml-1",children:"(Only PNG, JPEG, JPG format allowed.)"})]}),Object(g.jsx)("div",{className:"custom-file-container mb-4","data-upload-id":"MobileBanner"}),Object(g.jsx)("div",{style:ce?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:le?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:ie?{}:{display:"none"},className:"error pt-0 pb-2",children:"Maximum file size should be 2MB."})]})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-top border-bottom",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseOne","aria-expanded":"true","aria-controls":"collapseOne",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Search Engine Optimization"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseOne",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Title"}),Object(g.jsx)("textarea",{className:"form-control",name:"meta_title",onChange:Re("meta_title"),onKeyUp:Re("meta_title"),defaultValue:xe.meta_title,placeholder:"Meta Title"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Description"}),Object(g.jsx)("textarea",{className:"form-control",name:"meta_description",onChange:Re("meta_description"),onKeyUp:Re("meta_description"),defaultValue:xe.meta_description,placeholder:"Meta Description"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Keyword"}),Object(g.jsx)("textarea",{className:"form-control",name:"meta_keyword",onChange:Re("meta_keyword"),onKeyUp:Re("meta_keyword"),defaultValue:xe.meta_keyword,placeholder:"Meta Keyword"}),x.current.message("Meta Keyword",xe.meta_keyword,"max:255",{className:"error"})]})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseTwo","aria-expanded":"true","aria-controls":"collapseTwo",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Offer Banner"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseTwo",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[" ",Object(g.jsxs)("div",{className:"col",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"After Products "}),Object(g.jsx)("input",{name:"skip_item_offer1",type:"number",min:0,onBlur:()=>x.current.showMessageFor("skip_item_offer1"),value:xe.after_products_1,onChange:Re("after_products_1"),className:"form-control",placeholder:"After Products"})]}),Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsx)("label",{children:"Offer Slug 1"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"offer_banner_slug_1",onChange:Re("offer_banner_slug_1"),onKeyUp:Re("offer_banner_slug_1"),onBlur:()=>x.current.showMessageFor("offer_banner_slug_1"),defaultValue:xe.offer_banner_slug_1,placeholder:"offer banner slug"})]}),Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsxs)("label",{children:["Offer Image 1",Object(g.jsx)("small",{className:"note ml-1",children:"(Only PNG, JPEG, JPG format allowed.)"})]}),Object(g.jsx)("div",{className:"custom-file-container mb-2","data-upload-id":"offer1image"}),Object(g.jsx)("div",{style:U?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:H?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:K?{}:{display:"none"},className:"error pt-0 pb-2",children:"Maximum file size should be 2MB."})]})]}),Object(g.jsxs)("div",{className:"col",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"After Products"}),Object(g.jsx)("input",{name:"skip_item_offer2",type:"number",onBlur:()=>x.current.showMessageFor("skip_item_offer2"),min:0,value:xe.after_products_2,onChange:Re("after_products_2"),className:"form-control",placeholder:"After Products"})]}),Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsx)("label",{children:"Offer Slug 2"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"offer_banner_slug_2",onChange:Re("offer_banner_slug_2"),onKeyUp:Re("offer_banner_slug_2"),onBlur:()=>x.current.showMessageFor("offer_banner_slug_2"),defaultValue:xe.offer_banner_slug_2,placeholder:"offer banner slug"})]}),Object(g.jsxs)("div",{className:"form-group mt-3",children:[Object(g.jsxs)("label",{children:["Offer Image 2",Object(g.jsx)("small",{className:"note ml-1",children:"(Only PNG, JPEG, JPG format allowed.)"})]}),Object(g.jsx)("div",{className:"custom-file-container mb-2","data-upload-id":"offer2image"}),Object(g.jsx)("div",{style:F?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:E?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsxs)("div",{style:G?{}:{display:"none"},className:"error pt-0 pb-2",children:[G,"Maximum file size should be 2MB."]})]})]})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseThird","aria-expanded":"true","aria-controls":"collapseThird",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Filter Options"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseThird",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body pb-3 px-3 pt-2 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-2 order-lg-2",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"form-group mb-0 col-md-12 text-right",children:Object(g.jsx)("button",{className:"btn btn-dark",onClick:e=>{e.preventDefault();let t=xe.options;void 0!==t&&null!==t||(t=[]),t.push({id:Math.floor(1e3+9e3*Math.random()),value:"",sort_order:t.length>0?Math.max(...t.map((e=>e.sort_order)))+1:0}),Oe({...xe,options:t}),N(!O)},children:"Add Option"})})})}),Object(g.jsx)("div",{className:"col-md-10 order-lg-1",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-lg-6 mb-2",children:[Object(g.jsx)("p",{}),(null===(e=xe.options)||void 0===e?void 0:e.length)>0&&Object(g.jsx)(ai.a,{items:xe.options,renderItem:e=>{return Object(g.jsx)("div",{style:Ee,children:Object(g.jsxs)("div",{className:"row form-group mb-0",children:[Object(g.jsx)("div",{className:"col pr-1",children:Object(g.jsxs)("select",{className:"form-control",name:"options[]","data-id":e.item.id,onChange:(t=e.item.value,e=>{const s=[...xe.options],a=s.findIndex((e=>e.value===t));s[a]={id:a,value:e.target.value,sort_order:void 0!==s[a].sort_order?s[a].sort_order:0},Oe({...xe,options:s}),N(!O)}),value:e.item.value,children:[Object(g.jsx)("option",{value:"",children:"Please Select"}),C.length>0&&C.map(((e,t)=>Object(g.jsxs)("option",{value:e.id,disabled:xe.options.filter((t=>Number(t.value)===Number(e.id))).length>0,children:[e.attribute_name," - ",e.attribute_code]},t)))]})}),Object(g.jsx)("div",{className:"col-auto pl-1",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block",onClick:Ie(e.item.id),children:"X"})})]})});var t},collapsed:!1,onChange:e=>{const s=[];if(e.items.map(((e,t)=>(s.push({id:Math.floor(1e3+9e3*Math.random()),option_id:Math.floor(1e3+9e3*Math.random()),value:e.value,sort_order:t}),!0))),Oe({...xe,options:s}),void 0!==t.id){const e={items:s};a.postApi(c.ChangeCategoryAttributeOrder,e).then((e=>{}))}},maxDepth:1})]})})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseFour","aria-expanded":"true","aria-controls":"collapseFour",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"FAQs"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseFour",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsxs)("div",{className:"card-body p-3 pt-0 font-dark",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12 order-lg-1",children:Object(g.jsx)("div",{className:"row",children:null!==xe.faqs&&xe.faqs.map(((e,t)=>Object(g.jsxs)(m.a.Fragment,{children:[Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"_label_"+t,children:"Question"}),Object(g.jsx)("input",{type:"text",name:"label",className:"form-control",id:"_label_"+t,value:e.label,onChange:Ne(t)})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Answer"}),Object(g.jsx)(Eo.a,{value:e.value||"",onChange:fe(t),modules:ge,formats:ve,style:{minHeight:120,marginBottom:"20px"}})]})}),Object(g.jsx)("div",{className:"col-auto pr-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block mt-4 w-48",onClick:_e(t),children:"X"})})]},t)))})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-10 order-lg-1"}),Object(g.jsx)("div",{className:"col-md-2 order-lg-2",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-9 text-right p-0",children:Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white",onClick:e=>(e=>{e.preventDefault();let t=xe.faqs;void 0!==t&&null!==t||(t=[]),t.push({label:"",value:""});const s="faqs";Oe({...xe,[s]:t}),N(!O)})(e),children:"+ Add New"})})})})]})]})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseFive","aria-expanded":"true","aria-controls":"collapseFive",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Explore More"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseFive",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsxs)("div",{className:"card-body p-3 pt-0 font-dark",children:[Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12 order-lg-1",children:Object(g.jsx)("div",{className:"row",children:null!==xe.explore_more&&xe.explore_more.map(((e,t)=>Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"_label_"+t,children:"Title"}),Object(g.jsx)("input",{type:"text",name:"label",className:"form-control",id:"_label_"+t,value:e.label,onChange:ye(t)}),x.current.message("Title",e.label,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"_value_"+t,children:"Link"}),Object(g.jsx)("input",{type:"text",name:"value",className:"form-control",id:"_value_"+t,value:e.value,onChange:ye(t)}),x.current.message("Link",e.value,"required|max:255|url",{className:"error"}),Object(g.jsxs)("label",{style:{color:"#505050"},className:"note mt-1",children:[" ",'(Ex. "https://www.example.com/".)']})]})}),Object(g.jsx)("div",{className:"col-auto pr-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block mt-4 w-48",onClick:we(t),children:"X"})})]})))})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-10 order-lg-1"}),Object(g.jsx)("div",{className:"col-md-2 order-lg-2",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-9 text-right p-0",children:Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white",onClick:e=>(e=>{e.preventDefault();let t=xe.explore_more;void 0!==t&&null!==t||(t=[]),t.push({label:"",value:""});const s="explore_more";Oe({...xe,[s]:t}),N(!O)})(e),children:"+ Add New"})})})})]})]})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapsesix","aria-expanded":"true","aria-controls":"collapsesix",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Footer Content"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapsesix",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("textarea",{className:"form-control",name:"footer_title",onChange:Re("footer_title"),onKeyUp:Re("footer_title"),defaultValue:xe.footer_title,placeholder:"Title"})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),void 0!==me&&Object(g.jsx)(Eo.a,{theme:"snow",value:me,onChange:e=>{ue(e),N(!O)},modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link","image","video"],["clean"]]},formats:["header","bold","italic","underline","strike","list","bullet","link","image","video"],style:{height:300,marginBottom:"40px"}})]})})]})})})]}),Object(g.jsxs)("div",{className:"card shadow-none border-bottom mt-2",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#collapseseven","aria-expanded":"true","aria-controls":"collapseseven",className:"collapsed",children:Object(g.jsxs)("div",{className:"card-header border-none px-3",children:[Object(g.jsx)("label",{className:"mb-0",children:"Footer CMS Content"}),Object(g.jsx)("i",{className:"fa fa-chevron-down fs-12 float-right"})]})}),Object(g.jsx)("div",{id:"collapseseven",className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsx)("div",{className:"card-body p-3 pt-0 font-dark",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Content"}),void 0!==pe&&Object(g.jsx)(Bo,{value:pe||"",onChange:e=>{he(e),N(!O)},config:{readonly:!1,toolbarAdaptive:!1,toolbarButtonSize:"middle",showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,buttons:["bold","italic","underline","strikethrough","ul","ol","link","image","video","source"]}})]})})})})})]})]})})]}),Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{var r,n,o,d,m;if(!x.current.allValid()||!0===K||!0===G||!1===H||!1===E)return x.current.showMessages(),void N(!O);if(!f)return;const u={id:xe.id,name:i.capitalizeString(xe.name.trim()),title:i.capitalizeString(xe.title.trim()),description:je||"",slug:Le(xe.slug),image:y,parent_id:""!==xe.parent_id&&null!==xe.parent_id?xe.parent_id:1,abbreviation:xe.abbreviation,meta_title:xe.meta_title,meta_description:xe.meta_description,meta_keyword:xe.meta_keyword,status:null!==(r=xe.status)&&void 0!==r?r:0,is_diamond_category:null!==(n=xe.is_diamond_category)&&void 0!==n?n:0,is_gemstone_category:null!==(o=xe.is_gemstone_category)&&void 0!==o?o:0,is_mto_category:null!==(d=xe.is_mto_category)&&void 0!==d?d:0,is_gift_card:null!==(m=xe.is_gift_card)&&void 0!==m?m:0,order_no:xe.order_no.length<1?0:xe.order_no,filter_option:null!==xe.options?xe.options:"",size_attribute_id:""===xe.size_attribute_id||null===xe.size_attribute_id?0:xe.size_attribute_id,offer_image_1:B,offer_image_2:M,after_products_1:xe.after_products_1,after_products_2:xe.after_products_2,offer_banner_slug_1:xe.offer_banner_slug_1,offer_banner_slug_2:xe.offer_banner_slug_2,DesktopBannerImage:Y,MobileBannerImage:se,footer_title:xe.footer_title,footer_description:me,faqs:null!==xe.faqs&&xe.faqs.length>0?xe.faqs:[],explore_more:null!==xe.explore_more&&xe.explore_more.length>0?xe.explore_more:[],footer_cms_content:pe};h(!0),a.postApi(c.SetCategory,u).then((e=>{if(h(!1),e.data.message)return gl.b.warning(e.data.message),void N(!O);void 0!==t.id?gl.b.success(l.RecordUpdated):gl.b.success(l.RecordAdded),N(!O),s.push("/categories")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/categories",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Uo=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(1),[u,j]=Object(d.useState)(!1),[p,h]=Object(d.useState)(!0),[x,O]=Object(d.useState)(""),[N,f]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[_,y]=Object(d.useState)(),w=[{name:"Title",sortable:!0,sortField:"title",selector:e=>e.title,wrap:!0},{name:"Slug",selector:e=>e.slug,wrap:!0},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),wrap:!0},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/contentManagement/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>S(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}];Object(d.useEffect)((()=>{j(!0),document.title=r.ContentManagement,k()}),[N,x]);const k=()=>{const e={page:N.page,search:x,page_size:N.page_size,sort_column:N.sort_column,sort_direction:N.sort_direction};h(!0),a.postApi(c.GetContentManagementAdminList,e).then((e=>{if(h(!1),!0===e.data.status){const a=e.data.result[1];t(a),y(e.data.result[0][0].total_pages),n(!s)}}))},S=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0};h(!0),a.postApi(c.DeleteContentManagement,e).then((e=>{h(!1),gl.b.success(l.RecordDeleted),k(),n(!s)}))}}))},C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Title, Page Code, Slug.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{O(e.target.value)}),1e3)})));return u?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ContentManagement," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/contentManagement/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddContentManagement," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{progressPending:p,progressComponent:Object(g.jsx)(v,{}),columns:w,data:e,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:_,paginationDefaultPage:i,onChangeRowsPerPage:e=>{o(1),f({...N,page:1,page_size:e}),console.log("LN 120 Page 1 &page_size "+e)},onChangePage:e=>{o(e),f({...N,page:e})},subHeader:!0,subHeaderComponent:C,onSort:(e,t)=>{f({...N,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})};var qo=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!0);Object(d.useEffect)((()=>{document.title=r.CacheManagement,i()}),[]);const i=()=>{a.getApi(c.getcachekeys).then((e=>{n(!1),t(e.data.result)}))},o=e=>{let{item:t,key:s}=e;return"Products"===t||"Diamonds"===t||"Diamond Combinations"===t?[Object(g.jsx)("span",{children:"|"},s),Object(g.jsxs)(b.b,{to:"#",onClick:e=>m(t),children:[" ","Reset"," "]},s)]:""},m=e=>{const t={key:e};a.postApi(c.ResetCache,t).then((e=>{gl.b.success(l.ResetCache)}))};return s?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.CacheManagement," "]}),Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{a.postApi(c.SyncProduct).then((e=>{try{gl.b.success(l.ResponseSend)}catch(t){gl.b.warning(l.Error)}}))},children:[" ","Sync Product"]}),Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{sc()(l.CahcheclearProp).then((function(e){e&&a.getApi(c.removeAllCache).then((e=>{gl.b.success(l.CacheClear),i()}))}))},children:[" ","Clear All"," "]})]})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table text-center",children:[Object(g.jsx)("thead",{className:"bg-custom",children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{children:"Cache Type"}),Object(g.jsx)("th",{children:"Action"})]})}),Object(g.jsx)("tbody",{children:Object.keys(e).map(((t,s)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:e[t].replace(/_/g," ")}),Object(g.jsxs)("td",{className:"action-link",children:[Object(g.jsxs)(b.b,{to:"#",onClick:e=>((e,t)=>{e.preventDefault(),n(!0);const s={key:t};a.postApi(c.generatecachekey,s).then((e=>{gl.b.success(l.GenerateCache),n(!1),i()})).catch((e=>{gl.b.success("Something went wrong."+e),n(!1)}))})(e,t),children:["Generate"," "]}),"|",Object(g.jsxs)(b.b,{to:"#",onClick:e=>((e,t)=>{e.preventDefault(),sc()(l.CahcheclearProp).then((function(e){if(e){const e={key:t};a.postApi(c.removecachebykeys,e).then((e=>{gl.b.success(l.CacheClear),i()}))}}))})(e,t),children:[" ","Clear"," "]}),Object(g.jsx)(o,{item:e[t]})]})]},s)))})]})})})})})})})]})};s(988),s(989),s(990);var Ho=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),[s,n]=Object(d.useState)(!1),[m,u]=Object(d.useState)(!0),j=Object(d.useRef)(),h=Object(d.useRef)(new ec.a),[x,O]=Object(d.useState)(),[N,f]=Object(d.useState)(!1),[_,y]=Object(d.useState)({id:0,title:"",content:"",htmlcontent:"",slug:"",meta_title:"",meta_description:"",meta_keywords:"",status:0});Object(d.useEffect)((()=>{i.validatePermission(o.ContentManagement)||t.push("/"),n(!0),u(!1),f(!N),document.title=r.AddContentManagement,void 0!==e.id&&(document.title=r.EditContentManagement,k())}),[e.id]);const w=e=>t=>{y("status"===e?{..._,[e]:t.target.checked}:{..._,[e]:t.target.value}),f(!N)},k=()=>{const t={id:e.id};void 0!==e.id&&u(!0),a.postApi(c.GetContentManagementDetail,t).then((e=>{u(!1),e.data.result&&(y(e.data.result[0]),O(e.data.result[0].content),f(!N))}))};return!s||m?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditContentManagement:r.AddContentManagement," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{onSubmit:e=>{e.preventDefault()},className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Page Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",min:"2",maxLength:"255",onChange:w("title"),onKeyUp:w("title"),onBlur:()=>h.current.showMessageFor("Page Title"),defaultValue:_.title,placeholder:"Page Title"}),h.current.message("Page Title",_.title,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:w("status"),id:"EnableProduct",checked:_.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Slug (URL)"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"slug",min:"1",maxLength:"50",onChange:w("slug"),onKeyUp:w("slug"),onBlur:()=>h.current.showMessageFor("Slug"),defaultValue:_.slug,placeholder:"Slug"}),h.current.message("Slug",_.slug,"required",{className:"error"})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Content"}),Object(g.jsx)(to.a,{name:"content",value:x,options:{height:300,toolbar:[["style",["bold","italic","underline","clear"]],["font",["fontname","fontsize","strikethrough","superscript","subscript","style"]],["para",["ul","ol","paragraph"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Times","Verdana"],fontSizeUnits:["px","pt","%"]},onChange:e=>{(e=>{O(e),f(!N)})(e)}})]})})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"meta_title",min:"1",maxLength:"255",onChange:w("meta_title"),onKeyUp:w("meta_title"),onBlur:()=>h.current.showMessageFor("Meta Title"),defaultValue:_.meta_title,placeholder:"Meta Title"}),h.current.message("Meta Title",_.meta_title,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Keywords"}),Object(g.jsx)("input",{className:"form-control",rows:"5",name:"meta_keywords",onChange:w("meta_keywords"),onKeyUp:w("meta_keywords"),onBlur:()=>h.current.showMessageFor("Meta Keywords"),defaultValue:_.meta_keywords,placeholder:"Meta Keywords"}),h.current.message("Meta Keywords",_.meta_keywords,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Description"}),Object(g.jsx)("textarea",{className:"form-control",rows:"5",name:"meta_description",onChange:w("meta_description"),onKeyUp:w("meta_description"),onBlur:()=>h.current.showMessageFor("Meta Description"),defaultValue:_.meta_description,placeholder:"Meta Description"}),h.current.message("Meta Description",_.meta_description,"required",{className:"error"})]})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:j,type:"button",onClick:s=>{if(!h.current.allValid())return h.current.showMessages(),void f(!N);j.current&&j.current.setAttribute("disabled","disabled");const r={id:_.id,title:_.title,content:x,slug:_.slug,meta_title:_.meta_title,meta_description:_.meta_description,meta_keywords:_.meta_keywords,status:_.status};u(!0),void 0===e.id?a.postApi(c.AddContentManagement,r).then((e=>{if(u(!1),e.data.message)return gl.b.warning(e.data.message),f(!N),void j.current.removeAttribute("disabled");gl.b.success(l.RecordAdded),f(!N),t.push("/contentManagement")})):a.postApi(c.UpdateContentManagement,r).then((e=>{if(u(!1),e.data.message)return gl.b.warning(e.data.message),f(!N),void j.current.removeAttribute("disabled");gl.b.success(l.RecordUpdated),f(!N),t.push("/contentManagement")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/contentManagement",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Vo=()=>{const e=Object(p.useHistory)(),[t,s]=Object(d.useState)(!1),[n,m]=Object(d.useState)(!0),u=Object(p.useParams)(),[j]=Object(d.useState)(!0),[h,x]=Object(d.useState)([]),[O,N]=Object(d.useState)([]),[f,_]=Object(d.useState)([]),[y,w]=Object(d.useState)([]),[k,S]=Object(d.useState)([]),[C,A]=Object(d.useState)([]),[P,D]=Object(d.useState)(!0),M=Object(d.useRef)(new ec.a),R=Object(d.useRef)(new ec.a),[F]=Object(d.useState)(""),[I,E]=Object(d.useState)(!1),[L,G]=Object(d.useState)([]);let T=[];const B={id:0,title:"",description:"",menu_type:"",link:"",category_id:0,page_id:0,css_class:"",parent_id:0,sort_order:"",menu_column:0,parameters:null,status:0},[z,U]=Object(d.useState)(B);Object(d.useEffect)((()=>{i.validatePermission(o.System)||e.push("/"),s(!0),E(!I),document.title=r.NavigationMenu,void 0!==u.id?(document.title=r.EditNavigationMenu,q()):X(),H(),K(),V(),$()}),[u.id]);const q=()=>{const e={id:u.id};m(!0),a.postApi(c.GetNavigationMenuDetail,e).then((e=>{if(m(!1),e.data.result){const t=e.data.result;Object.keys(t[0]).map((function(e,s){return z[e]=t[0][e],!0})),U(t[0]),H(),E(!I)}}))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;m(!0),a.postApi(c.GetCategory,null).then((t=>{if(m(!1),t.data.result){const s=t.data.result[0].filter((e=>1===e.parent_id&&e.status));N(t.data.result[0].filter((e=>1===e.is_diamond_category)));const a=[];s.map((s=>{const c=t.data.result[0].filter((e=>e.parent_id===s.id&&e.status)),r=[];c.map((s=>{const a=t.data.result[0].filter((e=>e.parent_id===s.id&&e.status)),c=[];a.map((s=>{const a=t.data.result[0].filter((e=>e.parent_id===s.id&&e.status)),r=[];a.map((s=>{const a=t.data.result[0].filter((e=>e.parent_id===s.id&&e.status)),c=[];a.map((t=>{let s=!1;return(void 0!==u.id&&z.category_id===t.id||e===t.id)&&(s=!0),c.push({label:t.name,value:t.id,checked:s}),!0}));let l=!1;return(void 0!==u.id&&z.category_id===s.id||e===s.id)&&(l=!0),r.push({label:s.name,value:s.id,checked:l,children:c}),!0}));let l=!1;return(void 0!==u.id&&z.category_id===s.id||e===s.id)&&(l=!0),c.push({label:s.name,value:s.id,checked:l,children:r}),!0}));let l=!1;return(void 0!==u.id&&z.category_id===s.id||e===s.id)&&(l=!0),r.push({label:s.name,value:s.id,checked:l,children:c}),!0}));let l=!1;return(void 0!==u.id&&z.category_id===s.id||e===s.id)&&(l=!0),a.push({label:s.name,value:s.id,children:r,checked:l}),!0})),x(a)}}))},V=()=>{m(!0),a.getApi(c.GetAdminNavigationMenuList).then((e=>{m(!1);const t=e.data.result[0].filter((e=>e.status)),s=e.data.result[0].filter((e=>0===e.status));S(s),w(t);const a=t.filter((e=>0===e.parent_id)),c=[];a.sort(((e,t)=>{let{sort_order:s}=e,{sort_order:a}=t;return s-a})).map((e=>{const s=t.filter((t=>t.parent_id===e.id)),a=[];return s.sort(((e,t)=>{let{sort_order:s}=e,{sort_order:a}=t;return s-a})).map((e=>{const s=t.filter((t=>t.parent_id===e.id)),c=[];return s.sort(((e,t)=>{let{sort_order:s}=e,{sort_order:a}=t;return s-a})).map((e=>{const s=t.filter((t=>t.parent_id===e.id)),a=[];return s.sort(((e,t)=>{let{sort_order:s}=e,{sort_order:a}=t;return s-a})).map((e=>(a.push({id:e.id,text:e.title,slug:e.slug,css_class:e.css_class,updated_at:e.updated_at,page_update_priority:e.page_update_priority}),!0))),c.push({id:e.id,text:e.title,children:a,image:e.image,slug:e.slug,updated_at:e.updated_at,css_class:e.css_class,page_update_priority:e.page_update_priority}),!0})),a.push({id:e.id,text:e.title,children:c,image:e.image,slug:e.slug,updated_at:e.updated_at,css_class:e.css_class,page_update_priority:e.page_update_priority}),!0})),c.push({id:e.id,text:e.title,children:a,image:e.image,slug:e.slug,updated_at:e.updated_at,css_class:e.css_class,page_update_priority:e.page_update_priority}),!0})),A(c)}))},K=()=>{m(!0),a.getApi(c.GetContentManagementList).then((e=>{m(!1);let t=e.data.result;t=t.filter((e=>1===e.status)),_(t)}))},W={position:"relative",padding:"10px 15px",fontSize:"15px",border:"1px solid #f9fafa",background:"#f9fafa",cursor:"pointer"},Y={padding:"10px 15px",fontSize:"15px",border:"1px solid #f9fafa",background:"#f9fafa",cursor:"pointer"},Q=(e,t)=>{sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t};m(!0),a.postApi(c.DeleteNavigationMenuItem,e).then((e=>{m(!0),V()}))}}))},X=e=>{U(B),E(!I)},J=e=>{const t=e.target.name,s=e.target.value;U("status"===t?{...z,[t]:e.target.checked}:{...z,[t]:s}),E(!I),ee()},Z=e=>{R.current.allValid()||(R.current.showMessages(),E(!I))},$=e=>{m(!0),a.postApi(c.GetBlogs,{page:0,search:"",page_size:0,sort_column:"",sort_direction:""}).then((e=>{m(!1),!0===e.data.status&&""!==e.data.result?(G(e.data.result[1]),E(!I)):G([])}))},ee=e=>{h.map(((e,t)=>(e.value===z.category_id?h[t].checked=!0:h[t].checked=!1,e.children&&e.children.map(((e,s)=>(e.value===z.category_id?h[t].children[s].checked=!0:h[t].children[s].checked=!1,!0))),!0)))};return!t||n?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0 d-flex align-items-center",children:[" ",r.NavigationMenu," ",z.title?Object(g.jsxs)("small",{className:"ml-2 mb-0",children:["(",z.title,")"]}):""," "]}),Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{const e=[],t="https://staging.harmonyjewels.co.uk/".replace(/\/$/,""),s=[{url:t+"/contact-us",priority:1,lastmod:"daily"},{url:t+"/blogs",priority:1,lastmod:"daily"},{url:t+"/ring-size-chart",priority:1,lastmod:"daily"}];let r=oi.a.create("urlset");r.att("xmlns","http://www.sitemaps.org/schemas/sitemap/0.9"),r.att("xmlns:xhtml","http://www.w3.org/1999/xhtml"),r.ele("url").ele("loc",t).up().ele("lastmod","daily").up().ele("priority",1).up().end({pretty:!0}),e.push(t),C.map(((s,a)=>{const c=null===s.page_update_priority||"null"===s.page_update_priority||""===s.page_update_priority||s.slug.includes("?")?.8:s.page_update_priority,l=1===c?"daily":s.updated_at;return null!==s.slug&&!e.includes(s.slug)&&!s.slug.includes("?")&&c>=0&&(r.ele("url").ele("loc",t+s.slug).up().ele("lastmod",l).up().ele("priority",c).up().end({pretty:!0}),e.push(s.slug)),s.children.length>0&&s.children.map(((s,a)=>{const c=null===s.page_update_priority||"null"===s.page_update_priority||""===s.page_update_priority||s.slug.includes("?")?.8:s.page_update_priority,l=1===c?"daily":s.updated_at;return null!==s.slug&&!e.includes(s.slug)&&!s.slug.includes("?")&&c>=0&&(r.ele("url").ele("loc",t+s.slug).up().ele("lastmod",l).up().ele("priority",c).up().end({pretty:!0}),e.push(s.slug)),s.children.length>0&&s.children.map(((s,a)=>{const c=null===s.page_update_priority||"null"===s.page_update_priority||""===s.page_update_priority||s.slug.includes("?")?.8:s.page_update_priority,l=1===c?"daily":s.updated_at;return null!==s.slug&&!e.includes(s.slug)&&!s.slug.includes("?")&&c>=0&&(r.ele("url").ele("loc",t+s.slug).up().ele("lastmod",l).up().ele("priority",c).up().end({pretty:!0}),e.push(s.slug)),!0})),!0})),!0})),f.map(((s,a)=>{if(!e.includes(s.slug)&&"/notfound"!==s.slug){const e=null!==s.page_update_priority&&"null"!==s.page_update_priority&&""!==s.page_update_priority?s.page_update_priority:.8,a=1===e?"daily":s.updated_at;e>=0&&r.ele("url").ele("loc",t+s.slug).up().ele("lastmod",a).up().ele("priority",e).up().end({pretty:!0})}return!0})),O.map(((s,a)=>{if(!e.includes(s.slug)){const e=null!==s.page_update_priority&&"null"!==s.page_update_priority&&""!==s.page_update_priority?s.page_update_priority:.8,a=1===e?"daily":null!==s.updated_at?s.updated_at:s.created_at;e>=0&&r.ele("url").ele("loc",t+s.slug).up().ele("lastmod",a).up().ele("priority",e).up().end({pretty:!0})}return!0})),s.map(((e,t)=>(r.ele("url").ele("loc",e.url).up().ele("lastmod",e.lastmod).up().ele("priority",e.priority).up().end({pretty:!0}),!0))),L.map(((e,s)=>{const a=null!==e.updated_at?e.updated_at:e.created_at;return r.ele("url").ele("loc",t+"/blog/"+e.slug).up().ele("lastmod",a).up().ele("priority",.8).up().end({pretty:!0}),!0})),r=r.end({pretty:!0});const n={content:r};return m(!0),a.postApi(c.GenerateSitemap,n).then((e=>{m(!1),e.data.status&&sc()({title:l.SitemapGenerated})})),!0},children:"Generate Sitemap"}),void 0!==u.id&&Object(g.jsxs)(b.b,{to:"/system/navigation-menu",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","New Menu"," "]})]})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{className:"forms-sample",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",onChange:J,value:z.title||"",placeholder:"Title"}),M.current.message("Title",z.title,"required|max:50",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"description",onChange:J,value:z.description||"",placeholder:"Description"}),M.current.message("Description",z.description,"required|max:1000",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Menu Type"}),Object(g.jsxs)("select",{className:"form-control",name:"menu_type",onChange:J,value:z.menu_type,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"category",children:"Category"}),Object(g.jsx)("option",{value:"page",children:"Page"}),Object(g.jsx)("option",{value:"custom_link",children:"Custom Link"}),Object(g.jsx)("option",{value:"blank",children:"Blank"})]})]}),Object(g.jsxs)("div",{className:"form-group",style:"category"===z.menu_type?{}:{display:"none"},children:[Object(g.jsx)("label",{children:"Category"}),h.length>0&&Object(g.jsx)(ei.a,{multi:!1,data:h,onChange:(e,t)=>{t.length>0&&(z.category_id=t[0].value)},mode:"radioSelect",className:"bootstrap-demo",texts:{placeholder:"Select"}})]}),Object(g.jsxs)("div",{className:"form-group",style:"page"===z.menu_type?{}:{display:"none"},children:[Object(g.jsx)("label",{children:"Page"}),Object(g.jsx)("select",{className:"form-control",name:"page_id",onChange:J,value:z.page_id,children:f.map((e=>Object(g.jsx)("option",{value:e.id,children:e.title},e.id)))})]}),Object(g.jsxs)("div",{className:"form-group",style:"custom_link"===z.menu_type?{}:{display:"none"},children:[Object(g.jsx)("label",{children:"Custom Link"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"link",onChange:J,value:z.link||"",placeholder:"Custom Link"}),R.current.message("Custom Link",z.link,"required|max:255",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Parent"}),Object(g.jsxs)("select",{className:"form-control",name:"parent_id",onChange:J,value:z.parent_id,children:[Object(g.jsx)("option",{value:"0",children:"Choose"}),y.map((e=>Object(g.jsx)("option",{value:e.id,children:""!==e.parent_menu&&null!==e.parent_menu?e.title+" - "+e.parent_menu:e.title},e.id)))]})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Sort Order"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"sort_order",onChange:J,value:z.sort_order,placeholder:"Sort Order",min:"0"}),M.current.message("Sort Order",z.sort_order,"required|numeric|min:0,num",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Menu Column"}),Object(g.jsx)("input",{type:"number",className:"form-control",name:"menu_column",onChange:J,value:z.menu_column||"",placeholder:"Menu Column",min:"0"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Parameters"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"parameters",onChange:J,value:z.parameters||"",placeholder:"Parameters"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("label",{children:["Image Name for Menu",Object(g.jsxs)("svg",{"data-toggle":"tooltip","data-html":"true",title:"Add class name for individual icon. Ex:1. 'icon-1(row 1)-1(col 1)' look like class name 'icon-1-1', Ex:2. 'icon-1(row 1)-2(col 2)' look like class name 'icon-1-2'
",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#000000d4",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-info ml-1 cursor",children:[Object(g.jsx)("circle",{cx:"12",cy:"12",r:"10"}),Object(g.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),Object(g.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})]}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"css_class",onChange:J,value:z.css_class||"",placeholder:"CSS Class"}),M.current.message("CSS Class",z.css_class,"max:200",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:J,id:"EnableMenu",checked:z.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableMenu",children:" "})]})})]}),Object(g.jsxs)("button",{type:"button",onClick:e=>{var t;if(!M.current.allValid())return M.current.showMessages(),"custom_link"===z.menu_type&&Z(),void E(!I);"custom_link"===z.menu_type&&Z();const s={id:z.id,title:z.title,description:z.description,menu_type:z.menu_type,link:z.link,category_id:z.category_id,page_id:z.page_id,image:F,css_class:z.css_class,status:z.status,parent_id:z.parent_id,menu_column:Number(z.menu_column),parameters:null!==(t=z.parameters)&&void 0!==t?t:"",sort_order:z.sort_order};void 0===u.id?(m(!0),a.postApi(c.AddNavigationMenuItem,s).then((e=>{if(m(!1),null!==e.data.result){const t=e.data.result[0][0].result,s=C;s.push({id:t,text:z.title}),A(s),V(),M.current.hideMessages(),X(),M.current.hideMessages(),gl.b.success(l.MenuAdded),E(!I),window.scrollTo(0,0)}}))):(m(!0),a.postApi(c.UpdateNavigationMenu,s).then((e=>{m(!1),null!==e&&(V(),M.current.hideMessages(),gl.b.success(l.MenuUpdated),M.current.hideMessages(),window.scrollTo(0,0))})))},className:"btn btn-custom text-white mt-5 mr-2",children:[" ",void 0===u.id?"Add to Menu":"Update Menu"," "]})]}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)(ai.a,{items:C,renderItem:e=>Object(g.jsxs)("div",{style:W,children:[e.handler,e.collapseIcon,Object(g.jsx)("span",{className:"menu-icon nav-"+e.item.css_class}),e.item.text,Object(g.jsxs)(b.b,{to:"#",onClick:t=>Q(t,e.item.id),className:"text-dark float-right",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{to:"/system/navigation-menu/edit/"+e.item.id,className:"text-dark float-right mr-2",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]})]}),collapsed:j,onChange:e=>{const t=[];e.items.map(((e,s)=>(t.push({id:e.id,parent_id:0,sort_order:s}),e.children&&e.children.map(((s,a)=>(t.push({id:s.id,parent_id:e.id,sort_order:a}),s.children&&s.children.map(((e,a)=>(t.push({id:e.id,parent_id:s.id,sort_order:a}),e.children&&e.children.map(((e,s)=>(t.push({id:e.id,parent_id:e.id,sort_order:s}),!0))),!0))),!0))),!0))),T=t,D(!1)},maxDepth:4})}),Object(g.jsx)("div",{className:"col-md-12 mb-5",children:Object(g.jsxs)("button",{type:"button",onClick:e=>{const t={menu_items:T};m(!0),a.postApi(c.UpdateNavigationMenuOrder,t).then((e=>{if(m(!1),e.data.message)return gl.b.warning(e.data.message),void E(!I);M.current.hideMessages(),V(),gl.b.success(l.MenuUpdated)}))},className:"btn btn-custom text-white mr-2 float-right mt-4",disabled:P,children:[" ","Save Menu"," "]})}),Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsx)("label",{className:"mt-5",children:"Disabled Menus"}),Object(g.jsx)(ai.a,{className:"customNestable",items:k,renderItem:e=>Object(g.jsxs)("div",{style:Y,children:[e.handler,e.collapseIcon,Object(g.jsx)("span",{className:"menu-icon nav-"+e.item.css_class}),e.item.title,Object(g.jsxs)(b.b,{to:"#",onClick:t=>Q(t,e.item.id),className:"text-dark float-right",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{to:"/system/navigation-menu/edit/"+e.item.id,className:"text-dark float-right mr-2",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]})]}),collapsed:j})]})]})]})})})})})})]})};var Ko=()=>{var e=Object(d.useState)({Name:"123"}),t=Object(d.useState)({}),s=[];const n=Object(p.useLocation)(),i=Object(p.useParams)(),o=new URLSearchParams(n.search),m=o.get("name"),u=o.get("email"),j=o.get("page"),[h,x]=Object(d.useState)(!0),[O,N]=Object(d.useState)(!1),f=Object(p.useHistory)(),_=Object(d.useRef)(),y=Object(d.useRef)(new ec.a),w=Object(d.useRef)(new ec.a),[k,S]=Object(d.useState)(!1),[C,A]=Object(d.useState)(!1),[P,D]=Object(d.useState)(!1),[,M]=Object(d.useState)(!1),[R,F]=Object(d.useState)(""),[,I]=Object(d.useState)([]),[E,L]=Object(d.useState)([]),[G,T]=Object(d.useState)([]),[B,z]=Object(d.useState)([]),[U,q]=Object(d.useState)([]),[H,V]=Object(d.useState)([]),[K,W]=Object(d.useState)([]),[Y,Q]=Object(d.useState)(!1),[X,J]=Object(d.useState)(r.AddCustomerAddress),[Z,$]=Object(d.useState)([]),[ee,te]=Object(d.useState)(1),[se,ae]=Object(d.useState)(10),[ce,re]=Object(d.useState)(),[le,ne]=Object(d.useState)(),[ie,oe]=Object(d.useState)(!1),[de,me]=Object(d.useState)(""),[ue,je]=Object(d.useState)({id:0,firstname:"",lastname:"",password:"",confirm_password:"",contact_number:"",email:"",status:0,dob:"",gender:"",profile_picture:"",is_subscribed:0,is_confirmed:1,group_id:0,default_billing:0,default_shipping:0}),[be,pe]=Object(d.useState)({id:0,customer_id:void 0!==i.id?i.id:0,firstname:"",lastname:"",street:"",country_id:"",state_id:"",city_id:"",postcode:"",contact_number:"",status:0,default_billing_address:0,default_shipping_address:0}),he=[{name:"Email",selector:e=>e.email},{name:"Order Number",selector:e=>e.order_number},{name:"Total",selector:e=>e.final_price},{name:"Quantity",selector:e=>e.qty},{name:"Order Status",selector:e=>e.order_status},{name:"Order Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/order/view/order_id/"+e.order_number,className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," "]}),void 0!==e.invoice_path&&""!==e.invoice_path?Object(g.jsxs)("a",{href:e.invoice_path,className:"text-dark",title:"Invoice",children:[Object(g.jsx)("i",{className:"fa fa-file-pdf-o","aria-hidden":"true"})," "]}):""]})}];Object(d.useEffect)((()=>{N(!0),document.title=r.AddCustomer,void 0!==i.id&&(document.title=r.EditCustomer,Ce(),Ne(),we(),ke(),Se(),ge()),ve()}),[i.id,se,ee]);const xe=e=>{te(e)},Oe=e=>{ae(e)},ge=()=>{var e={page:ee,page_size:se,customer_id:void 0!==i.id?parseInt(i.id):0};x(!0),a.postApi(c.GetOrderAdminLists,e).then((e=>{x(!1);var t=e.data.result[1];$(t),re(t.length),D(!P)}))},ve=()=>{x(!0),a.postApi(c.GetCustomerGroups,null).then((e=>{x(!1),I(e.data.result[0])}))},Ne=()=>{var e={id:i.id};x(!0),a.postApi(c.GetCustomerDetail,e).then((e=>{(x(!1),e.data.result)&&(e.data.result.map((e=>Object.keys(e).map((function(t,s){if("dob"===t){var a=new Date(e[t]);ue[t]=a.toISOString().split("T")[0]}else"password"!==t&&(ue[t]=e[t]);return!0})))),D(!P))}))};Object(d.useEffect)((()=>{}),[ue]),Object(d.useEffect)((()=>{D(!P)}),[K]);const fe=e=>t=>{oe(!1),je("status"===e||"is_subscribed"===e?{...ue,[e]:t.target.checked}:{...ue,[e]:t.target.value}),D(!P)},_e=e=>{const t=e.target.name,s=e.target.value;if("status"===t||"default_billing_address"===t||"default_shipping_address"===t)be[t]=e.target.checked;else if("country_id"===t){be.state_id="",be.city_id="";const e=G.filter((e=>e.country_id===parseInt(s)));q(e);const a=B.filter((e=>e.state_id===ue.state_id&&e.country_id===parseInt(s)));V(a),be[t]=s,be.state_id="",be.city_id=""}else if("state_id"===t){const e=B.filter((e=>e.state_id===parseInt(s)&&e.country_id===parseInt(be.country_id)));V(e),be[t]=s,be.city_id=""}else be[t]=s;D(!P)},ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e.preventDefault(),Ae(),null==t)J(r.AddCustomerAddress),Object.keys(be).map((function(e,t){return be[e]="",!0})),D(!P);else{J(r.EditCustomerAddress);var s=K.filter((e=>e.customer_id===parseInt(i.id)&&e.id===parseInt(t)));s.length>0&&s.map((e=>Object.keys(e).map((function(t,s){return be[t]=e[t],!0})))),D(!P);var a=G.filter((e=>e.country_id===parseInt(be.country_id)));q(a);var c=B.filter((e=>e.state_id===parseInt(be.state_id)&&e.country_id===parseInt(be.country_id)));V(c),D(!P)}Q(!0)},we=e=>{x(!0),a.getApi(c.GetCountryList).then((e=>{x(!1),L(e.data.result)}))},ke=e=>{x(!0),a.getApi(c.GetStateList).then((e=>{x(!1),T(e.data.result)}))},Se=e=>{x(!0),a.getApi(c.GetCityList).then((e=>{x(!1),z(e.data.result)}))},Ce=r=>{var l={customer_id:i.id,page:ee,page_size:se};x(!0),a.postApi(c.GetAddresses,l).then((a=>{x(!1);var c=a.data.result;W(c[1]),c.length>0&&(ne(c[0][0].total),c.forEach((a=>{!0===a.default_shipping&&(t.Name=a.firstname+" "+a.lastname,t.Address=a.street+", "+a.city+", "+a.postcode,t.Address1=a.state+", "+a.country,s.push(t)),a.default_billing&&(e.Name=a.firstname+" "+a.lastname,e.Address=a.street+", "+a.city+", "+a.postcode,e.Address1=a.state+", "+a.country,s.push(e))})))}))},Ae=e=>{w.current.hideMessages(),pe(be),D(!P)};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){ao(e.detail.cachedFileArray[0],(e=>{F(e)})),M(!0)})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){F(""),M(!1)}));const Pe=()=>{f.push("/customers",{state:{page:0===parseInt(j)?1:parseInt(j),name:m,email:u}})};return!O||h?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0===i.id?r.AddCustomer:r.EditCustomer," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:Pe,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("ul",{className:"nav nav-tabs mb-3",id:"customer-tab",role:"tablist",children:[Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link active","data-toggle":"tab",href:"#account-information",role:"tab","aria-controls":"account-information",children:"Account Information"})}),void 0!==i.id&&Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link","data-toggle":"tab",href:"#addresses",role:"tab","aria-controls":"addresses",children:"Addresses"})}),Object(g.jsx)("li",{className:"nav-item",children:Object(g.jsx)("a",{className:"nav-link","data-toggle":"tab",href:"#orders",role:"tab","aria-controls":"orders",children:"Orders"})})]})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"tab-content",children:[Object(g.jsx)("div",{className:"tab-pane active",id:"account-information",role:"tabpanel",children:Object(g.jsxs)("form",{className:"forms-sample",autoComplete:"off",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsx)("h3",{className:"page-title",children:"Account Information"})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"First Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"firstname",min:"1",maxLength:"255",onChange:fe("firstname"),onKeyUp:fe("firstname"),onBlur:()=>y.current.showMessageFor("First Name"),value:ue.firstname,placeholder:"First Name"}),y.current.message("First Name",ue.firstname,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Last Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"lastname",min:"1",maxLength:"255",onChange:fe("lastname"),onKeyUp:fe("lastname"),onBlur:()=>y.current.showMessageFor("Last Name"),value:ue.lastname,placeholder:"Last Name"}),y.current.message("Last Name",ue.lastname,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Email"}),Object(g.jsx)("input",{type:"email",className:"form-control",name:"email",min:"1",maxLength:"255",onChange:fe("email"),onKeyUp:fe("email"),onBlur:()=>y.current.showMessageFor("Email"),value:ue.email,placeholder:"Email"}),y.current.message("Email",ue.email,"required|email",{className:"error"}),ie?Object(g.jsx)("label",{className:"text-danger mt-2",children:de}):""]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Contact Number"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"contact_number",minLength:10,maxLength:15,onChange:fe("contact_number"),onKeyUp:fe("contact_number"),onBlur:()=>y.current.showMessageFor("Contact Number"),value:ue.contact_number,placeholder:"Contact Number"}),y.current.message("Contact Number",ue.contact_number,"required|phone",{className:"error"})]})}),void 0===i.id?Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Password"}),Object(g.jsx)("input",{type:k?"text":"password",className:"form-control",name:"password",minLength:"8",maxLength:"12",onChange:fe("password"),placeholder:"Password",autoComplete:"new-password"}),Object(g.jsx)("span",{className:k?"fa-eye fa fa-fw field-icon toggle-password":"fa-eye-slash fa fa-fw field-icon toggle-password",onClick:()=>S((e=>!e))}),void 0!==i.id?y.current.message("Password",ue.password,"min:8|max:12",{className:"error"}):y.current.message("Password",ue.password,"required|min:8|max:12",{className:"error"}),Object(g.jsx)(ri.a,{password:void 0===i.id?ue.password:""})]})}):"",void 0===i.id?Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Confirm Password"}),Object(g.jsx)("input",{type:C?"text":"password",className:"form-control",name:"confirm_password",onChange:fe("confirm_password"),placeholder:"Confirm Password",minLength:"8",maxLength:"12"}),Object(g.jsx)("span",{className:C?"fa-eye fa fa-fw field-icon toggle-password":"fa-eye-slash fa fa-fw field-icon toggle-password",onClick:()=>A((e=>!e))}),void 0!==i.id&&ue.password.length<1?y.current.message("Confirm Password",ue.confirm_password,"min:8|max:12|in:".concat(ue.password),{className:"error",messages:{in:"Not matched with password!"}}):y.current.message("Confirm Password",ue.confirm_password,"required|min:8|max:12|in:".concat(ue.password),{className:"error",messages:{in:"Not matched with password!"}})]})}):"",Object(g.jsxs)("div",{className:"col-md-4",children:[Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:fe("status"),id:"EnableProduct",checked:ue.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]}),Object(g.jsx)("div",{className:"form-group row",children:Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsx)("div",{className:"form-check",children:Object(g.jsxs)("label",{className:"form-check-label",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input",name:"is_subscribed",checked:ue.is_subscribed,onChange:fe("is_subscribed")})," ","Sign Up for Newsletter ",Object(g.jsx)("i",{className:"input-helper"})]})})})})]})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{if(!y.current.allValid())return y.current.showMessages(),void D(!P);var t={id:ue.id,firstname:ue.firstname.trim(),lastname:ue.lastname.trim(),password:ue.password,contact_number:ue.contact_number,email:ue.email,profile_picture:R,dob:ue.dob,gender:ue.gender,is_subscribed:ue.is_subscribed?1:0,is_confirmed:1,group_id:ue.group_id,status:ue.status?1:0,social_id:""};x(!0),ue.password.length>0&&(t.password=ue.password),void 0===i.id?a.postApi(c.AddCustomer,t).then((e=>{if(""!==e.data.message)return oe(!0),me(e.data.message),x(!1),void D(!P);x(!1),gl.b.success(l.RecordAdded),D(!P),f.push("/customers",{state:{page:0===parseInt(j)?1:parseInt(j),name:m,email:u}})})):a.postApi(c.UpdateCustomer,t).then((e=>{if(""!==e.data.message)return oe(!0),me(e.data.message),x(!1),void D(!P);x(!1),gl.b.success(l.RecordUpdated),D(!P),f.push("/customers",{state:{page:0===parseInt(j)?1:parseInt(j),name:m,email:u}})}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)("button",{type:"button",onClick:Pe,className:"btn btn-primary",children:"Cancel"})]})})]})}),void 0!==i.id&&Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("div",{className:"tab-pane",id:"addresses",role:"tabpanel",children:Object(g.jsxs)("div",{className:"pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Addresses," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",onClick:ye,className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add New Address"," "]})})]}),Object(g.jsxs)("div",{className:"row g-4 Test",children:[K.map(((e,t)=>!e.default_shipping_address||[Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"my-4 address-details",children:[Object(g.jsx)("h4",{children:"Shipping Address"}),Object(g.jsx)("p",{children:Object(g.jsxs)("strong",{children:[" ",e.firstname+" "+e.lastname]})}),Object(g.jsx)("p",{children:e.street+", "+e.city+", "+e.postcode}),Object(g.jsx)("p",{children:e.state+", "+e.country}),Object(g.jsxs)("p",{children:[Object(g.jsx)("i",{className:"fa fa-phone"}),"\xa0",e.contact_number]})]})},Math.random())])),K.map(((e,t)=>!e.default_billing_address||[Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"my-4 address-details",children:[Object(g.jsx)("h4",{children:"Billing Address"}),Object(g.jsx)("p",{children:Object(g.jsxs)("strong",{children:[" ",e.firstname+" "+e.lastname]})}),Object(g.jsx)("p",{children:e.street+", "+e.city+", "+e.postcode}),Object(g.jsx)("p",{children:e.state+", "+e.country}),Object(g.jsxs)("p",{children:[Object(g.jsx)("i",{className:"fa fa-phone"}),"\xa0",e.contact_number]})]})},Math.random())]))]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:[{name:"First Name",wrap:!0,selector:e=>e.firstname},{name:"Last Name",wrap:!0,selector:e=>e.lastname},{name:"Street",wrap:!0,selector:e=>e.street},{name:"City",wrap:!0,selector:e=>e.city},{name:"State",wrap:!0,selector:e=>e.state},{name:"Country",wrap:!0,selector:e=>e.country},{name:"Post Code",wrap:!0,selector:e=>e.postcode},{name:"Status",field:"status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"",onClick:t=>ye(t,e.id),className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>(async(e,t)=>{e.preventDefault(),sc()({title:l.ConfirmDelete,text:l.MessageDelete,buttons:{cancel:!0,confirm:!0}}).then((function(e){if(e){var s={id:t};x(!0),a.postApi(c.DeleteAddress,s).then((e=>{x(!1),gl.b.success(l.RecordDeleted),Ce()}))}}))})(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],data:K,pagination:!0,paginationServer:!0,paginationTotalRows:le,onChangeRowsPerPage:Oe,onChangePage:xe,persistTableHead:!0,progressPending:h,progressComponent:Object(g.jsx)(v,{})})})})})})})]})}),Object(g.jsx)("div",{className:"tab-pane",id:"orders",role:"tabpanel",children:Object(g.jsxs)("div",{className:"",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsx)("h3",{className:"page-title",children:"Orders"})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:he,data:Z,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:ce,onChangeRowsPerPage:Oe,onChangePage:xe,progressPending:h,progressComponent:Object(g.jsx)(v,{})})})})})})})]})})]})]})})]})})})})}),i.id&&Object(g.jsxs)(li.a,{size:"md",show:Y,onHide:()=>Q(!1),"aria-labelledby":"edit-address-modal",children:[Object(g.jsx)(li.a.Header,{closeButton:!0,children:Object(g.jsx)(li.a.Title,{id:"edit-address-modal",children:X})}),Object(g.jsx)(li.a.Body,{children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"First Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"firstname",onChange:_e,value:be.firstname,placeholder:"First Name"}),w.current.message("First Name",be.firstname,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Last Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"lastname",onChange:_e,value:be.lastname,placeholder:"Last Name"}),w.current.message("Last Name",be.lastname,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Street"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"street",onChange:_e,value:be.street,placeholder:"Street"}),w.current.message("Street",be.street,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Country"}),Object(g.jsxs)("select",{className:"form-control",name:"country_id",onChange:_e,value:be.country_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),E.map((e=>Object(g.jsx)("option",{value:e.id,children:e.name},e.id)))]}),w.current.message("Country",be.country_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"State"}),Object(g.jsxs)("select",{className:"form-control",name:"state_id",onChange:_e,value:be.state_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),U.map((e=>Object(g.jsx)("option",{value:e.id,children:e.name},e.id)))]}),w.current.message("State",be.state_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"City"}),Object(g.jsxs)("select",{className:"form-control",name:"city_id",onChange:_e,value:be.city_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),H.map((e=>Object(g.jsx)("option",{value:e.id,children:e.name},e.id)))]}),w.current.message("City",be.city_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Post Code"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"postcode",onChange:_e,value:be.postcode,placeholder:"Post Code"}),w.current.message("Post Code",be.postcode,"required|alpha_num|min:5|max:6",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:_e,id:"AddressStatus",checked:be.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"AddressStatus",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Contact Number"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"contact_number",onChange:_e,value:be.contact_number,placeholder:"Contact Number"}),w.current.message("Contact Number",be.contact_number,"required|phone",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Default Billing Address"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"default_billing_address",onChange:_e,id:"DefaultBillingAddress",checked:be.default_billing_address}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"DefaultBillingAddress",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Default Shipping Address"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"default_shipping_address",onChange:_e,id:"DefaultShippingAddress",checked:be.default_shipping_address}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"DefaultShippingAddress",children:" "})]})})]})})]})}),Object(g.jsxs)(li.a.Footer,{children:[Object(g.jsx)(ni.a,{variant:"primary",onClick:e=>{if(!w.current.allValid())return w.current.showMessages(),void D(!P);var t={id:be.id,customer_id:i.id,firstname:be.firstname,lastname:be.lastname,street:be.street,country:be.country_id,state_id:be.state_id,city_id:be.city_id,postcode:be.postcode,contact_number:be.contact_number,status:""!==be.status&&null!==be.status&&!1!==be.status?1:0,default_billing:be.default_billing_address,default_shipping:be.default_shipping_address};_.current&&_.current.setAttribute("disabled","disabled"),null===be.id||0===be.id||""===be.id?(x(!0),a.postApi(c.AddAddress,t).then((e=>{if(x(!1),_.current&&_.current.removeAttribute("disabled"),e.data.message)return gl.b.warning(e.data.message),void D(!P);gl.b.success(l.RecordAdded),Q(!1),Ce()}))):(x(!0),a.postApi(c.UpdateAddress,t).then((e=>{if(x(!1),e.data.message)return gl.b.warning(e.data.message),void D(!P);gl.b.success(l.RecordUpdated),Q(!1),Ce(),Ae(),D(!P)})))},ref:_,children:"Submit"}),Object(g.jsx)(ni.a,{variant:"light",onClick:()=>Q(!1),children:"Close"})]})]})]})};var Wo=()=>{var e,t,s,n;const i=Object(p.useLocation)(),[o,u]=Object(d.useState)([]),[j,h]=Object(d.useState)(!1),[x]=Object(d.useState)([]),[O,N]=Object(d.useState)(!1),[f,_]=Object(d.useState)(!0),[y,w]=Object(d.useState)(!1),[k,S]=Object(d.useState)(i.state?0===parseInt(i.state.state.page)?1:parseInt(i.state.state.page):1),C=[{name:"First Name",sortable:!0,sortField:"firstname",warp:!0,selector:e=>e.firstname},{name:"Email",sortable:!0,sortField:"email",selector:e=>e.email,wrap:!0},{name:"Contact Number",selector:e=>e.contact_number},{name:"Is Guest",selector:e=>1===e.is_guest?Object(g.jsx)("label",{children:"Yes"}):Object(g.jsx)("label",{children:"No"})},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/customers/edit/"+e.id+"?name="+M.name+"&email="+M.email+"&page="+M.page,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),e.status?Object(g.jsxs)(b.b,{onClick:t=>G(t,e.id,0),to:"",className:"text-dark",title:"Inactive",children:[Object(g.jsx)("i",{className:"fa fa-ban","aria-hidden":"true"})," "]}):Object(g.jsxs)(b.b,{onClick:t=>G(t,e.id,1),to:"",className:"text-dark",title:"Active",children:[Object(g.jsx)("i",{className:"fa fa-check","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>L(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}];console.log(i);const A={customergroup:"",name:void 0!==(null===(e=i.state)||void 0===e||null===(t=e.state)||void 0===t?void 0:t.name)?i.state.state.name:"",email:void 0!==(null===(s=i.state)||void 0===s||null===(n=s.state)||void 0===n?void 0:n.email)?i.state.state.email:"",page:k,search:"",page_size:10,sort_column:"",sort_direction:""};console.log(A);const[P,D]=Object(d.useState)(A),[M,R]=Object(d.useState)(A),[F,I]=Object(d.useState)();Object(d.useEffect)((()=>{w(!0),document.title=r.Customers,E(),T()}),[M]);const E=()=>{const e={customergroup:M.customergroup,name:M.name,email:M.email,page:M.page,search:M.search,page_size:M.page_size,sort_column:M.sort_column,sort_direction:M.sort_direction};_(!0),a.postApi(c.GetCustomerAdminList,e).then((e=>{if(_(!1),!0===e.data.status){const t=e.data.result[1];u(t),h(!j),I(e.data.result[0][0].total_row)}}))},L=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t};_(!0),a.postApi(c.DeleteCustomer,e).then((e=>{_(!1),!0===e.data.status&&(gl.b.success(l.RecordDeleted),E())}))}}))},G=async(e,t,s)=>{e.preventDefault(),sc()({title:l.Confirm,text:s?l.ConfirmEnable:l.ConfirmDisable,buttons:{cancel:!0,confirm:!0}}).then((function(e){if(e){const e={id:t,status:s};_(!0),a.postApi(c.ChangeCustomerStatus,e).then((e=>{_(!1),gl.b.success(l.RecordUpdated),E()}))}}))},T=()=>{_(!0),a.postApi(c.GetCustomerGroups,null).then((e=>{_(!1);const t=[];e.data.result[0].map(((e,s)=>(t.push({label:e.name,value:e.id}),!0))),Object.assign(x,t)}))},B=(e,t)=>{"customergroup"===t?Object.assign(M,{[t]:e}):Object.assign(M,{[t]:e.target.value}),D({...P,[t]:e.target.value})},z=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For First Name, Email, Contact Number.",className:"form-control col-md-3",placeholder:"Search",value:M.search,onChange:e=>R({...M,page:k,search:e.target.value})})));return y?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Customers," "]}),Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)(b.b,{to:"/customers/add?name="+M.name+"&email="+M.email+"&page="+M.page,className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Customer"," "]}),Object(g.jsxs)(b.b,{to:"#",onClick:()=>{N(!O)},className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})]})]}),Object(g.jsx)("div",{className:O?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Name"})}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:e=>B(e,"name"),value:P.name})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Email"})}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"email",onChange:e=>B(e,"email"),value:P.email})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4 mt-4",children:Object(g.jsxs)("div",{className:"btn-group",children:[Object(g.jsxs)(b.b,{to:"#",className:"btn btn-custom text-white btn-fw-130 rounded mr-2",onClick:e=>E(e),children:[" ","Apply"," "]}),Object(g.jsxs)(b.b,{to:"#",className:"btn btn-primary btn-fw-130 rounded mr-2",onClick:e=>(R(A),D(A),void h(!j)),children:[" ","Reset"]})]})})]})})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.postApi(c.GetCustomerExcel).then((e=>{e.data.result&&co(e.data.result[0],"Customers")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:C,data:o,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:F,onChangeRowsPerPage:e=>{S(1),R({...M,page:1,page_size:e})},onChangePage:e=>{S(e),R({...M,page:e})},paginationDefaultPage:k,subHeader:!0,progressPending:f,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:z,onSort:(e,t)=>{R({...M,sort_column:e.sortField,sort_direction:t})}})})]})})})})]}):Object(g.jsx)(v,{})};var Yo=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),p=[{name:"Name",sortable:!0,sortField:"name",selector:e=>e.name},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:"general"!==e.name.toLowerCase()?Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/customer-group/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>y(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]}):"-"})}],[h,x]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[O,N]=Object(d.useState)();Object(d.useEffect)((()=>{o(!0),f(),document.title=r.CustomerGroup}),[h]);const f=()=>{const e={page:h.page,search:h.search,page_size:h.page_size,sort_column:h.sort_column,sort_direction:h.sort_direction};j(!0),a.postApi(c.GetCustomerGroupsAdminList,e).then((e=>{if(j(!1),!0===e.data.status){const a=e.data.result[1];t(a),n(!s),N(e.data.result[0][0].total_row)}}))},_=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>x({...h,search:e.target.value})}))),y=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t};j(!0),a.postApi(c.DeleteCustomerGroup,e).then((e=>{j(!1),gl.b.success(l.RecordDeleted),f(),n(!s)}))}}))};return i?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.CustomerGroup," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/customer-group/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Customer Group"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:p,data:e,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:O,onChangeRowsPerPage:e=>{x({...h,page_size:e})},onChangePage:e=>{x({...h,page:e})},subHeader:!0,progressPending:u,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:_,onSort:(e,t)=>{console.log("LN 131 Sort FIeld "+e.sortField),x({...h,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})};var Qo=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(),n=Object(d.useRef)(new ec.a),[i,o]=Object(d.useState)(!1),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)(!0),[x,O]=Object(d.useState)({id:0,name:"",status:0});Object(d.useEffect)((()=>{u(!0),h(!1),document.title=r.AddCustomerGroup,void 0!==e.id&&(document.title=r.EditCustomerGroup,N())}),[e.id]);const N=()=>{const t={id:e.id};h(!0),a.postApi(c.GetCustomerGroups,t).then((e=>{h(!1),e.data.result&&(O(e.data.result[0][0]),o(!i))}))},f=e=>t=>{O("status"===e?{...x,[e]:t.target.checked}:{...x,[e]:t.target.value}),o(!i)};return!m||j?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditCustomerGroup:r.AddCustomerGroup," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:f("name"),onKeyUp:f("name"),onBlur:()=>n.current.showMessageFor("Name"),value:x.name,placeholder:"Name"}),n.current.message("Name",x.name,"required|alpha_num_space",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:f("status"),id:"EnableProduct",checked:x.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:s,type:"button",onClick:r=>{var d;if(!n.current.allValid())return n.current.showMessages(),void o(!i);s.current&&s.current.setAttribute("disabled","disabled");const m={id:x.id,name:x.name,status:null!==(d=x.status)&&void 0!==d?d:0};h(!0),a.postApi(c.SetCustomerGroup,m).then((a=>{if(h(!1),a.data.message)return gl.b.warning(a.data.message),o(!i),void s.current.removeAttribute("disabled");void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),o(!i),t.push("/system/customer-group")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/customer-group",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Xo=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(1),[j,p]=Object(d.useState)(!1),[h,x]=Object(d.useState)(!0),[O,N]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[f,_]=Object(d.useState)(),y=[{name:"Attribute Name",sortable:!0,sortField:"attribute_name",selector:e=>e.attribute_name,wrap:!0},{name:"Attribute Code",selector:e=>e.attribute_code,wrap:!0},{name:"Visible In Filters",selector:e=>1===e.show_in_storefront?"Yes":"No"},{name:"Visible In Product Page",selector:e=>1===e.show_in_detail_page?"Yes":"No"},{name:"Status",selector:e=>1===e.status?"Active":"Inactive"},{name:"Created Date",sortable:!0,sortField:"created_at",wrap:!0,selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/attribute/productattribute/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>{e.is_product_exist||e.is_used_by_system?t.preventDefault():S(t,e.id)},to:"",className:e.is_product_exist||e.is_used_by_system?"text-dark disabled":"text-dark",title:e.is_product_exist?l.ProductAttributeDeleteError:"Delete",disabled:e.is_product_exist,children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],w=()=>{const e={page:O.page,search:O.search,page_size:O.page_size,sort_column:O.sort_column,sort_direction:O.sort_direction};x(!0),a.postApi(c.GetProductAttributeAdminList,e).then((e=>{if(x(!1),!0===e.data.status){const s=e.data.result[1];t(s),_(e.data.result[0][0].total_row),i(!n)}}))};Object(d.useEffect)((()=>{p(!0),document.title=r.ProductAttribute,w()}),[O]);const k=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Attribute Code, Default Label.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>N({...O,page:o,search:e.target.value})}))),S=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,Userid:s.id};x(!0),a.postApi(c.DeleteProductAttribute,e).then((e=>{x(!1),gl.b.success(l.RecordDeleted),w(),i(!n)}))}}))};return j?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ProductAttribute," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/attribute/productattribute/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddProductAttribute," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:y,data:e,persistTableHead:!0,pagination:!0,paginationServer:!0,paginationTotalRows:f,paginationDefaultPage:o,onChangeRowsPerPage:e=>{u(1),N({...O,page:1,page_size:e})},onChangePage:e=>{u(e),N({...O,page:e})},subHeader:!0,progressPending:h,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:k,onSort:(e,t)=>{N({...O,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})};var Jo=()=>{let e=[];const t=i.setImage("assets/images/default.png"),s=Object(p.useParams)(),n=Object(d.useRef)(),o=Object(p.useHistory)(),m=Object(d.useRef)(new ec.a),u=Object(d.useContext)(mo),[j,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)([]),[N,f]=Object(d.useState)(!1),[_,y]=Object(d.useState)(!0),[w,k]=Object(d.useState)([]),[S,C]=Object(d.useState)(0),A=Object(d.useRef)([]),P=Object(d.useRef)([]),[D,M]=Object(d.useState)({id:0,attribute_name:"",attribute_code:"",description:"",input_type:"",show_in_storefront:0,show_in_detail_page:0,status:0,options:[],optionid:[]});Object(d.useEffect)((()=>{f(!0),y(!1),document.title=r.AddProductAttribute,void 0!==s.id&&(document.title=r.EditProductAttribute,I())}),[s.id]);const R=e=>t=>{M("status"===e||"show_in_storefront"===e||"show_in_detail_page"===e?{...D,[e]:t.target.checked}:{...D,[e]:t.target.value}),h(!j)},F=e=>t=>{t.preventDefault();let s=[...D.options];s=s.filter((t=>t.id!==e));const a=w.filter((t=>parseInt(t.imageId)!==e));k(a);const c=[];s.map((function(e,t){return c.push(e.id),!0})),D.optionid=c,D.options=s,h(!j)},I=()=>{const e={id:s.id};y(!0),a.postApi(c.GetProductAttributeDetail,e).then((e=>{if(y(!1),null!==e.data.result){e.data.result[0].map((e=>Object.keys(e).map((function(t,s){if("attribute_options"===t&&null!==e.attribute_options){const t=e.attribute_options;t.filter((e=>null!==e.value)).length>0&&(t.sort((function(e,t){return e.sort_order-t.sort_order})),t.map((async function(e,t){return D.optionid.push(e.id),!0})),D.options=t,O(t))}else D[t]=e[t];return!0})))),h(!j)}e.data.message&&(gl.b.warning(e.data.message),o.push("/attribute/productattribute"),h(!j))}))};window.addEventListener("fileUploadWithPreview:imagesAdded",(async function(t){t.preventDefault();const s=t.detail.cachedFileArray[0].type;let a="";a=t.detail.cachedFileArray[0].type.includes("svg")?"svg":t.detail.cachedFileArray[0].type.split("/")[1];const c=t.detail.cachedFileArray[0].size,r=t.detail.uploadId.split("_")[1];if(("image/jpeg"===s||"image/jpg"===s||"image/png"===s||"image/webp"===s||"image/svg+xml"===s)&&c<=2097152){const s=await new Promise(((e,s)=>{ao(t.detail.cachedFileArray[0],(t=>{e({imageId:r,image:t,type:"."+a})}))}));e=w,e.filter((e=>e.imageId===s.imageId)).length<1&&e.push(s),k(e)}h(!j)})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){if(w.length>0){const t=e.detail.uploadId.split("_")[1],s=w.filter((e=>e.imageId!==t));k(s)}}));const E={position:"relative",padding:"10px 15px",fontSize:"15px",border:"1px solid #f9fafa",background:"#f9fafa",cursor:"move"},L=e=>{A.current[e]&&(A.current[e].value="")};return!N||_?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",null===s.id||void 0===s.id?r.AddProductAttribute:r.EditProductAttribute," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:o.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{className:"forms-sample",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-md-4 col-lg-6",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Attribute Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"attribute_name",onChange:R("attribute_name"),defaultValue:D.attribute_name,placeholder:"Attribute Name"}),m.current.message("Attribute Name",D.attribute_name,"required|alpha_num_space",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Attribute Code"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"attribute_code",onChange:R("attribute_code"),defaultValue:D.attribute_code,placeholder:"Attribute Code",readOnly:void 0!==s.id}),m.current.message("Attribute Code",D.attribute_code,"required|alpha_num_dash",{className:"error"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"description",onChange:R("description"),defaultValue:D.description,placeholder:"Description"})]}),Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Input Type"}),Object(g.jsxs)("select",{className:"form-control",name:"input_type",value:D.input_type,onChange:R("input_type"),children:[Object(g.jsx)("option",{value:"",children:"--Select--"}),Object(g.jsx)("option",{value:"dropdown",children:"Dropdown"}),Object(g.jsx)("option",{value:"text",children:"Textbox"}),Object(g.jsx)("option",{value:"radio",children:"Radio Button"}),Object(g.jsx)("option",{value:"checkbox",children:"Checkbox"}),Object(g.jsx)("option",{value:"slider",children:"Slider"}),Object(g.jsx)("option",{value:"range_slider",children:"Range Slider"})]}),m.current.message("Input Type",D.input_type,"required",{className:"error"})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-6 col-lg-4 mb-3 mb-lg-0",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Visible In Filters"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"show_in_storefront",onChange:R("show_in_storefront"),id:"show_in_storefront",checked:D.show_in_storefront}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"show_in_storefront",children:" "})]})})]}),Object(g.jsxs)("div",{className:"col-6 col-md-6 col-lg-5 mb-3 mb-lg-0",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Visible In Product Page"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"show_in_detail_page",onChange:R("show_in_detail_page"),id:"show_in_detail_page",checked:D.show_in_detail_page}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"show_in_detail_page",children:" "})]})})]}),Object(g.jsxs)("div",{className:"col-6 col-md-6 col-lg-3 mb-3 mb-lg-0",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername3",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1 pointer",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:R("status"),id:"status",checked:D.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"status",children:" "})]})})]})]}),Object(g.jsx)("div",{className:"row mt-5",children:Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{if(!m.current.allValid())return m.current.showMessages(),void h(!j);const t=[],r=D.optionid;for(let s=0;s0&&t.push(r[s]);const n={id:D.id,attribute_name:D.attribute_name,attribute_code:D.attribute_code,description:D.description,input_type:D.input_type,show_in_storefront:D.show_in_storefront,show_in_detail_page:D.show_in_detail_page,status:D.status,attribute_options:D.options,selected_options_id:t.join(","),Userid:u.id};void 0===s.id?(y(!0),a.postApi(c.AddProductAttribute,n).then((e=>{if(y(!1),e.data.message)return gl.b.warning(e.data.message),void h(!j);gl.b.success(l.RecordAdded),h(!j),o.push("/attribute/productattribute")}))):(y(!0),a.postApi(c.UpdateProductAttribute,n).then((e=>{if(y(!1),e.data.message)return gl.b.warning(e.data.message),void h(!j);gl.b.success(l.RecordUpdated),h(!j),o.push("/attribute/productattribute")})))},className:"btn btn-custom text-white mr-2",disabled:S>0,children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/attribute/productattribute",className:"btn btn-primary",children:"Cancel"})]})})]}),Object(g.jsxs)("div",{className:"dropdown"===D.input_type||"radio"===D.input_type||"checkbox"===D.input_type||"range_slider"===D.input_type||"radio_image"===D.input_type||"text_swatch"===D.input_type?"col-md-8 col-lg-6":"col-md-8 col-lg-6 d-none",children:[Object(g.jsx)("div",{className:"col-md-12 text-right pr-0 mt-3 mt-md-0",children:Object(g.jsx)("button",{className:"btn btn-dark",onClick:e=>{e.preventDefault();const t=D.options,s=Math.floor(1e3+9e3*Math.random());t.filter((e=>e.id===s)).length<1&&(x.length>0?t.push({id:s,value:"",value_image:"",sort_order:Math.max(...x.map((e=>e.sort_order)))+1}):t.push({id:s,value:"",sort_order:0})),t.forEach(((e,t)=>{e.sort_order=t}));const a=s,c=D.optionid;c.push(a),D.optionid=c,D.options=t,h(!j)},children:"Add Option"})}),Object(g.jsxs)("p",{className:"d-flex justify-content-between align-items-center flex-wrap",children:["Options"," ","radio"===D.input_type&&Object(g.jsx)("label",{className:"mt-2 float-right note",children:"(only .webp, .png, .jpg, .jpeg, .svg format is allowed)"})]})," ",Object(g.jsx)(ai.a,{items:D.options,renderItem:e=>{return Object(g.jsx)("div",{className:"attribute-option-container",style:E,children:Object(g.jsxs)("div",{className:"row form-group mb-0",children:[Object(g.jsxs)("div",{className:"radio"===D.input_type?"col-md-4 pr-3 pr-md-1 mb-2 mb-md-0":"col-md-10 pr-3 pr-md-1 mb-2 mb-md-0",children:[Object(g.jsx)("input",{type:"text",className:"form-control",name:"options[]","data-id":e.item.id,placeholder:"Option",onChange:(s=e.item.id,e=>{const t=e.target.selectionStart,a=e.target;window.requestAnimationFrame((()=>{a.selectionStart=t,a.selectionEnd=t}));const c=[...D.options],r=c.findIndex((e=>e.id===s));c[r]={id:void 0!==c[r].id?c[r].id:"",value:e.target.value,value_image:void 0!==c[r].value_image?c[r].value_image:"",sort_order:void 0!==c[r].sort_order?c[r].sort_order:r},M({...D,options:c}),h(!j)}),value:e.item.value}),m.current.message("Option",e.item.value,"required",{className:"error"})]}),"radio"===D.input_type&&Object(g.jsxs)("div",{className:"col-md-6 pr-3 pr-md-1 mb-2 mb-md-0",children:[Object(g.jsxs)("div",{className:"d-flex",children:[Object(g.jsx)("input",{type:"file",name:"option_images[]",className:"form-control mr-2 option-image-file",onChange:t=>(async(e,t)=>{P.current[t].src=URL.createObjectURL(e.target.files[0]);const s=D.options.findIndex((e=>e.id===t)),a=D.options,c=await new Promise(((t,s)=>{ao(e.target.files[0],(e=>{t(e)}))}));"data:image"!==c.split("/")[0]&&C(S+1),a[s].value_image=c,a[s].preview_image=URL.createObjectURL(e.target.files[0]),M({...D,options:a})})(t,e.item.id),ref:t=>{A.current[e.item.id]=t},id:"option_image_"+e.item.id,style:{display:"block"}}),Object(g.jsxs)("div",{className:"image-container",children:[Object(g.jsx)("img",{className:"option-image",src:null!==e.item.value_image&&""!==e.item.value_image&&void 0!==e.item.value_image?e.item.value_image:t,ref:t=>{P.current[e.item.id]=t}}),null!==e.item.value_image&&""!==e.item.value_image&&void 0!==e.item.value_image&&e.item.value_image.toLowerCase().indexOf("default")<0&&Object(g.jsx)("div",{className:"delete-icon",onClick:s=>(async(e,s)=>{L(s),P.current[s].src=t;const a=D.options.findIndex((e=>e.id===s)),c=D.options;c[a].value_image="",c[a].preview_image=t,M({...D,options:c}),D.options.map((e=>(""!==e.value_image&&!0!==e.value_image.includes("http")?"data:image"!==e.value_image.split("/")[0]&&C(S+1):C(S-1),!0)))})(0,e.item.id),children:Object(g.jsx)("span",{children:"\xd7"})})]})]}),Object(g.jsx)("div",{style:void 0!==e.item.value_image&&null!==e.item.value_image&&""!==e.item.value_image&&e.item.value_image.includes("https")?{display:"none"}:void 0!==e.item.value_image&&null!==e.item.value_image&&""!==e.item.value_image&&"data:image/png"!==e.item.value_image.split(";")[0]&&"data:image/jpeg"!==e.item.value_image.split(";")[0]&&"data:image/jpg"!==e.item.value_image.split(";")[0]&&"data:image/svg+xml"!==e.item.value_image.split(";")[0]&&"data:image/webp"!==e.item.value_image.split(";")[0]?{}:{display:"none"},className:"error",children:l.formatnotsupport})]}),Object(g.jsx)("div",{className:"col-auto pl-2 pl-md-1 ml-2 ml-md-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block",onClick:F(e.item.id),disabled:e.item.is_product_exist,title:e.item.is_product_exist?l.ProductAttributeOptionDeleteError:"",children:"X"})}),Object(g.jsx)("div",{className:"col-md-4 pr-1"})]})});var s},collapsed:!1,onChange:e=>{const t=[];e.items.map(((e,s)=>(t.push({id:e.id,value:e.value,value_image:e.value_image,sort_order:s}),!0))),M({...D,options:t})},maxDepth:1})]})]})})})})})}),Object(g.jsx)("div",{ref:n,children:" "})]})};var Zo=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(1),[j,p]=Object(d.useState)(!1),[h,x]=Object(d.useState)(!0),[O,N]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[f,_]=Object(d.useState)(),y=[{name:"Name",sortable:!0,sortField:"name",selector:e=>e.name},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/attribute/attributeset/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>{e.is_product_exist?t.preventDefault():S(t,e.id)},to:"",className:e.is_product_exist?"text-dark disabled":"text-dark",title:e.is_product_exist?l.ProductAttributeSetDeleteError:"Delete",disabled:e.is_product_exist,children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}];Object(d.useEffect)((()=>{p(!0),document.title=r.ProductAttributeSet,w()}),[O]);const w=()=>{const e={page:O.page,search:O.search,page_size:O.page_size,sort_column:O.sort_column,sort_direction:O.sort_direction};x(!0),a.postApi(c.GetProductAttributeSetAdminList,e).then((e=>{if(x(!1),!0===e.data.status){const s=e.data.result[1];t(s),_(e.data.result[0][0].total_row),i(!n)}}))},k=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>N({...O,page:o,search:e.target.value})}))),S=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,Userid:s.id};x(!0),a.postApi(c.DeleteProductAttributeSet,e).then((e=>{x(!1),gl.b.success(l.RecordDeleted),w(),i(!n)}))}}))};return j?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ProductAttributeSet," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/attribute/attributeset/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddProductAttributeSet," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:y,data:e,pagination:!0,paginationServer:!0,paginationTotalRows:f,paginationDefaultPage:o,onChangeRowsPerPage:e=>{u(1),N({...O,page:1,page_size:e})},onChangePage:e=>{u(e),N({...O,page:e})},subHeader:!0,subHeaderComponent:k,onSort:(e,t)=>{N({...O,sort_column:e.sortField,sort_direction:t})},progressPending:h,progressComponent:Object(g.jsx)(v,{}),sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})},$o=s(179);var ed=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),n=Object(d.useRef)(new ec.a),i=Object(d.useContext)(mo),[o,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!1),[h,x]=Object(d.useState)(r.AddAttributeGroup),[O,N]=Object(d.useState)(""),f="mdi mdi-plus-box menu-icon fs-16",[_,y]=Object(d.useState)(!1),[w,k]=Object(d.useState)(!0),[S]=Object(d.useState)({items:[],groups:[]}),[C]=Object(d.useState)({id:0,name:"",status:1}),[A]=Object(d.useState)({name:"",id:0}),P={droppable:"items",droppable2:"selected"};Object(d.useEffect)((()=>{y(!0),k(!1),document.title=r.AddProductAttributeSet,document.body.style.overflow="hidden",void 0!==e.id?(document.title=r.EditProductAttributeSet,M(),S.groups=[]):(R(),S.groups=[{id:0,content:"Default Group",className:"lableNone",selected:[]}])}),[e.id]);const D=e=>{const t=e.target.name,s=e.target.value;C[t]="status"===t||"is_required"===t||"use_in_search"===t||"show_in_storefront"===t?e.target.checked:s,m(!o)},M=()=>{const t={id:e.id};k(!0),a.postApi(c.GetProductAttributeSetDetail,t).then((e=>{if(k(!1),e.data.result[0]){const t=e.data.result[0],s={limit:10,page:1},r=[];k(!0),a.postApi(c.GetProductAttributeList,s).then((e=>{k(!1),e.data.result[0].map((function(e,t){return r.push({id:e.attribute_code,content:e.attribute_name}),!0})),S.items=r,t.map((e=>Object.keys(e).map((function(t,s){if("group_names"===t||"attributes"===t||"group_id"===t){if("group_id"===t&&""!==e.group_id){const t=e.group_id.split(", ").filter(((e,t,s)=>s.indexOf(e)===t)),s=e.group_names.split(", ").filter(((e,t,s)=>s.indexOf(e)===t));for(const e in t)S.groups.push({id:t[e],content:s[e],className:"lableNone",selected:[]});if(null!==e.attributes){const t=e.attributes.split("~");for(const e in t)if(""!==t[e]){const s=t[e].split(",");let c=[];for(var a in S.items)S.items[a].id===s[0]&&(c=S.items[a],S.items.splice(a,1));for(a in S.groups)S.groups[a].id===s[1]&&S.groups[a].selected.push(c)}}}}else C[t]=e[t];return!0}))));for(const t in S.groups)S.groups[t].id=t;m(!o)}))}}))},R=()=>{const e=[];k(!0),a.postApi(c.GetProductAttributeList,{limit:10,page:1}).then((t=>{k(!1),t.data.result[0].map((function(t,s){return e.push({id:t.attribute_code,content:t.attribute_name}),!0})),S.items=e,m(!o)}))},F=e=>{A.id="",A.name="",A.id=e.target.attributes.name.value,A.name=e.target.innerText,x(r.EditAttributeGroup),m(!o),j(!0)},I=e=>{A.id=e.target.attributes.name.value,A.name=e.target.innerText;const t=e.target.attributes.name.value;for(const a in S.groups)S.groups[a].className="labelNone",m(!o);const s=S.groups.findIndex((e=>Number(e.id)===Number(t)));S.groups[s].className="labelGray",N(!1),m(!o)},E=(e,t,s)=>{const a=Array.from(e),[c]=a.splice(t,1);return a.splice(s,0,c),a},L=(e,t,s,a)=>{const c=Array.from(e),r=Array.from(t),[l]=c.splice(s.index,1);r.splice(a.index,0,l);const n={};return n[s.droppableId]=c,n[a.droppableId]=r,n},G=(e,t)=>({userSelect:"none",...t}),T=e=>{if(/\d/.test(e)){const t=e.match(/(\d+)/);return S.groups[t[0]].selected}return S[P[e]]};return!_||w?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditProductAttributeSet:r.AddProductAttributeSet," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:D,defaultValue:C.name,placeholder:"Name"}),s.current.message("Name",C.name,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername3",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:D,id:"status",checked:C.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"status",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)($o.a,{onDragEnd:e=>{const{source:t,destination:s}=e;if(!s)return;const a=/\d/;if(a.test(t.droppableId)&&a.test(s.droppableId)){const e=t.droppableId.match(/(\d+)/),a=s.droppableId.match(/(\d+)/);if(t.droppableId===s.droppableId){const a=E(T(t.droppableId),t.index,s.index);S.groups[e[0]].selected=a}else{const r=L(T(t.droppableId),T(s.droppableId),t,s);var c=s.droppableId;const l=t.droppableId;S.groups[e[0]].selected=r[l],S.groups[a[0]].selected=r[c]}}else if(a.test(s.droppableId)){const e=s.droppableId.match(/(\d+)/),a=L(T(t.droppableId),T(s.droppableId),t,s),c=s.droppableId;S.items=a.droppable,S.groups[e[0]].selected=a[c]}else if(a.test(t.droppableId)){const e=t.droppableId.match(/(\d+)/),a=L(T(t.droppableId),T(s.droppableId),t,s);c=t.droppableId,S.items=a.droppable,S.groups[e[0]].selected=a[c]}else{const e=E(T(t.droppableId),t.index,s.index);S.items=e}},children:[Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("div",{className:"form-group d-none",children:[Object(g.jsx)("label",{children:"Groups"}),Object(g.jsx)("hr",{className:"m-0"}),Object(g.jsxs)("div",{className:"row mt-2",children:[Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsx)("button",{type:"button",className:"btn btn-custom text-white mr-2",onClick:()=>{A.id="",A.name="",n.current.hideMessages(),x(r.AddAttributeGroup),N(!1),m(!o),j(!0)},children:"Add New"}),Object(g.jsx)("button",{type:"button",className:"btn btn-primary mr-2",onClick:()=>{if(0===parseInt(A.id)||""===A.id)sc()({title:l.oops,text:l.defaultgroupnotdelete,buttons:{cancel:!1,confirm:!0}});else{const e=A.id;if(0===parseInt(e)&&1===S.groups.length)sc()({title:l.oops,text:l.atleastonegroup,buttons:{cancel:!1,confirm:!0}});else{const t=S.groups.findIndex((t=>Number(t.id)===Number(e))),s=S.groups[t].selected;for(const e in s)S.items.push(s[e]),m(!o);S.groups[t].selected=[],S.groups.splice(t,1),m(!o)}}},disabled:0===parseInt(A.id)||""===A.id,children:"Delete Selected Group"})]}),Object(g.jsx)("div",{className:"col-md-12 mt-1 note",children:"Double click on a group to rename it."})]})]}),Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsx)("div",{className:"col-md-12",style:{height:"420px",overflowY:"scroll"},children:Object(g.jsx)("div",{id:"accordion",children:S.groups.map(((e,t)=>Object(g.jsxs)("div",{className:"card border p-2",children:[Object(g.jsxs)("div",{className:"card-header p-0 border-none",children:[Object(g.jsx)("a",{className:"fs-16 p-0 pr-1 collapsed",onClick:e=>((e,t)=>{if(document.getElementsByClassName("active").length>0){var s=document.getElementsByClassName("active");for(let e=0;e<=s.length;e++)s[e].classList.remove("active")}const a=document.getElementById(t);e.target.className.includes("mdi-minus-box")?a.className=f:(a.className="mdi mdi-minus-box menu-icon fs-16",a.classList.add("active")),s=document.getElementsByClassName("menu-icon");for(let c=0;cObject(g.jsxs)("div",{ref:t.innerRef,style:(s.isDraggingOver,{padding:8}),children:[e.selected.map(((e,t)=>Object(g.jsx)($o.b,{draggableId:e.id,index:t,children:(t,s)=>Object(g.jsx)("div",{ref:t.innerRef,...t.draggableProps,...t.dragHandleProps,style:G(s.isDragging,t.draggableProps.style),children:e.content+" - "+e.id})},e.id))),t.placeholder]})})})})]},t)))})})})]}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Unassigned Attributes"}),Object(g.jsx)("hr",{className:"m-0"}),Object(g.jsx)($o.c,{droppableId:"droppable",children:(e,t)=>Object(g.jsxs)("div",{ref:e.innerRef,style:(t.isDraggingOver,{padding:8,height:"500px",overflowY:"scroll",fontSize:14}),children:[S.items.map(((e,t)=>Object(g.jsx)($o.b,{draggableId:e.id,index:t,children:(t,s)=>Object(g.jsx)("div",{ref:t.innerRef,...t.draggableProps,...t.dragHandleProps,style:G(s.isDragging,t.draggableProps.style),children:e.content+" - "+e.id})},e.id))),e.placeholder]})})]})})]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:r=>{if(!s.current.allValid())return s.current.showMessages(),void m(!o);const n=S.groups;let d="";for(const e in n)if(e>0&&(d+="^"),d+=n[e].content,n[e].selected.length>0){d+="~";const t=n[e].selected;for(const e in t)e>0&&(d+=","),d+=t[e].id}const u={id:C.id,name:C.name,status:C.status,attributes:d,Userid:i.id};void 0===e.id?(k(!0),a.postApi(c.AddProductAttributeSet,u).then((e=>{if(k(!1),e.data.message)return gl.b.warning(e.data.message),void m(!o);gl.b.success(l.RecordAdded),m(!o),t.push("/attribute/attributeset")}))):(k(!0),a.postApi(c.UpdateProductAttributeSet,u).then((e=>{if(k(!1),e.data.message)return gl.b.warning(e.data.message),void m(!o);gl.b.success(l.RecordUpdated),m(!o),t.push("/attribute/attributeset")})))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/attribute/attributeset",className:"btn btn-primary",children:"Cancel"})]})})]})})})})}),Object(g.jsxs)(li.a,{size:"md",show:u,onHide:()=>j(!1),"aria-labelledby":"contained-modal-title-vcenter",centered:!0,children:[Object(g.jsx)(li.a.Header,{closeButton:!0,children:Object(g.jsx)(li.a.Title,{id:"edit-address-modal",children:h})}),Object(g.jsx)(li.a.Body,{children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Group Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:e=>{const t=e.target.name,s=e.target.value;A[t]=s,m(!o)},defaultValue:A.name,placeholder:"Group Name"}),n.current.message("Group Name",A.name,"required",{className:"error"}),O&&Object(g.jsx)("label",{className:"error",children:"Group already exist"})]})})})}),Object(g.jsxs)(li.a.Footer,{children:[Object(g.jsx)(ni.a,{variant:"primary",onClick:e=>{if(!n.current.allValid())return n.current.showMessages(),void m(!o);if(""===A.id){const e=S.groups.length;var t=S.groups.findIndex((e=>e.content.trim().toLowerCase()===A.name.trim().toLowerCase()));if(t>-1)return N(!0),j(!0),void m(!o);N(!1),S.groups.push({id:e,content:A.name,className:"lableNone",selected:[]}),j(!1),m(!o)}else{if((t=S.groups.findIndex((e=>e.content.trim().toLowerCase()===A.name.trim().toLowerCase()&&Number(e.id)!==Number(A.id))))>-1)return N(!0),void m(!o);S.groups[A.id].content=A.name,N(!1),j(!1)}A.id=0,A.name="";for(const s in S.groups)S.groups[s].className="labelNone",m(!o);m(!o)},children:"Submit"}),Object(g.jsx)(ni.a,{variant:"light",onClick:()=>j(!1),children:"Close"})]})]})]})};var td=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(1),[j,p]=Object(d.useState)(!0),[h,x]=Object(d.useState)(!1),O=[{name:"Name",sortable:!0,sortField:"name",selector:e=>e.name},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>e.status?"Active":"Inactive"},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/widgets/banner/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>k(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[N,f]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[_,y]=Object(d.useState)(),w=()=>{x(!0);const e={page:N.page,search:N.search,page_size:N.page_size,sort_column:N.sort_column,sort_direction:N.sort_direction};a.postApi(c.GetBannerList,e).then((e=>{x(!1),t(e.data.result[1]),y(e.data.result[0][0].total),i(!n)}))},k=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};x(!0),a.postApi(c.DeleteBanner,e).then((e=>{x(!1),gl.b.success(l.RecordDeleted),w(),i(!n)}))}}))};Object(d.useEffect)((()=>{p(!0),document.title=r.Banner,w()}),[N]);const S=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>f({...N,search:e.target.value})})));return j?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Banner," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/widgets/banner/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Banner"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:O,data:e,progressPending:h,persistTableHead:!0,progressComponent:Object(g.jsx)(v,{}),pagination:!0,paginationServer:!0,paginationTotalRows:_,paginationDefaultPage:o,onChangeRowsPerPage:e=>{u(1),f({...N,page:1,page_size:e})},onChangePage:e=>{u(e),f({...N,page:e})},subHeader:!0,subHeaderComponent:S,onSort:(e,t)=>{f({...N,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})};var sd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),[s,n]=Object(d.useState)(!1),[m,u]=Object(d.useState)(!0),j=Object(d.useRef)(new ec.a({validators:{noDomain:{message:"Custom links cannot contain a domain.",rule:e=>!/^(https?:\/\/|www\.)/i.test(e),required:!0}}})),[h,x]=Object(d.useState)(!1),[O,N]=Object(d.useState)("invalid"),[f,_]=Object(d.useState)(!0),[y,w]=Object(d.useState)(!0),[k,S]=Object(d.useState)(!1),[C,A]=Object(d.useState)(""),[P,D]=Object(d.useState)(!0),[M,R]=Object(d.useState)(!0),[F,I]=Object(d.useState)(!1),[E,L]=Object(d.useState)([]),[G,T]=Object(d.useState)([]),[B,z]=Object(d.useState)([]),[U,q]=Object(d.useState)({id:0,name:"",btn_text:"",btn_text_2:"",status:0,prevDeskImg:"",prevMobImg:"",DesktopbtnX:"",DesktopbtnY:"",DesktopbtnX2:"",DesktopbtnY2:"",MobilebtnX:"",MobilebtnY:"",MobilebtnX2:"",MobilebtnY2:"",desk_btn_theme:"white",mob_btn_theme:"white",link_type:"",link:"",external_link:"",page_id:"",category_id:"",selectedCategoryId:"",link_type_2:"",link_2:"",external_link_2:"",page_id_2:"",category_id_2:"",selectedCategoryId_2:"",button_count:"null"}),[H,V]=Object(d.useState)(null),[K,W]=Object(d.useState)(null),[Y,Q]=Object(d.useState)(null),[X,J]=Object(d.useState)(null),[Z,$]=Object(d.useState)(0),[ee,te]=Object(d.useState)(0),[se,ae]=Object(d.useState)(null),[ce,re]=Object(d.useState)(null),[le,ne]=Object(d.useState)(null),[ie,oe]=Object(d.useState)(null),de=Object(d.useRef)(null),me=Object(d.useRef)(null),ue=e=>{if(1===e){if(1===Z)return V(null),$(0),ae(null),void q((e=>({...e,DesktopbtnX:"",DesktopbtnY:""})));2===Z&&(V(K),W(null),$(1),ae(1),q((e=>({...e,DesktopbtnX:e.DesktopbtnX2,DesktopbtnY:e.DesktopbtnY2,DesktopbtnX2:"",DesktopbtnY2:""}))))}2===e&&(W(null),$(1),ae(1),q((e=>({...e,DesktopbtnX2:"",DesktopbtnY2:""}))))},je=e=>{if(1===e){if(1===ee)return Q(null),te(0),re(null),void q((e=>({...e,MobilebtnX:"",MobilebtnY:""})));2===ee&&(Q(X),J(null),te(1),re(1),q((e=>({...e,MobilebtnX:e.MobilebtnX2,MobilebtnY:e.MobilebtnY2,MobilebtnX2:"",MobilebtnY2:""}))))}2===e&&(J(null),te(1),re(1),q((e=>({...e,MobilebtnX2:"",MobilebtnY2:""}))))};Object(d.useEffect)((()=>{i.validatePermission(o.Widgets)||t.push("/"),pe(),n(!0),u(!1),x(!h),document.title=r.AddBanner,void 0!==e.id?(document.title=r.EditBanner,he()):setTimeout((()=>{ge(),Oe()}),500),be()}),[e.id]);const be=()=>{a.getApi(c.GetContentManagementList).then((e=>{z(e.data.result)}))},pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{first:null,second:null};a.postApi(c.GetCategory,null).then((t=>{if(!t.data.result)return;const s=t.data.result[0],a=s.filter((e=>1===e.parent_id&&e.status)),c=[],r=[];a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),l=[];a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),c=[];return a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),r=[];return a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),c=[];return a.map((t=>(c.push({label:t.name,value:t.id,checked:e.first===t.id}),!0))),r.push({label:t.name,value:t.id,checked:e.first===t.id,children:c}),!0})),c.push({label:t.name,value:t.id,checked:e.first===t.id,children:r}),!0})),l.push({label:t.name,value:t.id,checked:e.first===t.id,children:c}),!0})),c.push({label:t.name,value:t.id,checked:e.first===t.id,children:l});const n=s.filter((e=>e.parent_id===t.id&&e.status)),i=[];return n.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),c=[];return a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),r=[];return a.map((t=>{const a=s.filter((e=>e.parent_id===t.id&&e.status)),c=[];return a.map((t=>(c.push({label:t.name,value:t.id,checked:e.second===t.id}),!0))),r.push({label:t.name,value:t.id,checked:e.second===t.id,children:c}),!0})),c.push({label:t.name,value:t.id,checked:e.second===t.id,children:r}),!0})),i.push({label:t.name,value:t.id,checked:e.second===t.id,children:c}),!0})),r.push({label:t.name,value:t.id,checked:e.second===t.id,children:i}),!0})),L(c),T(r)}))},he=()=>{const t={id:e.id};u(!0),a.postApi(c.GetBanner,t).then((e=>{if(u(!1),e.data.result){const t=e.data.result[0][0];if(q({id:t.id,name:t.name,status:t.status}),""!==t.desktop_main_image?ge(t.desktop_main_image):ge(),""!==t.mobile_main_image?Oe(t.mobile_main_image):Oe(),null!==t&&void 0!==t){const e=t.desk_btn_x_position,s=t.desk_btn_y_position,a=t.desk_btn_x_position_2,c=t.desk_btn_y_position_2,r=t.mob_btn_x_position,l=t.mob_btn_y_position,n=t.mob_btn_x_position_2,i=t.mob_btn_y_position_2,o=t.button_count||"null";q({...U,btn_text:t.btn_text,btn_text_2:t.btn_text_2||"",name:t.name,status:t.status,prevMobImg:t.mobile_main_image,prevDeskImg:t.desktop_main_image,link_type:t.link_type,link:"custom_link"===t.link_type?t.link:0,external_link:"external_link"===t.link_type?t.link:0,page_id:t.page_id,selectedCategoryId:t.category_id,MobilebtnX:r,MobilebtnY:l,MobilebtnX2:n,MobilebtnY2:i,DesktopbtnX:e,DesktopbtnY:s,DesktopbtnX2:a,DesktopbtnY2:c,desk_btn_theme:null!==t.desk_btn_theme?t.desk_btn_theme:U.desk_btn_theme,mob_btn_theme:null!==t.mob_btn_theme?t.mob_btn_theme:U.mob_btn_theme,button_count:o,link_type_2:t.link_type_2,link_2:"custom_link"===t.link_type_2?t.link_2:0,page_id_2:t.page_id_2,external_link_2:"external_link"===t.link_type_2?t.link_2:0,selectedCategoryId_2:t.category_id_2}),e&&(V({xPercentDesk:String(e),yPercentDesk:String(s)}),$(1),ae(1)),a&&(W({xPercentDesk:String(a),yPercentDesk:String(c)}),e&&($(2),ae(2))),r&&(Q({xPercentMob:String(r),yPercentMob:String(l)}),te(1),re(1)),n&&(J({xPercentMob:String(n),yPercentMob:String(i)}),r&&(te(2),re(2))),pe({first:t.category_id,second:t.category_id_2})}}}))},xe=e=>{const t=e.target.name,s=e.target.value;U[t]="status"===t?e.target.checked:s,x(!h)},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("mobileimage",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),D(!0)):new ti.a("mobileimage",{text:{chooseFile:"Choose Image..."}})},ge=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("desktopimage",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),_(!0)):new ti.a("desktopimage",{text:{chooseFile:"Choose Image..."}})};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){if("desktopimage"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{N(e)})),_(!0),w(!0),S(!1)):(S(!0),_(!0),N("")):(N(""),_(!0),w(!1),S(!1))}else if("mobileimage"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{A(e)})),D(!0),R(!0),I(!1)):I(!0):(A(""),D(!0),R(!1),I(!1))}})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){"desktopimage"===e.detail.uploadId?(N(""),w(!0),S(!1),_(!1)):"mobileimage"===e.detail.uploadId&&(A(""),R(!0),I(!1))}));const ve=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=e.target.value;1===t&&q((e=>({...e,link_type:s,page_id:"page"===s?0===e.page_id?"":e.page_id:0,selectedCategoryId:"category"===s?0===e.selectedCategoryId?"":e.selectedCategoryId:0,link:"custom_link"===s?0===e.link?"":e.link:0,external_link:"external_link"===s?0===e.external_link?"":e.external_link:0}))),2===t&&q((e=>({...e,link_type_2:s,page_id_2:"page"===s?0===e.page_id_2?"":e.page_id_2:0,selectedCategoryId_2:"category"===s?0===e.selectedCategoryId_2?"":e.selectedCategoryId_2:0,link_2:"custom_link"===s?0===e.link_2?"":e.link_2:0,external_link_2:"external_link"===s?0===e.external_link_2?"":e.external_link_2:0}))),x((e=>!e))};return!s||m?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditBanner:r.AddBanner," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:xe,onKeyUp:xe,defaultValue:U.name,placeholder:"Name"}),j.current.message("Name",U.name,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:xe,id:"EnableProduct",checked:U.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsxs)("div",{className:"row widget-banner-row",children:[Object(g.jsxs)("div",{className:"col-md-6 col-lg-6",children:[Object(g.jsx)("h5",{children:Object(g.jsx)("b",{children:"Desktop Banners"})}),Object(g.jsxs)("div",{className:"mt-3 mb-4",children:[Object(g.jsxs)("div",{className:"custom-file-container","data-upload-id":"desktopimage",children:[Object(g.jsx)("label",{children:"Desktop Banner"}),Object(g.jsxs)("label",{className:"note ml-1",children:[" ","(Only PNG, JPEG, JPG format allowed. Size should be 1920x820 pixels.)"]})]}),Object(g.jsx)("div",{style:y?{display:"none"}:{},className:"error pt-2 mt-0 pl-3 pb-3",children:l.formatnotsupport}),Object(g.jsx)("div",{style:k?{}:{display:"none"},className:"error pt-0 mt-0 pl-3 pb-2",children:"Maximum file size should be 2MB."}),Object(g.jsx)("div",{style:f?{display:"none"}:{},className:"error pt-2 mt-0 pl-3 pb-3",children:"Desktop Image is required."})]}),Object(g.jsx)("div",{})]}),Object(g.jsxs)("div",{className:"col-md-6 col-lg-6",children:[Object(g.jsx)("h5",{children:Object(g.jsx)("b",{children:"Mobile Banners"})}),Object(g.jsxs)("div",{className:"mt-3 mb-4",children:[Object(g.jsxs)("div",{className:"custom-file-container mb-3","data-upload-id":"mobileimage",children:[Object(g.jsx)("label",{children:"Mobile Banner"}),Object(g.jsxs)("label",{className:"note ml-1",children:[" ","(Only PNG, JPEG, JPG format allowed. Size should be 767x375 pixels.)"]})]}),Object(g.jsx)("div",{style:P?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:M?{display:"none"}:{},className:"error pt-2 pb-3 mt-0 pl-3",children:l.formatnotsupport}),Object(g.jsx)("div",{style:F?{}:{display:"none"},className:"error pt-0 pb-2 mt-0 pl-3",children:"Maximum file size should be 2MB."})]}),Object(g.jsx)("div",{})]})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Button Count"}),Object(g.jsxs)("select",{className:"form-control",name:"button_count",onChange:e=>{const t=e.target.value;q({...U,button_count:t}),"null"===t&&($(0),te(0),V(null),W(null),Q(null),J(null),ae(null),re(null),q({...U,button_count:t,DesktopbtnX:"",DesktopbtnY:"",DesktopbtnX2:"",DesktopbtnY2:"",MobilebtnX:"",MobilebtnY:"",MobilebtnX2:"",MobilebtnY2:""})),x(!h)},value:U.button_count,children:[Object(g.jsx)("option",{value:"null",children:"No Button"}),Object(g.jsx)("option",{value:"1",children:"Single Button"}),Object(g.jsx)("option",{value:"2",children:"Double Button"})]})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Desktop Button Theme"}),Object(g.jsxs)("select",{className:"form-control",name:"desk_btn_theme",onChange:xe,value:U.desk_btn_theme,disabled:"null"===U.button_count,children:[Object(g.jsx)("option",{value:"black",children:"Black"}),Object(g.jsx)("option",{value:"white",children:"White"}),Object(g.jsx)("option",{value:"theme_color",children:"Theme color"})]})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Mobile Button Theme"}),Object(g.jsxs)("select",{className:"form-control",name:"mob_btn_theme",onChange:xe,value:U.mob_btn_theme,disabled:"null"===U.button_count,children:[Object(g.jsx)("option",{value:"black",children:"Black"}),Object(g.jsx)("option",{value:"white",children:"White"}),Object(g.jsx)("option",{value:"theme_color",children:"Theme color"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Button 1 Text"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"btn_text",onChange:xe,onKeyUp:xe,defaultValue:U.btn_text,placeholder:"Button 1 Text",disabled:"null"===U.button_count})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Button 2 Text"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"btn_text_2",onChange:xe,onKeyUp:xe,defaultValue:U.btn_text_2,placeholder:"Button 2 Text",disabled:"1"===U.button_count||"null"===U.button_count})]})}),Object(g.jsx)("div",{className:"col-md-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Link Type"}),Object(g.jsxs)("select",{className:"form-control",name:"link_type",onChange:e=>ve(e,1),value:U.link_type,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"category",children:"Category"}),Object(g.jsx)("option",{value:"page",children:"Page"}),Object(g.jsx)("option",{value:"custom_link",children:"Custom Link"}),Object(g.jsx)("option",{value:"external_link",children:"External link"}),Object(g.jsx)("option",{value:"blank",children:"Blank"})]})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"category"===U.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),E.length>0&&Object(g.jsx)(ei.a,{placeholder:"Choose",multi:!1,id:"category-dropdown",data:E,onChange:(e,t)=>{t.length>0?(q({...U,selectedCategoryId:t[0].value}),U.selectedCategoryId=U.category_id=t[0].value):q({...U,selectedCategoryId:""}),E.map(((e,t)=>(e.value===U.category_id?E[t].checked=!0:E[t].checked=!1,e.children&&e.children.map(((e,s)=>(e.value===U.category_id?E[t].children[s].checked=!0:E[t].children[s].checked=!1,e.children&&e.children.map(((e,a)=>(e.value===U.category_id?E[t].children[s].children[a].checked=!0:E[t].children[s].children[a].checked=!1,e.children&&e.children.map(((e,c)=>(e.value===U.category_id?E[t].children[s].children[a].children[c].checked=!0:E[t].children[s].children[a].children[c].checked=!1,!0))),!0))),!0))),!0)))},mode:"radioSelect",className:"bootstrap-demo w-100"}),Object(g.jsx)("input",{type:"hidden",className:"form-control",name:"category",onBlur:()=>j.current.showMessageFor("category"),value:U.selectedCategoryId})," ",j.current.message("Category",U.selectedCategoryId,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"page"===U.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Page"}),Object(g.jsxs)("select",{className:"form-control",name:"page_id",onChange:xe,onBlur:()=>j.current.showMessageFor("page"),value:U.page_id,children:[Object(g.jsx)("option",{value:"",children:"select"},""),B.map((e=>Object(g.jsx)("option",{value:e.id,children:e.title},e.id)))]}),j.current.message("Page",U.page_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"custom_link"===U.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[" ",Object(g.jsx)("label",{children:"Custom Link"})," ",Object(g.jsx)("input",{type:"text",className:"form-control",name:"link",onChange:xe,onBlur:()=>j.current.showMessageFor("link"),value:U.link,placeholder:"Custom Link"}),Object(g.jsxs)("label",{style:{color:"#505050"},className:"note mt-1",children:[" ",'(Do not include "https://www.example.com/" in link.)']}),j.current.message("Custom Link",U.link,"required|noDomain",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"external_link"===U.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[" ",Object(g.jsx)("label",{children:"External Link"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"external_link",onChange:xe,onBlur:()=>j.current.showMessageFor("external_link"),value:U.external_link,placeholder:"External Link"}),j.current.message("External Link",U.external_link,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"blank"===U.link_type||""===U.link_type?{}:{display:"none"},children:Object(g.jsx)("div",{className:"form-group"})}),Object(g.jsx)("div",{className:"col-md-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Link Type"}),Object(g.jsxs)("select",{className:"form-control",name:"link_type_2",onChange:e=>ve(e,2),value:U.link_type_2,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"category",children:"Category"}),Object(g.jsx)("option",{value:"page",children:"Page"}),Object(g.jsx)("option",{value:"custom_link",children:"Custom Link"}),Object(g.jsx)("option",{value:"external_link",children:"External link"}),Object(g.jsx)("option",{value:"blank",children:"Blank"})]})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"category"===U.link_type_2?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),E.length>0&&Object(g.jsx)(ei.a,{placeholder:"Choose",multi:!1,id:"category2-dropdown",data:G,onChange:(e,t)=>{t.length>0?(q({...U,selectedCategoryId_2:t[0].value}),U.selectedCategoryId_2=U.category_id_2=t[0].value):q({...U,selectedCategoryId_2:""}),G.map(((e,t)=>(e.value===U.category_id_2?G[t].checked=!0:G[t].checked=!1,e.children&&e.children.map(((e,s)=>(e.value===U.category_id_2?G[t].children[s].checked=!0:G[t].children[s].checked=!1,e.children&&e.children.map(((e,a)=>(e.value===U.category_id_2?G[t].children[s].children[a].checked=!0:G[t].children[s].children[a].checked=!1,e.children&&e.children.map(((e,c)=>(e.value===U.category_id_2?G[t].children[s].children[a].children[c].checked=!0:G[t].children[s].children[a].children[c].checked=!1,!0))),!0))),!0))),!0)))},mode:"radioSelect",className:"bootstrap-demo w-100"}),Object(g.jsx)("input",{type:"hidden",className:"form-control",name:"category_2",onBlur:()=>j.current.showMessageFor("category"),value:U.selectedCategoryId_2}),j.current.message("Category",U.selectedCategoryId_2,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"page"===U.link_type_2?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Page"}),Object(g.jsxs)("select",{className:"form-control",name:"page_id_2",onChange:xe,value:U.page_id_2,children:[Object(g.jsx)("option",{value:"",children:"select"}),B.map((e=>Object(g.jsx)("option",{value:e.id,children:e.title},e.id)))]}),j.current.message("Page",U.page_id_2,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"custom_link"===U.link_type_2?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Custom Link"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"link_2",onChange:xe,value:U.link_2,placeholder:"Custom Link"}),Object(g.jsxs)("label",{style:{color:"#505050"},className:"note mt-1",children:[" ",'(Do not include "https://www.example.com/" in link.)']}),j.current.message("Custom Link",U.link_2,"required|noDomain",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"external_link"===U.link_type_2?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"External Link"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"external_link_2",onChange:xe,value:U.external_link_2,placeholder:"External Link"}),j.current.message("External Link",U.external_link_2,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-4",style:"blank"===U.link_type_2||""===U.link_type_2?{}:{display:"none"},children:Object(g.jsx)("div",{className:"form-group"})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("h6",{className:"mt-1",children:[" ","Click anywhere on the image to put Button. Re-click the button to remove it from the image."]})}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("h6",{className:"mt-2",children:"Desktop Button Position"}),Object(g.jsxs)("div",{className:"mt-1",style:{position:"relative",display:"inline-block"},children:[Object(g.jsxs)("div",{style:{position:"relative",width:"100%"},children:[Object(g.jsx)("img",{src:""!==O&&"invalid"!==O?O:i.setImage("assets/images/icon/place_holder_1.jpg"),alt:"Responsive Click",ref:de,onClick:e=>{if(!de.current)return;if(!U.button_count||"null"===U.button_count)return;const t=de.current.getBoundingClientRect(),s=e.clientX-t.left,a=e.clientY-t.top,c=String((s/t.width*100).toFixed(2)),r=String((a/t.height*100).toFixed(2)),l=Number(U.button_count);if(1===l)return V({xPercentDesk:c,yPercentDesk:r}),q((e=>({...e,DesktopbtnX:c,DesktopbtnY:r}))),$(1),void ae(1);2===l&&(0===Z?(V({xPercentDesk:c,yPercentDesk:r}),q((e=>({...e,DesktopbtnX:c,DesktopbtnY:r}))),$(1),ae(1)):(W({xPercentDesk:c,yPercentDesk:r}),q((e=>({...e,DesktopbtnX2:c,DesktopbtnY2:r}))),$(2),ae(2)))},onMouseMove:e=>{if(!de.current)return;if(!U.button_count||"null"===U.button_count)return void ne(null);const t=de.current.getBoundingClientRect(),s=e.clientX-t.left,a=e.clientY-t.top,c=(s/t.width*100).toFixed(2),r=(a/t.height*100).toFixed(2),l=Number(U.button_count);let n=null;1===l?n=1:2===l&&(0===Z?n=1:1===Z&&(n=2)),ne({buttonNumber:n,xPercent:c,yPercent:r,x:s,y:a})},onMouseLeave:()=>{ne(null)},style:{width:"100%",height:"auto",cursor:U.button_count&&"null"!==U.button_count?"crosshair":"default",opacity:U.button_count&&"null"!==U.button_count?1:.8,display:"block"}}),le&&le.buttonNumber&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(le.yPercent,"%"),left:"".concat(le.xPercent,"%"),transform:"translate(-50%, -50%)",backgroundColor:1===le.buttonNumber?"#FFD700":"#FF6B6B",color:1===le.buttonNumber?"#000":"#fff",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"bold",zIndex:5,whiteSpace:"nowrap",border:"2px solid rgba(0,0,0,0.2)",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",pointerEvents:"none"},children:["Button #",le.buttonNumber]})]}),(H||U.DesktopbtnX)&&U.btn_text&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(U.DesktopbtnY||H.yPercentDesk,"%"),left:"".concat(U.DesktopbtnX||H.xPercentDesk,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{position:"relative",fontSize:"8px",marginBottom:"4px",border:1===se?"3px solid #FFD700":"none"},onClick:()=>ue(1),title:"Button #1 - Click to remove this button",children:U.btn_text}),Object(g.jsx)("div",{style:{fontSize:"10px",color:"#000",backgroundColor:"#FFD700",padding:"2px 6px",borderRadius:"3px",fontWeight:"bold",whiteSpace:"nowrap"},children:"Button #1"})]}),(K||U.DesktopbtnX2)&&U.btn_text_2&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(U.DesktopbtnY2||K.yPercentDesk,"%"),left:"".concat(U.DesktopbtnX2||K.xPercentDesk,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{position:"relative",fontSize:"8px",marginBottom:"4px",border:2===se?"3px solid #FF6B6B":"none"},onClick:()=>ue(2),title:"Button #2 - Click to remove this button",children:U.btn_text_2}),Object(g.jsx)("div",{style:{fontSize:"10px",color:"#fff",backgroundColor:"#FF6B6B",padding:"2px 6px",borderRadius:"3px",fontWeight:"bold",whiteSpace:"nowrap"},children:"Button #2"})]})]})]}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("h6",{children:"Set Mobile Button Position"}),Object(g.jsxs)("div",{className:"mt-1",style:{position:"relative",display:"inline-block"},children:[Object(g.jsxs)("div",{style:{position:"relative",width:"100%"},children:[Object(g.jsx)("img",{src:""!==C?C:i.setImage("assets/images/icon/place_holder_1.jpg"),alt:"Responsive Click",ref:me,onClick:e=>{if(!me.current)return;if(!U.button_count||"null"===U.button_count)return;const t=me.current.getBoundingClientRect(),s=e.clientX-t.left,a=e.clientY-t.top,c=String((s/t.width*100).toFixed(2)),r=String((a/t.height*100).toFixed(2));if(1===Number(U.button_count))return Q({xPercentMob:c,yPercentMob:r}),q((e=>({...e,MobilebtnX:c,MobilebtnY:r}))),te(1),void re(1);2===Number(U.button_count)&&(0===ee?(Q({xPercentMob:c,yPercentMob:r}),q((e=>({...e,MobilebtnX:c,MobilebtnY:r}))),te(1),re(1)):(J({xPercentMob:c,yPercentMob:r}),q((e=>({...e,MobilebtnX2:c,MobilebtnY2:r}))),te(2),re(2)))},onMouseMove:e=>{if(!me.current)return;if(!U.button_count||"null"===U.button_count)return void oe(null);const t=me.current.getBoundingClientRect(),s=e.clientX-t.left,a=e.clientY-t.top,c=(s/t.width*100).toFixed(2),r=(a/t.height*100).toFixed(2),l=Number(U.button_count);let n=null;1===l?n=1:2===l&&(0===ee?n=1:1===ee&&(n=2)),oe({buttonNumber:n,xPercent:c,yPercent:r,x:s,y:a})},onMouseLeave:()=>{oe(null)},style:{width:"100%",height:"auto",cursor:U.button_count&&"null"!==U.button_count?"crosshair":"default",opacity:U.button_count&&"null"!==U.button_count?1:.8,display:"block"}}),ie&&ie.buttonNumber&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(ie.yPercent,"%"),left:"".concat(ie.xPercent,"%"),transform:"translate(-50%, -50%)",backgroundColor:1===ie.buttonNumber?"#FFD700":"#FF6B6B",color:1===ie.buttonNumber?"#000":"#fff",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"bold",zIndex:5,whiteSpace:"nowrap",border:"2px solid rgba(0,0,0,0.2)",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",pointerEvents:"none"},children:["Button #",ie.buttonNumber]})]}),(Y||U.MobilebtnX)&&U.btn_text&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(U.MobilebtnY||Y.yPercentMob,"%"),left:"".concat(U.MobilebtnX||Y.xPercentMob,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{position:"relative",fontSize:"8px",marginBottom:"4px",border:1===ce?"3px solid #FFD700":"none"},onClick:()=>je(1),title:"Button #1 - Click to remove this button",children:U.btn_text}),Object(g.jsx)("div",{style:{fontSize:"10px",color:"#000",backgroundColor:"#FFD700",padding:"2px 6px",borderRadius:"3px",fontWeight:"bold",whiteSpace:"nowrap"},children:"Button #1"})]}),(X||U.MobilebtnX2)&&U.btn_text_2&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(U.MobilebtnY2||X.yPercentMob,"%"),left:"".concat(U.MobilebtnX2||X.xPercentMob,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{position:"relative",fontSize:"8px",marginBottom:"4px",border:2===ce?"3px solid #FF6B6B":"none"},onClick:()=>je(2),title:"Button #2 - Click to remove this button",children:U.btn_text_2}),Object(g.jsx)("div",{style:{fontSize:"10px",color:"#fff",backgroundColor:"#FF6B6B",padding:"2px 6px",borderRadius:"3px",fontWeight:"bold",whiteSpace:"nowrap"},children:"Button #2"})]})]})]})]}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:s=>{if("invalid"===O&&_(!1),console.log(j.current),!j.current.allValid()||"invalid"===O||!1===f||!0===k||!1===y)return j.current.showMessages(),void x(!h);const r={_id:void 0!==e.id&&null!==e.id?e.id:U.id,_name:U.name.trim(),_desktop_main_image:O,_mobile_main_image:C,_status:U.status?1:0,_desk_btnX:H?H.xPercentDesk:U.DesktopbtnX,_desk_btnY:H?H.yPercentDesk:U.DesktopbtnY,_desk_btnX2:K?K.xPercentDesk:U.DesktopbtnX2,_desk_btnY2:K?K.yPercentDesk:U.DesktopbtnY2,_Mob_btnX:Y?Y.xPercentMob:U.MobilebtnX,_Mob_btnY:Y?Y.yPercentMob:U.MobilebtnY,_Mob_btnX2:X?X.xPercentMob:U.MobilebtnX2,_Mob_btnY2:X?X.yPercentMob:U.MobilebtnY2,_link:"custom_link"===U.link_type?0===U.link?"":U.link:"external_link"===U.link_type?0===U.external_link?"":U.external_link:U.link,_link_type:U.link_type,_category_id:U.selectedCategoryId,_page_id:U.page_id,_desk_btn_theme:U.desk_btn_theme,_mob_btn_theme:U.mob_btn_theme,_btn_text:U.btn_text,_btn_text_2:U.btn_text_2,_button_count:U.button_count,_link_type_2:U.link_type_2,_link_2:"custom_link"===U.link_type_2?U.link_2||"":"external_link"===U.link_type_2&&U.external_link_2||"",_category_id_2:U.selectedCategoryId_2,_page_id_2:U.page_id_2};u(!0),a.postApi(c.SetBanner,r).then((s=>{if(s.data.message)return gl.b.warning(s.data.message),u(!1),ge(O),Oe(C),void x(!h);j.current.hideMessages(),x(!h),1===s.data.result[0][0].result&&setTimeout((()=>{t.push("/widgets/banner"),u(!1),void 0===e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated)}),8e3)}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/widgets/banner",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})},ad=s(151);var cd=e=>{const[t,s]=Object(d.useState)(),[r,n]=Object(d.useState)(!1);Object(d.useEffect)((()=>{var t;s(i.GetJSON(null===(t=e.props)||void 0===t?void 0:t.data.attribute_options)),n(!r)}),[]),Object(d.useEffect)((()=>{n(!r)}),[t]);const o=()=>1===e.props.data.is_sold?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("span",{className:"badge bg-transparent badge-danger py-2 px-0 btn-fw rounded filter-btn mr-2 fs-14",children:"Sold Out"}),Object(g.jsx)("button",{className:"btn py-2 btn-primary btn-fw rounded filter-btn border-0 mr-2",onClick:e=>j(0),children:"Add to Inventory"})]}):Object(g.jsx)("button",{type:"button",value:"Sold",className:"btn py-2 btn-primary btn-fw rounded filter-btn border-0 mr-2",onClick:e=>u(1),children:"Mark as sold"}),m=()=>{e.onCloseModal(!0)},u=t=>{sc()(l.diamondSoldProp).then((function(s){s&&a.postApi(c.SetSoldDiamondBySKU,{sku:e.props.data.sku,issold:t}).then((t=>{e.onCloseModal(!0)}))}))},j=t=>{sc()(l.diamondReverSoldProp).then((function(s){s&&a.postApi(c.SetSoldDiamondBySKU,{sku:e.props.data.sku,issold:t}).then((t=>{e.onCloseModal(!0)}))}))};return Object(g.jsxs)(li.a,{show:e.props.IsShowModal,onHide:m,keyboard:!0,children:[Object(g.jsxs)(li.a.Header,{children:[Object(g.jsxs)("div",{children:[Object(g.jsxs)("h6",{children:[1===e.props.data.is_gemstone?"Gemstone":"Diamond"," Detail (SKU:"," ",e.props.data.sku,")"]}),Object(g.jsx)(o,{})]}),Object(g.jsx)("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:m,children:Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[Object(g.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Object(g.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),Object(g.jsx)(li.a.Body,{children:Object(g.jsx)("div",{className:"p-0",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"row justify-content-between",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsx)("table",{className:"table table-striped table-borderless table-diamond-detail",children:Object(g.jsx)("tbody",{children:void 0!==t&&t.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-black",children:Object(g.jsx)("b",{children:e.title})}),Object(g.jsx)("td",{children:e.value})]},t)))})})})})})})})})})})})]})},rd=s(606);var ld=()=>{const e=Object(p.useLocation)(),t=Object(rd.useHistory)(),[s,l]=Object(d.useState)(!1),[n,m]=Object(d.useState)(1),[u,j]=Object(d.useState)(!0),[h,x]=Object(d.useState)([]),[O,N]=Object(d.useState)(),[f,_]=Object(d.useState)(!1),[y,w]=Object(d.useState)(!1),k=Object(d.useRef)(null),S=Object(d.useRef)(null),C=[{name:"Image",selector:e=>Object(g.jsx)("img",{className:"my-2",width:"95px",height:"95px",src:e.base_image})},{name:"SKU",selector:e=>e.sku},{name:"Certificate",selector:e=>e.certificate},{name:"Vendor",selector:e=>e.vendor},{name:"Name",wrap:!0,selector:e=>e.name},{name:"Price",selector:e=>e.price},{name:"Weight",selector:e=>e.carat.toFixed(2)},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"cursor action-btn",children:Object(g.jsxs)("span",{onClick:t=>z(t,e.sku),className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"mdi mdi-eye","aria-hidden":"true"})," "]})})}],A={shape:[],cut:[],color:[],clarity:[],sku:"",priceTo:"",priceFrom:"",page:1,search:"",page_size:20,diamond_type:"earth",certificate:""},[P]=Object(d.useState)({color:[],clarity:[],cut:[],shape:[]}),[D,M]=Object(d.useState)(A),[R,F]=Object(d.useState)(),[I,E]=Object(d.useState)(!1),[L,G]=Object(d.useState)(),T=new URLSearchParams(e.search).get("type");Object(d.useEffect)((()=>{i.validatePermission(o.Diamonds)||t.push("/"),l(!0),G(T),_(!f),document.title="gemstone"===T?r.Gemstone:r.Diamond,q(),M(A),_(!f)}),[T]);const B=()=>{const e={sku:D.sku.trim(),priceFrom:Number(D.priceFrom)>0?Number(D.priceFrom):1,priceTo:Number(D.priceTo),category_id:"earth"===D.diamond_type?Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://api.harmonyjewels.co.uk:3030/api/",REACT_APP_DATE_FORMAT:"DD/MM/YYYY, hh:mm A",REACT_APP_FRONTEND_URL:"https://staging.harmonyjewels.co.uk/",REACT_APP_PAGINATION_LIMIT:"20",REACT_APP_S3_BUCKET_URL:"https://hj-website-media.s3.eu-west-2.amazonaws.com/"}).REACT_APP_EARTH_MINED_DIAMOND:Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://api.harmonyjewels.co.uk:3030/api/",REACT_APP_DATE_FORMAT:"DD/MM/YYYY, hh:mm A",REACT_APP_FRONTEND_URL:"https://staging.harmonyjewels.co.uk/",REACT_APP_PAGINATION_LIMIT:"20",REACT_APP_S3_BUCKET_URL:"https://hj-website-media.s3.eu-west-2.amazonaws.com/"}).REACT_APP_LAB_DIAMOND,["gemstone"===T?"gemstone_color":"color"]:D.color,["gemstone"===T?"gemstone_shape":"shape"]:D.shape,["gemstone"===T?"gemstone_clarity":"clarity"]:D.clarity,["gemstone"===T?"gemstone_cut":"cut"]:D.cut,page:D.page,search:D.search,page_size:D.page_size,diamond_type:D.diamond_type,is_gemstone:"gemstone"===T?1:0,certificate:D.certificate.trim()};j(!0),a.postApi(c.GetDiamondsList,e).then((e=>{if(!0===e.data.status){x([]);var t=e.data.result;t.length>0&&(x(t),_(!f),t[0].total_records?F(t[0].total_records):t.length<1&&F(0))}j(!1)}))},z=(e,t)=>{e.preventDefault();const s=h.filter((e=>e.sku===t))[0];N(s),E(!0),_(!f)};Object(d.useEffect)((()=>{B(T)}),[D,L]),Object(d.useEffect)((()=>{void 0!==O&&_(!f)}),[O,I]);const U=(e,t)=>{"color"===t||"cut"===t||"shape"===t||"clarity"===t?Object.assign(D,{[t]:Array.isArray(e)?e.map((e=>e.value)):[]}):Object.assign(D,{[t]:e.target.value}),_(!f)},q=()=>{var e={is_from_admin:!0,is_gemstone:"gemstone"===T?1:0};a.postApi(c.GetDiamondDefaultFilters,e).then((e=>{const t=e.data.result[0][0].shape,s=e.data.result[0][0].color,a=e.data.result[0][0].clarity,c=e.data.result[0][0].cut,r=[],l=[],n=[],i=[];null===t||void 0===t||t.map(((e,t)=>(r.push({label:e.label,value:e.value}),!0))),null===s||void 0===s||s.map(((e,t)=>(l.push({label:e.label,value:e.value}),!0))),null===a||void 0===a||a.map(((e,t)=>(n.push({label:e.label,value:e.value}),!0))),null===c||void 0===c||c.map(((e,t)=>(i.push({label:e.label,value:e.value}),!0))),Object.assign(P,{shape:r,color:l,clarity:n,cut:i})}))},[H]=Object(d.useState)("rf,test,new");return s?Object(g.jsxs)(g.Fragment,{children:[!0===I&&Object(g.jsx)(cd,{props:{IsShowModal:I,data:O},onCloseModal:()=>{E(!1),B(),_(!f)}}),Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ","gemstone"===T?r.Gemstone:r.Diamond," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(b.b,{to:"#",onClick:e=>(e=>{e.preventDefault(),w(!y)})(e),className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:["Filters"," "]})})]}),Object(g.jsx)("div",{className:y?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{children:[Object(g.jsxs)("div",{className:"row",children:["gemstone"!==T&&Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Type"})}),Object(g.jsxs)("select",{className:"form-control",name:"diamond_type",onChange:e=>U(e,"diamond_type"),value:D.diamond_type,children:[Object(g.jsx)("option",{value:"earth",children:"Earth"}),Object(g.jsx)("option",{value:"lab",children:"Lab"})]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Certificate"})}),Object(g.jsx)("input",{type:"text",className:"form-control",value:D.certificate,onChange:e=>U(e,"certificate")})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"SKU"})}),Object(g.jsx)("input",{type:"text",className:"form-control",value:D.sku,onChange:e=>U(e,"sku")})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Price"})}),Object(g.jsxs)("div",{className:"form-group mb-2 row align-items-center",children:[Object(g.jsx)("div",{className:"col-md-6 pr-md-2",children:Object(g.jsx)("input",{type:"number",className:"form-control",min:0,ref:S,placeholder:"From",onChange:e=>U(e,"priceFrom"),value:D.priceFrom})}),Object(g.jsx)("div",{className:"col-md-6 pl-md-2",children:Object(g.jsx)("input",{type:"number",className:"form-control",min:0,ref:k,placeholder:"To",onChange:e=>U(e,"priceTo"),value:D.priceTo})})]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Shape"})}),Object(g.jsx)(ad.a,{className:"dropdown",placeholder:"Select",value:P.shape.filter((e=>{var t;return null===(t=D.shape)||void 0===t?void 0:t.includes(e.value)})),options:P.shape,onChange:e=>U(e,"shape"),isMulti:!0,isClearable:!0})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Color"})}),Object(g.jsx)(ad.a,{className:"dropdown",placeholder:"Select",value:P.color.filter((e=>{var t;return null===(t=D.color)||void 0===t?void 0:t.includes(e.value)})),options:P.color,onChange:e=>U(e,"color"),isMulti:!0,isClearable:!0})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Clarity"})}),Object(g.jsx)(ad.a,{className:"dropdown",placeholder:"Select",value:P.clarity.filter((e=>{var t;return null===(t=D.clarity)||void 0===t?void 0:t.includes(e.value)})),options:P.clarity,onChange:e=>U(e,"clarity"),isMulti:!0,isClearable:!0})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-2",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Cut"})}),Object(g.jsx)(ad.a,{className:"dropdown",placeholder:"Select",value:P.cut.filter((e=>{var t;return null===(t=D.cut)||void 0===t?void 0:t.includes(e.value)})),options:P.cut,onChange:e=>U(e,"cut"),isMulti:!0,isClearable:!0})]})}),Object(g.jsxs)("div",{className:"col-md-6 col-lg-3 mt-1 pt-3 text-left",children:[Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-custom text-white btn-fw-130 rounded mr-2",onClick:e=>(()=>{const e="page";m(1),M({...D,[e]:1})})(),children:[" ","Apply"]})}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-primary btn-fw-130 rounded mr-2",onClick:e=>(M(A),H([]),k.current.value="",S.current.value="",void _(!f)),children:[" ","Reset"," "]})})]})]}),Object(g.jsx)("div",{className:"row mt-2"})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:C,data:h,persistTableHead:!0,progressPending:u,progressComponent:Object(g.jsx)(v,{}),selectableRows:!0,pagination:!0,paginationServer:!0,paginationPerPage:20,paginationTotalRows:R,onChangeRowsPerPage:e=>{m(1),M({...D,page:1,page_size:e})},onChangePage:e=>{m(e),M({...D,page:e})},paginationDefaultPage:n})})})})})})]})]}):Object(g.jsx)(v,{})},nd=s(1036);s(373);var id=()=>{var e,t,s,l,n,m,u,j,h,x,O,N,f,_,y,w,k,S,C,A,P,D;const M=Object(p.useHistory)(),R=Object(p.useLocation)(),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)(!1),[G,T]=Object(d.useState)(!1),[B,z]=Object(d.useState)([]),[U,q]=Object(d.useState)(!1),[H]=Object(d.useState)([]),[V,K]=Object(d.useState)(),[W,Y]=Object(d.useState)(!0),[Q,X]=Object(d.useState)(R.state?0===parseInt(R.state.state.page)||isNaN(R.state.state.page)?1:parseInt(R.state.state.page):1),J={ordernumber:void 0!==(null===(e=R.state)||void 0===e||null===(t=e.state)||void 0===t?void 0:t.ordernumber)?R.state.state.ordernumber:"",email:void 0!==(null===(s=R.state)||void 0===s||null===(l=s.state)||void 0===l?void 0:l.email)?R.state.state.email:"",status:void 0!==(null===(n=R.state)||void 0===n||null===(m=n.state)||void 0===m?void 0:m.status)&&null!==(null===(u=R.state)||void 0===u||null===(j=u.state)||void 0===j?void 0:j.status)?R.state.state.status:"",orderfromdate:void 0!==(null===(h=R.state)||void 0===h||null===(x=h.state)||void 0===x?void 0:x.orderfromdate)&&null!==(null===(O=R.state)||void 0===O||null===(N=O.state)||void 0===N?void 0:N.orderfromdate)?new Date(R.state.state.orderfromdate):"",ordertodate:void 0!==(null===(f=R.state)||void 0===f||null===(_=f.state)||void 0===_?void 0:_.ordertodate)&&null!==(null===(y=R.state)||void 0===y||null===(w=y.state)||void 0===w?void 0:w.ordertodate)?new Date(R.state.state.ordertodate):"",country:"",name:void 0!==(null===(k=R.state)||void 0===k||null===(S=k.state)||void 0===S?void 0:S.name)?R.state.state.name:"",paymentmethod:"",page:R.state?0===parseInt(R.state.state.page)||void 0===(null===(C=R.state)||void 0===C||null===(A=C.state)||void 0===A?void 0:A.page)||null===(null===(P=R.state)||void 0===P||null===(D=P.state)||void 0===D?void 0:D.page)||isNaN(R.state.state.page)?1:parseInt(R.state.state.page):1,page_size:10},[Z,$]=Object(d.useState)(J),ee=[{name:"Order Number",selector:e=>e.order_number,wrap:!0},{name:"Email",selector:e=>e.email,wrap:!0},{name:"Is Guest",selector:e=>1===e.customer_is_guest?"YES":"NO"},{name:"Total",selector:e=>e.symbol+e.final_price},{name:"Item(s)",selector:e=>e.qty},{name:"Order Status",selector:e=>e.order_status},{name:"Order Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),wrap:!0},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/order/view/order_id/"+e.order_number+"?page="+Z.page+"&ordernumber="+Z.ordernumber+"&email="+Z.email+"&orderfromdate="+Z.orderfromdate+"&ordertodate="+Z.ordertodate+"&status="+Z.status+"&name="+Z.name,className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"mdi mdi-eye","aria-hidden":"true"})," "]}),void 0!==e.invoice_path&&""!==e.invoice_path?Object(g.jsxs)("a",{href:e.invoice_path,rel:"noreferrer",className:"text-dark",title:"Invoice",children:[Object(g.jsx)("i",{className:"fa fa-file-pdf-o","aria-hidden":"true"})," "]}):""]})}];Object(d.useEffect)((()=>{i.validatePermission(o.Sales)||M.push("/"),L(!0),T(!G),document.title=r.Order,se(),ce(),te()}),[Z]);const te=e=>{a.getApi(c.GetOrderStatusList).then((e=>{const t=e.data.result,s=[];for(const a in t)s.push({label:t[a].status,value:t[a].status.toUpperCase()});z(s)}))},se=()=>{const e={ordernumber:Z.ordernumber,email:Z.email,status:Z.status,orderfromdate:Z.orderfromdate,ordertodate:Z.ordertodate,country:Z.country,name:Z.name,paymentmethod:Z.paymentmethod,page:Z.page,page_size:Z.page_size};Y(!0),a.postApi(c.GetOrderAdminLists,e).then((e=>{Y(!1);const t=e.data.result[1];I(t),K(e.data.result[0][0].total_row),T(!G)}))},ae=(e,t)=>{"status"===t||"country"===t||"paymentmethod"===t?Object.assign(Z,{[t]:e}):"orderdate"===t?null!==e.value?(Object.assign(Z,{orderfromdate:e.value[0]}),Object.assign(Z,{ordertodate:e.value[1]})):(Object.assign(Z,{orderfromdate:""}),Object.assign(Z,{ordertodate:""})):Z[t]=e.target.value,T(!G)},ce=()=>{a.getApi(c.GetCountryWithCurrencyList).then((e=>{const t=e.data.result[0],s=[];t.map(((e,t)=>(s.push({label:e.name,value:e.id}),!0))),Object.assign(H,s)}))},[re]=Object(d.useState)("rf,test,new");return E?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Order," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(b.b,{to:"#",onClick:()=>{q(!U)},className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})})]}),Object(g.jsx)("div",{className:U?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{children:[Object(g.jsxs)("div",{className:"active-filter-box d-none mb-",children:[Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-10",children:Object(g.jsx)("div",{className:"filter-result-list",children:Object(g.jsx)("span",{className:"filter-result-repeat-title",children:"Active Filter : "})})}),Object(g.jsx)("div",{className:"col-md-2 text-right",children:Object(g.jsxs)(b.b,{to:"#",className:"rounded mr-2 font-13",children:[" ","Clear All"," "]})})]}),Object(g.jsx)("hr",{})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Order Number"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:e=>ae(e,"ordernumber"),value:Z.ordernumber})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Email"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:e=>ae(e,"email"),value:Z.email})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Name"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:e=>ae(e,"name"),value:Z.name})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Order Date"})}),Object(g.jsx)(nd.a,{onChange:e=>ae(e,"orderdate"),value:[Z.orderfromdate,Z.ordertodate]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Order Status"})}),Object(g.jsx)(yi.a,{onChange:e=>ae(e,"status"),options:B,defaultValue:Z.status.split(",")})]})}),Object(g.jsxs)("div",{className:"col-md-6 col-lg-3 mt-1 pt-3 text-left",children:[Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"#",className:"btn btn-dark btn-fw-130 rounded mr-2",onClick:e=>se(e),children:[" ","Apply"," "]})}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsx)("span",{className:"filter-result-repeat",children:Object(g.jsx)(b.b,{children:Object(g.jsx)("button",{className:"btn btn-primary btn-fw-130 rounded mr-2",onClick:()=>{$(J),re([]),T(!G)},children:"Reset"})})})})]})]})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right mb-2",onClick:()=>{a.getApi(c.GetOrderExcel).then((e=>{e.data.result&&co(e.data.result[0],"Orders")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:ee,data:F,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:V,onChangeRowsPerPage:e=>{X(1),$({...Z,page:1,page_size:e})},onChangePage:e=>{X(e),$({...Z,page:e})},responsive:!0,progressPending:W,paginationDefaultPage:Q,progressComponent:Object(g.jsx)(v,{})})})]})})})})]}):Object(g.jsx)(v,{})};var od=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(p.useLocation)(),l=new URLSearchParams(s.search),n=l.get("name"),u=l.get("status"),j=l.get("ordernumber"),b=l.get("email"),h=l.get("orderfromdate"),x=l.get("ordertodate"),O=l.get("page"),N=Object(d.useRef)(new ec.a),[f,_]=Object(d.useState)(!1),[y,w]=Object(d.useState)(!1),[k,S]=Object(d.useState)([]),[C,A]=Object(d.useState)([]),[P,D]=Object(d.useState)([]),[M,R]=Object(d.useState)([]),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)(""),G=m.a.useRef(),[T,B]=Object(d.useState)(!1),[z,U]=Object(d.useState)(""),[q,H]=Object(d.useState)(""),[V,K]=Object(d.useState)([]),[W,Y]=Object(d.useState)({id:0,refund_type:"full",refund_amount:"",tracking_number:"",shipping_type:"",DeliveryDate:""});Object(d.useEffect)((()=>{i.validatePermission(o.Products)||t.push("/"),_(!0),w(!y),document.title=r.OrdersDetails,Q(),X()}),[e.id]);const Q=()=>{a.postApi(c.GetShippingRate,{page:1,search:"",page_size:50,sort_column:"",sort_direction:""}).then((e=>{try{K(e.data.result[1])}catch(t){console.error(t)}}))},X=()=>{const t={OrderNumber:e.id};a.postApi(c.GetOrderDetail,t).then((e=>{var t;const s=e.data.result[0][0],a=i.GetJSON(s.addresses);let c=s.products;var r,l;(c=i.GetJSON(c),c.sort(((e,t)=>e.id-t.id)),null===(t=c)||void 0===t||t.map((e=>(e.product_options=JSON.parse(e.product_options),!0))),S(s),I(c),null!==a&&(D(a[0]),R(a[1])),U(s.order_status_id),null!==k.remaining_refund_amount)?Y({...W,refund_amount:null!==(r=k.remaining_refund_amount)&&void 0!==r?r:0}):Y({...W,refund_amount:null!==(l=k.order_total)&&void 0!==l?l:0});w(!y),s.shipping_method&&Y({...W,shipping_type:null===s||void 0===s?void 0:s.shipping_method}),J(s.order_status_id),"SHIPPING"===s.order_status&&(Y({...W,shipping_type:s.shipping_method,tracking_number:s.order_tracking_number,DeliveryDate:new Date(s.delivery_date).toISOString().split("T")[0]}),w(!y))}))},J=e=>{a.getApi(c.GetOrderStatusList).then((t=>{const s=t.data.result,a=s.filter((t=>t.id===e))[0];for(let e=0;e"CONFIRMED"===e.status))[0].is_disable=!1:"CONFIRMED"===a.status?s.filter((e=>"INPROCESS"===e.status))[0].is_disable=!1:"INPROCESS"===a.status?(s.filter((e=>"ON HOLD"===e.status))[0].is_disable=!1,s.filter((e=>"COMPLETED"===e.status))[0].is_disable=!1):"ON HOLD"===a.status||"COMPLETED"===a.status?s.filter((e=>"SHIPPING"===e.status))[0].is_disable=!1:"CANCELLED"===a.status&&(s.filter((e=>"REFUNDED"===e.status))[0].is_disable=!1),A(s),H(a.status)}))},Z=e=>t=>{if("status"===e){const e=parseInt(t.target.value),s=C.filter((t=>t.id===e))[0];H(s.status),U(t.target.value)}else if("refund_type"===e){var s;if("refund_type"===e&&"partial"===t.target.value)Y({...W,[e]:t.target.value,refund_amount:null!==(s=k.remaining_refund_amount)&&void 0!==s?s:0});else if("refund_type"===e&&"full"===t.target.value){var a,c;if(null!==k.remaining_refund_amount)Y({...W,[e]:t.target.value,refund_amount:null!==(a=k.remaining_refund_amount)&&void 0!==a?a:0});else Y({...W,[e]:t.target.value,refund_amount:null!==(c=k.final_price)&&void 0!==c?c:0})}}else Y({...W,[e]:t.target.value});w(!y)};return f?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[r.OrdersDetails," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{t.push("/sales/orders",{state:{page:0===parseInt(O)?1:parseInt(O),ordernumber:j,ordertodate:x,email:b,orderfromdate:h,status:u,name:n}})},children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Order & Account Information"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsxs)("h4",{children:["Order ",k.order_number]}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Order Date"}),Object(g.jsx)("td",{className:"text-right",children:Object(g.jsx)(Zn,{value:k.created_at})})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Order Status"}),Object(g.jsx)("td",{className:"text-right",children:k.order_status})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Nivoda Order ID"}),Object(g.jsx)("td",{className:"text-right",children:k.nivoda_order_id})]})]})})]})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Account Information"}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Customer Name"}),Object(g.jsxs)("td",{className:"text-right",children:[P.firstname," ",P.lastname]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Email"}),Object(g.jsx)("td",{className:"text-right",children:Object(g.jsx)("a",{href:"mailto:"+k.email,children:k.email})})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Phone"}),Object(g.jsx)("td",{className:"text-right",children:k.phone})]})]})})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Address Information"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Billing Address "}),Object(g.jsxs)("p",{children:[P.firstname," ",P.lastname,Object(g.jsx)("br",{}),P.street," ",P.city,Object(g.jsx)("br",{}),P.state," ",P.country,Object(g.jsx)("br",{}),"Pin code : ",P.postcode,Object(g.jsx)("br",{})]})]})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Shipping Address "}),Object(g.jsxs)("p",{children:[M.firstname," ",M.lastname,Object(g.jsx)("br",{}),M.street," ",M.city,Object(g.jsx)("br",{}),M.state," ",M.country,Object(g.jsx)("br",{}),"Pin code : ",M.postcode,Object(g.jsx)("br",{})]})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Payment & Shipping Method"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Payment Information"}),Object(g.jsx)("p",{children:i.GetPaymentMethod(k.payment_method)}),Object(g.jsxs)("p",{children:["The order was placed using ",k.currency_name,"."]})]})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Shipping & Handling Information"}),Object(g.jsx)("p",{children:Object(g.jsx)("b",{children:"Free"})})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Items Ordered"})})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table text-center",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{children:"Product"}),Object(g.jsx)("th",{children:"Country/Size"}),Object(g.jsx)("th",{children:"SKU/Certificate"}),Object(g.jsx)("th",{children:"Price"}),Object(g.jsx)("th",{children:"Qty"}),Object(g.jsx)("th",{children:"Product Discount"}),Object(g.jsx)("th",{children:"Total"})]})}),Object(g.jsx)("tbody",{children:null===F||void 0===F?void 0:F.map(((e,t)=>{var s,a,c,r;return Object(g.jsxs)("tr",{children:[Object(g.jsxs)("td",{children:[e.name,Object(g.jsx)("br",{}),e.is_diamond?"":Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)(g.Fragment,{children:[e.product_options.filter((e=>1===e.show_in_storefront&&0===e.Is_standalone)).map(((e,t,s)=>Object(g.jsxs)("span",{children:[e.title,": ",Object(g.jsx)("b",{children:e.value}),t!==(null===s||void 0===s?void 0:s.length)-1&&(t+1)%3!==0&&", ",(t+1)%3===0&&Object(g.jsx)("br",{})]},t))),(null===(s=e.stand_alone_attribute)||void 0===s?void 0:s.length)>0&&e.stand_alone_attribute.map((e=>1===e.Is_standalone&&Object(g.jsxs)("span",{children:[", ",e.attribute_name," :"," ",Object(g.jsx)("b",{children:e.selected_value_label})]},e.title)))]})})]}),Object(g.jsxs)("td",{children:[0===e.is_diamond&&"0"!==e.size?e.country+" - ":"",0===e.is_diamond&&"0"!==e.size?e.size:"-"]}),Object(g.jsx)("td",{children:0===e.is_diamond?e.sku:"".concat(e.sku).concat(null!==e&&void 0!==e&&null!==(a=e.product_options)&&void 0!==a&&null!==(c=a.find((e=>"Certificate"===(null===e||void 0===e?void 0:e.title))))&&void 0!==c&&c.value?" / ".concat(null===(r=e.product_options.find((e=>"Certificate"===(null===e||void 0===e?void 0:e.title))))||void 0===r?void 0:r.value):"")}),Object(g.jsxs)("td",{children:[k.symbol," ",e.price]}),Object(g.jsx)("td",{children:e.qty}),Object(g.jsxs)("td",{children:[k.symbol,e.discount_amount]}),Object(g.jsxs)("td",{children:[k.symbol,e.final_price]})]},t)}))})]})})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Order Total"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsxs)("form",{className:"mt-0",onSubmit:async e=>{if(e.preventDefault(),!N.current.allValid())return N.current.showMessages(),void w(!y);if("partial"===W.refund_type&&parseFloat(W.refund_amount)>k.remaining_refund_amount)return void L("Refund amount should not greater than remaining refund amount");L("");const t={_order_id:k.id,order_number:k.order_number,status:z,refund_type:W.refund_type,refund_amount:"partial"===W.refund_type?W.refund_amount:k.order_total-k.total_refunded_amount,is_refund:"REFUNDED"===q?1:0,is_customer_notified:T,comment:G.current.value,tracking_number:W.tracking_number,shipping_method:W.shipping_type,delivery_date:W.DeliveryDate};a.postApi(c.UpdateOrderStatus,t).then((e=>{e.data.result&&(gl.b.success(e.data.result),G.current.value="",N.current.hideMessages(),B(!1),X())}))},children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Status"})}),Object(g.jsx)("select",{id:"inputState",className:"form-control w-50",value:z,onChange:Z("status"),children:C.map(((e,t)=>Object(g.jsx)("option",{value:e.id,hidden:e.is_disable,children:e.status},t)))})]}),"SHIPPING"===q&&Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Shipping Type"})}),Object(g.jsx)("select",{name:"shipping_type",className:"form-control w-50",value:W.shipping_type,onChange:Z("shipping_type"),children:V.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Tracking Number"})}),Object(g.jsx)("input",{type:"text",name:"tracking_number",value:W.tracking_number,className:"form-control",onChange:Z("tracking_number")})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Delivery Date"})}),Object(g.jsx)("input",{type:"date",className:"form-control",name:"DeliveryDate",min:(new Date).toISOString().split("T")[0],onChange:Z("DeliveryDate"),value:W.DeliveryDate,placeholder:"Delivery Date"})]})})]}),"REFUNDED"===q&&k.final_price!==k.total_refunded_amount?Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Refund Type"})}),Object(g.jsxs)("select",{name:"refund_type",className:"form-control w-50",value:W.refund_type,onChange:Z("refund_type"),onBlur:()=>N.current.showMessageFor("refund_amount"),children:[Object(g.jsx)("option",{value:"full",children:"Full"}),Object(g.jsx)("option",{value:"partial",children:"Partial"})]}),N.current.message("Refund Type",W.refund_type,"required",{className:"error"})]}),"partial"===W.refund_type?Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Refund Amount"})}),Object(g.jsx)("input",{type:"number",name:"refund_amount",step:"1",min:1,value:Math.round(W.refund_amount),className:"form-control",onChange:Z("refund_amount")}),N.current.message("Refund Amount",W.refund_amount,"partial"===W.refund_type?"required":"",{className:"error"}),Object(g.jsx)("p",{className:"error",children:E})]}):""]})}):"",Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Comment"})}),Object(g.jsx)("textarea",{type:"text",className:"form-control",ref:G})]}),Object(g.jsxs)("div",{className:"form-group form-check mb-2",children:[Object(g.jsx)("input",{type:"checkbox",className:"form-check-input ml-0 checkbox",id:"exampleCheck1",checked:T,onChange:e=>B(e.target.checked)}),Object(g.jsx)("label",{className:"form-check-label",htmlFor:"exampleCheck1",children:"Notify Customer by Email"})]}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsx)("button",{className:"btn btn-dark btn-fw rounded",children:" Submit "})})})]})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsxs)("table",{className:"table table-striped table-borderless",children:[Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Subtotal"}),Object(g.jsxs)("th",{className:"text-right",children:[k.symbol,k.order_subtotal]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"border-bottom text-left",children:"Coupon Discount"}),Object(g.jsxs)("td",{className:"text-right border-bottom",children:[k.symbol,k.discount_amount]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"border-bottom bg-white text-left",children:"Shipping"}),Object(g.jsxs)("td",{className:"text-right border-bottom bg-white",children:[k.symbol,k.shipping_amount]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsxs)("td",{className:"border-bottom text-left",children:["VAT/Tax (",k.tax_percentage,"%)"]}),Object(g.jsxs)("td",{className:"text-right border-bottom",children:[k.symbol,k.tax_amount]})]}),(k.card_fee&&"bank_transfer"!==k.payment_method)>0&&Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"border-bottom text-left",children:"Card Fee"}),Object(g.jsxs)("td",{className:"text-right border-bottom",children:[k.symbol,k.card_fee]})]})]}),Object(g.jsxs)("tfoot",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Grand Total"}),Object(g.jsxs)("th",{className:"text-right",children:[k.symbol,k.final_price]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Total Paid"}),Object(g.jsxs)("th",{className:"text-right",children:[k.symbol,k.final_price]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Total Refunded"}),Object(g.jsxs)("th",{className:"text-right",children:[k.symbol,k.total_refunded_amount]})]})]})]})})})]})})})})})]}):Object(g.jsx)(v,{})};var dd=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(!1),[j,p]=Object(d.useState)(1),[h,x]=Object(d.useState)(!0),[O,N]=Object(d.useState)(""),f=[{name:"Name",sortable:!0,sortField:"coupon_code",selector:e=>e.coupon_code},{name:"Expire Date",selector:e=>Object(g.jsx)(Zn,{value:e.expire_date})},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/coupons/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[_,y]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[w,k]=Object(d.useState)();Object(d.useEffect)((()=>{u(!0),document.title=r.Coupons,S()}),[_,O]);const S=()=>{const e={page:_.page,search:O,page_size:_.page_size,sort_column:_.sort_column,sort_direction:_.sort_direction};x(!0),a.postApi(c.GetCouponAdminList,e).then((e=>{if(x(!1),!0===e.data.status){const s=e.data.result[1];t(s),i(!n),k(e.data.result[0][0].total_coupon)}}))},C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search for Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{N(e.target.value)}),1e3)}))),A=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};x(!0),a.postApi(c.DeleteCoupon,e).then((e=>{x(!1),gl.b.success(l.RecordDeleted),S(),i(!n)}))}}))};return o?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Coupons," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/coupons/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Coupon"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.postApi(c.GetCouponExcel).then((e=>{e.data.result&&co(e.data.result[0],"Coupons")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:f,data:e,pagination:!0,paginationDefaultPage:j,paginationServer:!0,persistTableHead:!0,paginationTotalRows:w,onChangeRowsPerPage:e=>{p(1),y({..._,page:1,page_size:e})},onChangePage:e=>{p(e),y({..._,page:e})},subHeader:!0,progressPending:h,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:C,onSort:(e,t)=>{y({..._,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})]})})})})]}):Object(g.jsx)(v,{})};var md=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),n=Object(d.useContext)(mo),[o,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)([]),[h,x]=Object(d.useState)([]),[O,N]=Object(d.useState)([]),[f,_]=Object(d.useState)([]),[y,w]=Object(d.useState)([]),[k,S]=Object(d.useState)([]),[C,A]=Object(d.useState)([]),[P,D]=Object(d.useState)([]),[M,R]=Object(d.useState)([]),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)([]),[G,T]=Object(d.useState)([]),[B,z]=Object(d.useState)([]),[U,q]=Object(d.useState)(!1),[H,V]=Object(d.useState)(!0),[K,W]=Object(d.useState)({id:0,coupon_code:"",description:"",discount_type:"fixed_cart_discount",amount_type:"percentage",coupon_amount:"",coupon_percentage:"",coupon_expiry:"",minimum_spend:"",maximum_spend:"",usage_coupon:"",usage_limit_item:"",usage_limit_user:1,status:0});Object(d.useEffect)((()=>{q(!0),V(!1),document.title=r.AddCoupons,void 0!==e.id&&(document.title=r.EditCoupons,Y()),Q()}),[e.id]);const Y=()=>{const t={id:e.id};V(!0),a.postApi(c.GetCouponDetail,t).then((e=>{if(V(!1),e.data.result){const t=e.data.result[0][0],s={id:t.id,coupon_code:t.coupon_code,description:t.description,discount_type:t.discount_type,coupon_amount:t.coupon_amount,coupon_percentage:t.coupon_percentage,amount_type:0!==t.coupon_amount&&null!==t.coupon_amount?"amount":"percentage",coupon_expiry:t.expire_date,minimum_spend:t.minimum_spend,maximum_spend:t.maximum_spend,usage_coupon:t.used_per_coupon,usage_limit_item:t.limit_cart_products,usage_limit_user:t.used_per_user,status:t.status};if(""!==s.coupon_expiry){const e=new Date(s.coupon_expiry).toISOString().split("T")[0];s.coupon_expiry=e}W(s),I(null!==t.product_ids&&t.product_ids.length>0?i.GetJSON(t.product_ids):[]),S(null!==t.product_ids&&t.product_ids.length>0?t.products:[]),L(null!==t.exclude_product_ids&&t.exclude_product_ids.length>0?i.GetJSON(t.exclude_product_ids):[]),A(null!==t.exclude_product_ids&&t.exclude_product_ids.length>0?t.exclude_products:[]),z(null!==t.user_ids&&t.user_ids.length>0?i.GetJSON(t.user_ids):[]),Q(t.category_ids),D(null!==t.user_ids&&t.user_ids.length>0?t.customers:[]),m(!o)}}))},Q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;V(!0),a.postApi(c.GetCategory,null).then((s=>{if(V(!1),s.data.result){s.data.result[0]=s.data.result[0].filter((e=>1===e.status));const i=s.data.result[0].filter((e=>1===e.parent_id&&0===e.is_diamond_category)),o=[],d=[];if(i.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id&&0===t.is_diamond_category)),a=[];t.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id&&0===t.is_diamond_category)),c=[];return t.map((e=>(c.push({label:e.name,value:e.id,checked:!1,children:[]}),!0))),a.push({label:e.name,value:e.id,checked:!1,children:c}),!0}));const c=[];return t.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id&&0===t.is_diamond_category)),a=[];return t.map((e=>(a.push({label:e.name,value:e.id,checked:!1,children:[]}),!0))),c.push({label:e.name,value:e.id,checked:!1,children:a}),!0})),o.push({label:e.name,value:e.id,children:a,checked:!1}),d.push({label:e.name,value:e.id,children:c,checked:!1}),!0})),null!==e)for(var a=0;a(e===o[a].value&&(o[a].checked=!0),!0)));var c=o[a].children;if(c.length>0)for(var r=0;r(e===c[r].value&&(c[r].checked=!0),!0)));var l=c[r].children;if(l.length>0)for(var n=0;n(e===l[n].value&&(l[n].checked=!0),!0)))}}if(j(o),null!==t)for(a=0;a(e===d[a].value&&(d[a].checked=!0),!0))),(c=d[a].children).length>0)for(r=0;r(e===c[r].value&&(c[r].checked=!0),!0))),(l=c[r].children).length>0)for(n=0;n(e===l[n].value&&(l[n].checked=!0),!0)));x(d)}}))},X=e=>{const t=e.target.name,a=e.target.value;W("status"===t?{...K,[t]:e.target.checked}:{...K,[t]:a}),"percentage"===t?s.current.hideMessageFor("coupon_amount"):"amount"===t&&s.current.hideMessageFor("coupon_percentage"),m(!o)};return!U||H?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditCoupons:r.AddCoupons," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Coupon Code"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"coupon_code",onChange:X,value:K.coupon_code,placeholder:"Coupon Code"}),s.current.message("Coupon Code",K.coupon_code,"required|alpha_num_dash|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:X,id:"EnableProduct",checked:K.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("textarea",{className:"form-control",name:"description",onChange:X,value:K.description,placeholder:"Description",rows:"2"}),s.current.message("Description",K.description,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Discount Type"}),Object(g.jsxs)("select",{className:"form-control",name:"discount_type",onChange:X,value:K.discount_type,disabled:!0,children:[Object(g.jsx)("option",{value:"fixed_cart_discount",children:"Fixed Cart Discount"}),Object(g.jsx)("option",{value:"fixed_product_discount",children:"Fixed Product Discount"})]}),s.current.message("Discount Type",K.discount_type,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Coupon Amount"}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("select",{className:"form-control",name:"amount_type",value:K.amount_type,onChange:X,children:[Object(g.jsx)("option",{value:"percentage",children:"%"}),Object(g.jsx)("option",{value:"amount",children:"Amount"})]})}),"percentage"===K.amount_type&&Object(g.jsxs)("div",{className:"col-md-9",children:[Object(g.jsx)("input",{type:"number",className:"form-control",name:"coupon_percentage",onChange:X,value:K.coupon_percentage,placeholder:"Coupon Percentage",onWheel:e=>e.currentTarget.blur()}),s.current.message("coupon_percentage",K.coupon_percentage,"amount"!==K.amount_type?"required|numeric|max:99,num|min:0,num":"",{className:"error"})]}),"amount"===K.amount_type&&Object(g.jsxs)("div",{className:"col-md-9",children:[Object(g.jsx)("input",{type:"number",className:"form-control",name:"coupon_amount",onChange:X,value:K.coupon_amount,placeholder:"Coupon Amount",onWheel:e=>e.currentTarget.blur(),min:"0"}),s.current.message("coupon_amount",K.coupon_amount,"percentage"!==K.amount_type?"required|numeric|min:0,num":"",{className:"error"})]})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Coupon Expiry Date"}),Object(g.jsx)(ki.a,{name:"coupon_expiry",value:K.coupon_expiry?new Date(K.coupon_expiry):null,change:e=>X({target:{name:"coupon_expiry",value:e.value}}),format:"dd/MM/yyyy",placeholder:"Coupon Expiry Date"}),s.current.message("Coupon Expiry Date",K.coupon_expiry,"required",{className:"error"})]})}),"fixed_product_discount"!==K.discount_type&&Object(g.jsxs)(g.Fragment,{children:[" ",Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("label",{children:["Minimum Spend",Object(g.jsxs)("svg",{"data-toggle":"tooltip","data-html":"true",title:"test content",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#000000d4",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-info ml-1 cursor",children:[Object(g.jsx)("circle",{cx:"12",cy:"12",r:"10"}),Object(g.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),Object(g.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})]}),Object(g.jsx)("input",{type:"number",min:"0",step:"1",className:"form-control",name:"minimum_spend",onChange:X,value:K.minimum_spend,onWheel:e=>e.currentTarget.blur(),placeholder:"Minimum Spend"}),s.current.message("minimum_spend",K.minimum_spend,"fixed_product_discount"!==K.discount_type?"required|numeric|max:".concat(null!==K.maximum_spend&&""!==K.maximum_spend?parseInt(K.maximum_spend)-1:0,",num"):"",{className:"error",messages:{max:l.MinimumSpendError+(null!==K.maximum_spend&&""!==K.maximum_spend?K.maximum_spend:0)}})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Maximum Spend"}),Object(g.jsx)("input",{type:"number",min:"0",step:"1",className:"form-control",name:"maximum_spend",onChange:X,value:K.maximum_spend,onWheel:e=>e.currentTarget.blur(),placeholder:"Maximum Spend"}),s.current.message("maximum_spend",K.maximum_spend,"fixed_product_discount"!==K.discount_type?"required":"",{className:"error"})]})})]}),"fixed_cart_discount"!==K.discount_type&&Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:null!==O&&O.length>0||null!==f&&f.length>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Products"}),Object(g.jsx)(Di.ReactTags,{selected:k,suggestions:y,onDelete:e=>{const t=k.slice(0);t.splice(e,1),S(t),I(t.map((e=>e.value))),m(!o)},onAdd:e=>{const t=[...k,e];S(t),I(t.map((e=>e.value))),m(!o)},onInput:e=>{if(e.trim().length<3)return w();new Promise((t=>{const s={term:e};a.postApi(c.SearchProducts,s).then((e=>{let s=[];s=e.data.result.length>0?e.data.result.map((e=>({value:e.id,label:e.name+" - "+e.sku}))):[],w(s),m(!o),t(s)}))}))},placeholderText:"Type to search"})]})}),Object(g.jsx)("div",{className:null!==O&&O.length>0||null!==f&&f.length>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Exclude Products"}),Object(g.jsx)(Di.ReactTags,{selected:C,suggestions:M,onDelete:e=>{const t=C.slice(0);t.splice(e,1),A(t),L(t.map((e=>e.value))),m(!o)},onAdd:e=>{const t=[...C,e];A(t),L(t.map((e=>e.value))),m(!o)},onInput:e=>{if(e.trim().length<3)return R();new Promise((t=>{const s={term:e};a.postApi(c.SearchProducts,s).then((e=>{let s=[];s=e.data.result.length>0?e.data.result.map((e=>({value:e.id,label:e.name+" - "+e.sku}))):[],R(s),m(!o),t(s)}))}))},placeholderText:"Type to search"})]})}),Object(g.jsx)("div",{className:null!==F&&F.length>0||null!==E&&E.length>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),u.length>0&&Object(g.jsx)(ei.a,{data:u,id:"categorySelect",mode:"hierarchical",onChange:(e,t)=>{const s=[];if(t.length>0)for(let a=0;a(s.indexOf(e.value)>=0?u[t].checked=!0:u[t].checked=!1,e.children.map(((e,a)=>(s.indexOf(e.value)>=0?u[t].children[a].checked=!0:u[t].children[a].checked=!1,e.children.map(((e,c)=>(s.indexOf(e.value)>=0?u[t].children[a].children[c].checked=!0:u[t].children[a].children[c].checked=!1,!0))),!0))),!0)))},className:"bootstrap-demo w-100"})]})}),Object(g.jsx)("div",{className:null!==F&&F.length>0||null!==E&&E.length>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Exclude Category"}),h.length>0&&Object(g.jsx)(ei.a,{data:h,id:"excludeCategorySelect",mode:"hierarchical",onChange:(e,t)=>{const s=[];if(t.length>0)for(let a=0;a(s.indexOf(e.value)>=0?h[t].checked=!0:h[t].checked=!1,e.children.map(((e,a)=>(s.indexOf(e.value)>=0?h[t].children[a].checked=!0:h[t].children[a].checked=!1,e.children.map(((e,c)=>(s.indexOf(e.value)>=0?h[t].children[a].children[c].checked=!0:h[t].children[a].children[c].checked=!1,!0))),!0))),!0)))},className:"bootstrap-demo w-100"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Allowed Users"}),Object(g.jsx)(Di.ReactTags,{selected:P,suggestions:G,onDelete:e=>{const t=P.slice(0);t.splice(e,1),D(t),z(t.map((e=>e.value))),m(!o)},onAdd:e=>{const t=[...P,e];D(t),z(t.map((e=>e.value))),T(),m(!o)},onInput:e=>{if(e.trim().length<3)return T();new Promise((t=>{const s={name:e,customergroup:""};a.postApi(c.GetCustomerList,s).then((e=>{let s=[];e.data.result.length>0?s=e.data.result.map((e=>({value:e.id,label:e.firstname+" "+e.lastname}))):(s=[],T()),T(s),m(!o),t(s)}))}))},placeholderText:"Type to search"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Limit Usages to X items"}),Object(g.jsx)("input",{type:"number",min:"0",step:"1",className:"form-control",name:"usage_limit_item",value:K.usage_limit_item,onChange:X,onWheel:e=>e.currentTarget.blur(),placeholder:"Unlimited Usages"})]})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Usage Limit per Coupon"}),Object(g.jsx)("input",{type:"number",min:"0",step:"1",className:"form-control",name:"usage_coupon",value:K.usage_coupon,onWheel:e=>e.currentTarget.blur(),onChange:X,placeholder:"Unlimited Usages"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Usage Limit per User"}),Object(g.jsx)("input",{type:"number",min:"0",step:"1",className:"form-control",name:"usage_limit_user",value:K.usage_limit_user,onChange:X,onWheel:e=>e.currentTarget.blur(),placeholder:"Unlimited Usages"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:r=>{if("fixed_cart_discount"!==K.discount_type&&(s.current.errorMessages.maximum_spend=null,s.current.errorMessages.minimum_spend=null,s.current.fields.maximum_spend=!0,s.current.fields.minimum_spend=!0),"percentage"!==K.amount_type&&(s.current.errorMessages.coupon_percentage=null,s.current.fields.coupon_percentage=!0),"amount"!==K.amount_type&&(s.current.errorMessages.coupon_amount=null,s.current.fields.coupon_amount=!0),!s.current.allValid())return s.current.showMessages(),void m(!o);const i={id:K.id,coupon_code:K.coupon_code.trim(),description:K.description,discount_type:K.discount_type,coupon_amount:"amount"!==K.amount_type||""===K.coupon_amount?0:parseInt(K.coupon_amount),coupon_percentage:"percentage"!==K.amount_type||""===K.coupon_percentage?0:parseInt(K.coupon_percentage),coupon_expiry:K.coupon_expiry,minimum_spend:""===K.minimum_spend?0:parseInt(K.minimum_spend),maximum_spend:""===K.maximum_spend?0:parseInt(K.maximum_spend),usage_coupon:""!==K.usage_coupon?parseInt(K.usage_coupon):0,usage_limit_item:""!==K.usage_limit_item?parseInt(K.usage_limit_item):0,usage_limit_user:""!==K.usage_limit_user?parseInt(K.usage_limit_user):0,category_ids:null!==F&&F.length>0||null!==E&&E.length>0?"[]":JSON.stringify(O),exclude_category_ids:null!==F&&F.length>0||null!==E&&E.length>0?"[]":JSON.stringify(f),product_ids:null!==O&&O.length>0||null!==f&&f.length>0?"[]":JSON.stringify(F),exclude_product_ids:null!==O&&O.length>0||null!==f&&f.length>0?"[]":JSON.stringify(E),customer_ids:JSON.stringify(B),status:K.status?1:0,Userid:n.id};void 0!==e.id&&null!==e.id?(V(!0),a.postApi(c.UpdateCoupon,i).then((e=>{if(V(!1),e.data.message)return gl.b.warning(e.data.message),void m(!o);gl.b.success(l.RecordUpdated),m(!o),t.push("/coupons")}))):(V(!0),a.postApi(c.AddCoupon,i).then((e=>{if(V(!1),e.data.message)return gl.b.warning(e.data.message),void m(!o);gl.b.success(l.RecordAdded),m(!o),t.push("/coupons")})))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/coupons",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var ud=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),[p,h]=Object(d.useState)(1),[x,O]=Object(d.useState)(""),N=[{name:"Template",sortable:!0,sortField:"template_id",selector:e=>e.template_id},{name:"Scheduled On",sortable:!0,sortField:"schedule_on",selector:e=>Object(g.jsx)(Zn,{value:e.schedule_on})},{name:"Status",selector:e=>1===e.is_send?"Sent":1===e.is_cancelled?"Cancelled":"Pending"},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:1===e.is_send||1===e.is_cancelled?"":Object(g.jsxs)(b.b,{onClick:t=>C(t,e.batchId),to:"#",className:"text-dark",title:"Cancel Newsletter",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})})}],[f,_]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[y,w]=Object(d.useState)(),k=()=>{const e={page:f.page,search:x,page_size:f.page_size,sort_column:f.sort_column,sort_direction:f.sort_direction};j(!0),a.postApi(c.GetNewsletterList,e).then((e=>{if(j(!1),!0===e.data.status){const a=e.data.result[1];t(a),n(!s),w(e.data.result[0][0].total_newsletters)}}))};Object(d.useEffect)((()=>{o(!0),document.title=r.Newsletter,k()}),[f,x]);const S=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Template.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{O(e.target.value)}),1e3)}))),C=(e,t)=>{const r={batchId:t};sc()(l.Swalcancelnewsletter).then((function(e){e&&(j(!0),a.postApi(c.CancelNewsletter,r).then((e=>{j(!1),e.message?gl.b.warning(e.message):(gl.b.success(l.NewsletterCancelled),k(),n(!s))})))}))};return i?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Newsletter," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/newsletter/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Newsletter"]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.getApi(c.GetNewsletterExcel).then((e=>{e.data.result&&co(e.data.result[0],"Newsletter")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:N,data:e,paginationDefaultPage:p,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:y,onChangeRowsPerPage:e=>{h(1),_({...f,page:1,page_size:e})},onChangePage:e=>{h(e),_({...f,page:e})},subHeader:!0,progressPending:u,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:S,onSort:(e,t)=>{_({...f,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})]})})})})]}):Object(g.jsx)(v,{})};var jd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)([]),[u,j]=Object(d.useState)([]),[h,x]=Object(d.useState)([]),[O,v]=Object(d.useState)([]),[N,f]=Object(d.useState)({template_id:"",send_all:0,send_emails:[],exclude_emails:[],schedule_on:""});Object(d.useEffect)((()=>{document.title=r.AddNewsletter,_()}),[]);const _=()=>{a.postApi(c.GetSubscribersList,{page:1,search:"",page_size:5e3,sort_column:"",sort_direction:""}).then((e=>{if(e.data.result[0]){const t=[],s=[],a=e.data.result[1].filter((e=>1===e.status)),c=e.data.result[1].filter((e=>1===e.status));a.map((e=>(t.push({label:e.email,value:e.email,children:null,checked:!1}),!0))),c.map((e=>(s.push({label:e.email,value:e.email,children:null,checked:!1}),!0))),m(t),j(s)}}))},y=e=>{const t=e.target.name,s=e.target.value;N[t]="send_all"===t?e.target.checked:s,i(!n)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.AddNewsletter," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Template Id"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"template_id",onChange:y,defaultValue:N.template_id,placeholder:"Template Id"}),s.current.message("Template Id",N.template_id,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Send to All"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"send_all",onChange:y,id:"EnableProduct",checked:N.send_all}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),0===N.send_all&&Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Select Emails"}),o.length>0&&Object(g.jsx)(ei.a,{data:o,id:"userSelect",mode:"hierarchical",onChange:(e,t)=>{const s=[];if(t.length>0)for(let a=0;a(s.indexOf(e.value)>=0?o[t].checked=!0:o[t].checked=!1,!0)))},className:"bootstrap-demo w-100"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Exclude Emails"}),u.length>0&&Object(g.jsx)(ei.a,{data:u,id:"userSelect",mode:"hierarchical",onChange:(e,t)=>{const s=[];if(t.length>0)for(let a=0;a(s.indexOf(e.value)>=0?u[t].checked=!0:u[t].checked=!1,!0)))},className:"bootstrap-demo w-100"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Scheduled On"}),Object(g.jsx)(wi.a,{id:"datetimepicker",placeholder:"Select a date and time",style:{pointerEvents:"none"},step:1,min:new Date,onChange:e=>{f({...N,schedule_on:e.value}),i(!n)}}),s.current.message("Scheduled On",N.schedule_on,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:r=>{if(!s.current.allValid())return s.current.showMessages(),void i(!n);const o={template_id:N.template_id,send_all:!0===N.send_all?1:0,send_emails:JSON.stringify(h),exclude_emails:JSON.stringify(O),schedule_on:new Date(N.schedule_on.toLocaleDateString()+" "+N.schedule_on.toLocaleTimeString()+" GMT").toISOString().slice(0,19).replace("T"," ")};a.postApi(c.PostNewsletter,o).then((s=>{if(void 0!==s){if(s.data.result.message)return gl.b.warning(s.data.result.message),void i(!n);void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),i(!n)}t.push("/newsletter/list")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/newsletter/list",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var bd=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),[p,h]=Object(d.useState)(1),[x,O]=Object(d.useState)(""),N=[{name:"Email",sortable:!0,sortField:"email",selector:e=>e.email},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:1===e.status?Object(g.jsxs)(b.b,{onClick:t=>C(t,e.id),to:"#",className:"text-dark",title:"Inactive",children:[Object(g.jsx)("i",{className:"fa fa-ban","aria-hidden":"true"})," "]}):""})}],[f,_]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[y,w]=Object(d.useState)();Object(d.useEffect)((()=>{o(!0),document.title=r.Subscriber,S()}),[f,x]);const k=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Email.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{O(e.target.value)}),1e3)}))),S=()=>{const e={page:f.page,search:x,page_size:f.page_size,sort_column:f.sort_column,sort_direction:f.sort_direction};j(!0),a.postApi(c.GetSubscribersList,e).then((e=>{if(j(!1),!0===e.data.status){const a=e.data.result[1];t(a),n(!s),w(e.data.result[0][0].total_newsletter_email)}}))},C=(e,t)=>{sc()(l.SwalDeactivateProp).then((function(e){if(e){const e={id:t};j(!0),a.postApi(c.DeleteSubscriber,e).then((e=>{j(!1),e.data.result&&gl.b.success(l.SubscriberDeactivated),S(),n(!s)}))}}))};return i?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Subscriber," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.getApi(c.GetSubscribersExcel).then((e=>{e.data.result&&co(e.data.result[0],"Subscribers")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:N,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:y,onChangeRowsPerPage:e=>{h(1),_({...f,page:1,page_size:e})},onChangePage:e=>{h(e),_({...f,page:e})},subHeader:!0,paginationDefaultPage:p,progressPending:u,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:k,onSort:(e,t)=>{_({...f,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})]})})})})]}):Object(g.jsx)(v,{})};var pd=e=>{const t=()=>{e.onCloseModal(!0)};return Object(g.jsxs)(li.a,{show:e.props.IsShowModal,onHide:t,keyboard:!0,children:[Object(g.jsxs)(li.a.Header,{children:[Object(g.jsx)("div",{children:Object(g.jsx)("h6",{children:"Contact Detail"})}),Object(g.jsx)("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:t,children:Object(g.jsx)("i",{className:"fa fa-times","aria-hidden":"true"})})]}),Object(g.jsx)(li.a.Body,{children:Object(g.jsx)("div",{className:"container",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 mb-3"})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsx)("table",{className:"table table-striped table-borderless table-diamond-detail",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-black ",children:"Name"}),Object(g.jsx)("td",{children:e.props.data.name})]},Math.random()),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-black",children:"Email"}),Object(g.jsx)("td",{children:e.props.data.email})]},Math.random()),""!==e.props.data.phone&&null!==e.props.data.phone&&Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-black",children:"Phone"}),Object(g.jsx)("td",{children:e.props.data.phone})]},Math.random()),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-black",children:"Message"}),Object(g.jsx)("td",{children:e.props.data.message})]},Math.random())]})})})})]})})})})})})})]})};var hd=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)(!1),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(!0),[j,b]=Object(d.useState)(),[p,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)(1),[N,f]=Object(d.useState)(""),_=[{name:"Name",sortable:!0,sortField:"name",wrap:!0,selector:e=>e.name},{name:"Email",sortable:!0,sortField:"email",wrap:!0,selector:e=>e.email},{name:"Contact Number",sortable:!0,sortField:"phone",wrap:!0,selector:e=>e.phone},{name:"Message",selector:e=>e.message},{name:"Created Date",sortable:!0,wrap:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"cursor action-btn",children:Object(g.jsxs)("span",{onClick:t=>C(t,e.id),className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"mdi mdi-eye","aria-hidden":"true"})," "]})})}],[y,w]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[k,S]=Object(d.useState)();Object(d.useEffect)((()=>{i(!0),document.title=r.ContactForm,(()=>{const e={page:y.page,search:N,page_size:y.page_size,sort_column:y.sort_column,sort_direction:y.sort_direction};u(!0),a.postApi(c.GetContactFormAdminList,e).then((e=>{if(u(!1),!0===e.data.status){const a=e.data.result[1];t(a),S(e.data.result[0][0].total_form),l(!s)}}))})()}),[y,N]);const C=(t,a)=>{t.preventDefault();const c=e.filter((e=>e.id===a))[0];b(c),h(!0),l(!s)},A=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name, Email, Contact Number, Message.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{f(e.target.value)}),1e3)})));return n?Object(g.jsxs)(g.Fragment,{children:[!0===p&&Object(g.jsx)(pd,{props:{IsShowModal:p,data:j},onCloseModal:()=>{h(!1),l(!s)}}),Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.ContactForm," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.getApi(c.GetContactFormListExcel).then((e=>{e.data.result&&co(e.data.result[0],"Contact Us")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:_,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:k,paginationDefaultPage:x,onChangeRowsPerPage:e=>{O(1),w({...y,page:1,page_size:e})},onChangePage:e=>{O(e),w({...y,page:e})},subHeader:!0,subHeaderComponent:A,onSort:(e,t)=>{w({...y,sort_column:e.sortField,sort_direction:t})},progressPending:o,progressComponent:Object(g.jsx)(v,{}),sortServer:!0})})]})})})})]})]}):Object(g.jsx)(v,{})};var xd=function(){const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)(!1),[n,i]=Object(d.useState)(),[o,u]=Object(d.useState)(1),[j,p]=Object(d.useState)(""),[h,x]=Object(d.useState)({page:1,search:"",page_size:10}),O=[{name:"Name",selector:e=>e.name},{name:"Type",selector:e=>e.type},{name:"Product",selector:e=>e.product_name},{name:"SKU",selector:e=>e.sku},{name:"Status",selector:e=>""!==e.status?e.status.charAt(0).toUpperCase()+e.status.slice(1):"Pending"},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:Object(g.jsxs)(b.b,{to:"/marketing/reviews/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]})})}];Object(d.useEffect)((()=>{document.title=r.Reviews,v()}),[h,j]);const v=()=>{const e={page:h.page,search:j,page_size:h.page_size};a.postApi(c.GetReviewsList,e).then((e=>{e.data.status&&(t(e.data.result[1]),l(!s),i(e.data.result[0][0].total))}))},N=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Title, Name, Product, SKU, Status.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{p(e.target.value)}),1e3)})));return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Reviews," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:O,data:e,persistTableHead:!0,pagination:!0,paginationServer:!0,paginationTotalRows:n,onChangeRowsPerPage:e=>{u(1),x({...h,page:1,page_size:e})},onChangePage:e=>{u(e),x({...h,page:e})},paginationDefaultPage:o,subHeader:!0,subHeaderComponent:N})})})})})})]})};var Od=function(){const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),[n,i]=Object(d.useState)([]),[o,m]=Object(d.useState)(!1),u=Object(d.useRef)(),[j,h]=Object(d.useState)({id:0,product_id:0,sku:"",title:"",review:"",rating:0,name:"",status:""});Object(d.useEffect)((()=>{document.title=r.EditReview,x()}),[e.id]);const x=()=>{const t={id:e.id};a.postApi(c.GetReview,t).then((e=>{e.data.result&&(i(e.data.result[0]),h(e.data.result[0]),m(!o))}))},O=e=>t=>{h({...j,[e]:t.target.value}),m(!o)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.EditReview," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Product"}),Object(g.jsx)("div",{children:Object(g.jsx)("label",{children:n.product_name})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Author"}),Object(g.jsx)("div",{children:Object(g.jsx)("label",{children:n.name})})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Rating"}),Object(g.jsx)("div",{className:"form-group rating-label my-3",children:[...Array(11)].map(((e,t)=>0!==t&&Object(g.jsx)("label",{htmlFor:t,className:t===j.rating?"me-3 cursor active":"me-3 cursor",defaultValue:j.rating,children:t},t)))})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Status"}),Object(g.jsxs)("select",{className:"form-control",name:"status",onChange:O("status"),value:j.status,children:[Object(g.jsx)("option",{value:"pending",children:"Pending"}),Object(g.jsx)("option",{value:"approved",children:"Approved"}),Object(g.jsx)("option",{value:"rejected",children:"Rejected"})]}),s.current.message("Status",j.status,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",onChange:O("title"),value:j.title}),s.current.message("Title",j.title,"max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Review"}),Object(g.jsx)("textarea",{name:"review",className:"form-control",id:"txtReview",rows:3,onChange:O("review"),value:j.review}),s.current.message("Review",j.review,"max:1000",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",ref:u,onClick:e=>{if(!s.current.allValid())return s.current.showMessages(),void m(!o);u.current&&u.current.setAttribute("disabled","disabled");const r={id:j.id,title:j.title,review:j.review,rating:j.rating,status:j.status};a.postApi(c.UpdateReview,r).then((e=>{e.data.status?(gl.b.success(l.Reviewupdated),m(!o),t.push("/marketing/reviews")):(gl.b.warning(l.Error),u.current.removeAttribute("disabled"),m(!o))}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/marketing/reviews",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var gd=()=>{const e=Object(p.useLocation)(),t=Object(p.useHistory)(),[s,n]=Object(d.useState)(!1),[,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)(""),[u,j]=Object(d.useState)(""),[b,h]=Object(d.useState)(""),[x]=Object(d.useState)(window.location.origin+"/system/settings/instagram/auth/");Object(d.useEffect)((()=>{const t=new URLSearchParams(e.search).get("code");O(),null!==t&&""===b&&""!==o&&""!==u&&v(t)}),[]);const O=()=>{a.getApi(c.GetInstagramOptions).then((e=>{e.data.result&&e.data.result.map((e=>("instagram_client_id"===e.hj_key&&m(e.hj_value),"instagram_client_secret"===e.hj_key&&j(e.hj_value),"instagram_token"===e.hj_key&&h(e.hj_value),n(!s),!0)))}))},v=async t=>{const s=new FormData;s.append("client_id",o),s.append("client_secret",u),s.append("grant_type","authorization_code"),s.append("code",t),s.append("redirect_uri",x),await f.a.post(c.GetShortLivedToken,s).then((async t=>{if(200===t.status){N(t.data.access_token);const s=new URLSearchParams(e.search);s.has("code")&&s.delete("code")}}))},N=async e=>{await f.a.get(c.GetLongLivedToken+"?grant_type=ig_exchange_token&client_secret="+u+"&access_token="+e).then((async e=>{200===e.status&&_(e.data.access_token)}))},_=e=>{const s={token:e};a.postApi(c.UpdateInstagramToken,s).then((e=>{e.data.result&&(i(!1),gl.b.success(l.InstagramTokenGenerated),t.push("/system/settings/instagram"))}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.InstagramToken," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"row",children:""===b?Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("a",{href:c.InstagramAuth+"?client_id="+o+"&scope=user_profile,user_media&response_type=code&redirect_uri="+x,className:"btn btn-primary",children:"Login & Generate"})})}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{className:"col-md-12",children:[Object(g.jsx)("label",{children:"Token:"}),Object(g.jsx)("input",{type:"text",className:"form-control",value:b,readOnly:!0})]}),Object(g.jsx)("div",{className:"col-md-12 mt-2",children:Object(g.jsx)("button",{type:"button",className:"btn btn-danger",onClick:()=>{sc()(l.SwalDeleteProp).then((function(e){e&&(i(!0),_(""),h(""),t.push("/system/settings/instagram"))}))},children:"Remove"})})]})})})})})})]})};var vd=function(e){const[t,s]=Object(d.useState)(!1),[n,i]=Object(d.useState)([]),[o,u]=Object(d.useState)(!1),[j,p]=Object(d.useState)(!0),[h,x]=Object(d.useState)(""),[O,N]=Object(d.useState)(1),f=[{name:"Title",sortable:!0,sortField:"hj_title",selector:e=>e.hj_title},{name:"Key",sortable:!0,sortField:"hj_key",selector:e=>e.hj_key},{name:"Value",selector:e=>e.hj_value},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/system/settings/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[_,y]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[w,k]=Object(d.useState)();Object(d.useEffect)((()=>{u(!0),S(),document.title=r.Settings}),[_,h]);const S=()=>{const e={page:_.page,search:h,page_size:_.page_size,sort_column:_.sort_column,sort_direction:_.sort_direction};p(!0),a.postApi(c.GetSettingAdminOptions,e).then((e=>{if(p(!1),!0===e.data.status){const a=e.data.result[1];i(a),s(!t),k(e.data.result[0][0].total_row)}}))},C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Title, Key, Value.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{x(e.target.value)}),1e3)}))),A=async(e,r)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:r};p(!0),a.postApi(c.DeleteSettingOption,e).then((e=>{p(!1),gl.b.success(l.RecordDeleted),S(),s(!t)}))}}))};return o?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Settings," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/system/settings/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Option"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:f,data:n,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:w,onChangeRowsPerPage:e=>{N(1),y({..._,page:1,page_size:e})},onChangePage:e=>{N(e),y({..._,page:e})},subHeader:!0,subHeaderComponent:C,onSort:(e,t)=>{y({..._,sort_column:e.sortField,sort_direction:t})},progressPending:j,paginationDefaultPage:O,progressComponent:Object(g.jsx)(v,{})})})})})})})]}):Object(g.jsx)(v,{})};var Nd=function(e){const t=Object(d.useRef)(new ec.a),s=Object(p.useParams)(),n=Object(p.useHistory)(),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)(!0),x=Object(d.useRef)(),[O,N]=Object(d.useState)(!1),[f,_]=Object(d.useState)({id:0,hj_title:"",hj_key:"",hj_value:""});Object(d.useEffect)((()=>{u(!0),h(!1),i.validatePermission(o.System)||n.push("/"),u(!0),N(!O),document.title=r.AddSettingOption,void 0!==s.id&&(document.title=r.EditSettingOption,y())}),[s.id]);const y=()=>{const e={id:s.id};h(!0),a.postApi(c.GetSettingOptionDetail,e).then((e=>{h(!1),e.data.result&&(_(e.data.result[0]),N(!O))}))},w=e=>t=>{_("status"===e?{...f,[e]:t.target.checked}:{...f,[e]:t.target.value}),N(!O)};return!m||j?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==s.id?r.EditSettingOption:r.AddSettingOption," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:n.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"hj_title",onChange:w("hj_title"),onKeyUp:w("hj_title"),onBlur:()=>t.current.showMessageFor("hj_title"),value:f.hj_title,placeholder:"Title"}),t.current.message("Title",f.hj_title,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Key"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"hj_key",onChange:w("hj_key"),onKeyUp:w("hj_key"),onBlur:()=>t.current.showMessageFor("hj_key"),value:f.hj_key,placeholder:"Key"}),t.current.message("Key",f.hj_key,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Value"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"hj_value",onChange:w("hj_value"),onKeyUp:w("hj_value"),onBlur:()=>t.current.showMessageFor("hj_value"),value:f.hj_value,placeholder:"Value"}),t.current.message("Value",f.hj_value,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:x,type:"button",onClick:()=>{if(!t.current.allValid())return t.current.showMessages(),void N(!O);x.current&&x.current.setAttribute("disabled","disabled");const e={id:f.id,hj_title:f.hj_title,hj_key:f.hj_key,hj_value:f.hj_value};null==s.id?(h(!0),a.postApi(c.AddSettingOption,e).then((e=>{if(h(!1),e.data.message)return gl.b.warning(e.data.message),N(!O),void x.current.removeAttribute("disabled");gl.b.success(l.RecordAdded),N(!O),n.push("/system/settings")}))):(h(!0),a.postApi(c.UpdateSettingOption,e).then((e=>{if(h(!1),e.data.message)return gl.b.warning(e.data.message),N(!O),void x.current.removeAttribute("disabled");gl.b.success(l.RecordUpdated),N(!O),n.push("/system/settings")})))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/system/settings",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var fd=()=>{const[e,t]=Object(d.useState)(""),s=Object(p.useParams)(),[n,i]=Object(d.useState)(!1),o=Object(p.useHistory)(),m=Object(d.useRef)(new ec.a),[u,j]=Object(d.useState)(!1);Object(d.useEffect)((()=>{document.title=r.AddService,null!=s.id&&(document.title=r.EditService,N()),v()}),[s.id]);const[h,x]=Object(d.useState)({id:0,title:"",description:"",image:"",service_type:0,status:0}),O=e=>{const t=e.target.name,s=e.target.value;h[t]="status"===t?e.target.checked:s,i(!n)};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){ao(e.detail.cachedFileArray[0],(e=>{t(e),j(!0)}))}));const v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?new ti.a("_images",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}):new ti.a("_images",{text:{chooseFile:"Choose Image..."}})},N=()=>{const e={id:s.id};a.postApi(c.GetService,e).then((e=>{if(e.data.result){const t=e.data.result[0].filter((e=>e.id===Number(s.id)))[0];x(t),t.image.includes(".")&&v(t.image),i(!n)}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==s.id?r.EditService:r.AddService," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:o.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{className:"forms-sample",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",onChange:O,value:h.title,placeholder:"Title"}),m.current.message("title",h.title,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Service Type"}),Object(g.jsxs)("select",{className:"form-control",name:"service_type",onChange:O,value:h.service_type,children:[Object(g.jsx)("option",{value:"0",children:"Select"}),Object(g.jsx)("option",{value:"1",children:"In Store"}),Object(g.jsx)("option",{value:"2",children:"Virtual"})]}),m.current.message("Service Type",h.service_type,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("textarea",{className:"form-control",name:"description",onChange:O,value:h.description,placeholder:"Description",rows:"2"}),m.current.message("Description",h.description,"required",{className:"error"})]})}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsx)("div",{className:"form-group",children:Object(g.jsxs)("label",{children:["Image"," ",Object(g.jsx)("span",{className:"note",children:"(only .png, .jpg, .jpeg formats allowed) Size 1920 X 782"})]})}),Object(g.jsxs)("div",{className:"custom-file-container","data-upload-id":"_images",children:[Object(g.jsxs)("label",{className:"custom-file-container__custom-file w-50",children:[Object(g.jsx)("input",{type:"file",className:"custom-file-container__custom-file__custom-file-input",accept:".png,.jpg,.jpeg,.svg","aria-label":"Choose Image"}),Object(g.jsx)("input",{type:"hidden",name:"MAX_FILE_SIZE",value:"110485760"}),Object(g.jsx)("span",{className:"custom-file-container__custom-file__custom-file-control d-block w-50"})]}),Object(g.jsxs)("div",{className:"btn-remove-image",children:[Object(g.jsx)("a",{href:void 0,className:"custom-file-container__image-clear",title:"Remove Image",style:u?{}:{display:"none"},children:"\xd7"}),Object(g.jsx)("div",{className:"custom-file-container__image-preview"})]})]})]}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:O,id:"EnableProduct",checked:h.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsxs)("div",{className:"row mt-3 mx-0",children:[Object(g.jsx)("div",{className:"col-auto pr-0",children:Object(g.jsxs)("button",{type:"button",onClick:t=>{var r;if(!m.current.allValid())return m.current.showMessages(),void i(!n);const d={id:h.id,title:h.title,image:e,description:h.description,service_type:h.service_type,status:null!==(r=h.status)&&void 0!==r?r:0};a.postApi(c.AddService,d).then((e=>{if(e.data.message)return gl.b.warning(e.data.message),void i(!n);null==s.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),i(!n),o.push("/services")}))},className:"btn btn-primary",children:[" ","Submit"," "]})}),Object(g.jsx)("div",{className:"col-auto",children:Object(g.jsx)(b.b,{to:"/services",className:"btn btn-light",children:"Cancel"})})]})]})})})})})})]})};var _d=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),i=[{name:"Image",selector:e=>Object(g.jsx)("img",{src:e.image,width:"100",onError:t=>{t.target.onerror=null,t.target.src=e.altimage}})},{name:"Title",selector:e=>Object(g.jsxs)("label",{children:[" ",e.title," "]})},{name:"Service Type",selector:e=>1===e.service_type?Object(g.jsx)("label",{children:"In Store"}):Object(g.jsx)("label",{children:"Virtual"})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/services/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>h(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[o,u]=Object(d.useState)({page:1,search:"",page_size:10}),[j,p]=Object(d.useState)();Object(d.useEffect)((()=>{document.title=r.Service,x()}),[o]);const h=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t};a.postApi(c.DeleteService,e).then((e=>{gl.b.success(l.RecordDeleted),x(),n(!s)}))}}))},x=()=>{const e={page:o.page,search:o.search,page_size:o.page_size};a.postApi(c.GetServiceAdminList,e).then((e=>{if(!0===e.data.status){const a=e.data.result[1];t(a),n(!s),p(e.data.result[0][0].total_row)}}))},O=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search",className:"form-control col-md-3",placeholder:"Search",onChange:e=>u({...o,search:e.target.value})})));return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Service," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/services/addservice",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Service"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:i,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:j,onChangeRowsPerPage:e=>{u({...o,page_size:e})},onChangePage:e=>{u({...o,page:e})},subHeader:!0,subHeaderComponent:O})})})})})})]})};var yd=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)([]),[u,j]=Object(d.useState)(),[p,h]=Object(d.useState)(!1),[x]=Object(d.useState)(["In-Store Appointment","Virtual Appointment"]),O={page:1,search:"",page_size:10,assignee:0,status:"",service_type:"",booking_from:"",booking_to:"",assignee_name:"",sort_column:"",sort_direction:""},[v,N]=Object(d.useState)(O),f=[{name:"Booking Date",sortable:!0,wrap:!0,sortField:"booking_date",selector:e=>Object(g.jsx)(Zn,{value:e.booking_date})},{name:"Service",wrap:!0,selector:e=>Object(g.jsx)("div",{children:Object(g.jsx)("label",{children:e.service_type})})},{name:"Name",selector:e=>Object(g.jsx)("label",{children:e.name}),wrap:!0},{name:"E-Mail",wrap:!0,selector:e=>Object(g.jsxs)("label",{children:[" ",e.email," "]})},{name:"Contact No",wrap:!0,selector:e=>e.contact_number},{name:"Status",selector:e=>e.status},{name:"Created Date",sortable:!0,wrap:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>{let t=!1;if(e.booking_date){const s=new Date(String(e.booking_date).replace(" ","T")+(String(e.booking_date).endsWith("Z")?"":"Z")),a=s17||17===c&&r>30)&&!e.is_confirmed}return Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/Appointments/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),t&&Object(g.jsx)("span",{className:"text-dark",title:"Review Appointment",onClick:()=>{return t=e.id,void sc()({title:"Review Appointment",text:"Do you want to Confirm or Reject this appointment?",buttons:{confirm:{text:"Confirm",value:"confirm",className:"btn btn-primary"},reschedule:{text:"Reject",value:"reschedule",className:"btn btn-primary"}}}).then((e=>{if("reschedule"===e){const e={id:t,base_url:"https://staging.harmonyjewels.co.uk/",is_reschedule:!0};a.postApi(c.ReviewAppointment,e).then((e=>{console.log(e),w()})),console.log(t),gl.b.success(l.AppointmentRejected)}if("confirm"===e){const e={id:t};a.postApi(c.ReviewAppointment,e).then((e=>{console.log(e),w(),gl.b.success(l.AppointmentConfirmed)}))}}));var t},children:Object(g.jsx)("i",{className:"fa fa-hourglass-half","aria-hidden":"true"})})]})}}];Object(d.useEffect)((()=>{document.title=r.AppointmentTitle,w(),y()}),[v]);const _=(e,t)=>{if(e.preventDefault(),"booking_date"===t)null!==e.value?(v.booking_from=e.value[0],v.booking_to=e.value[1]):(v.booking_from="",v.booking_to="");else if("assignee"===t){let s=i.filter((t=>t.id===e.target.value));s=s.length>0?s[0].name:"",v[t]=e.target.value,v.assignee_name=s}else v[t]=e.target.value;n(!s)},y=()=>{a.getApi(c.GetAppointmentUsers).then((e=>{if(e.data.result){const t=e.data.result[0];o(t)}}))},w=()=>{const e={page:v.page,search:v.search,page_size:v.page_size,assignee:v.assignee,status:v.status,sort_column:v.sort_column,sort_direction:v.sort_direction,service_type:v.service_type,booking_from:""!==v.booking_from?new Date(v.booking_from).toISOString().slice(0,19).replace("T"," "):"",booking_to:""!==v.booking_to?new Date(v.booking_to).toISOString().slice(0,19).replace("T"," "):""};a.postApi(c.GetAppointment,e).then((e=>{t(e.data.result[0]),e.data.result[0].length>0&&j(e.data.result[0][0].total_count)}))},k=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Service, Name, E-mail, Contact No.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>N({...v,page:1,search:e.target.value})})));return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.AppointmentTitle," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(b.b,{to:"#",onClick:()=>{h(!p)},className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})})]}),Object(g.jsx)("div",{className:p?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Assignee"}),Object(g.jsxs)("select",{className:"form-control",name:"assignee",onChange:e=>_(e,"assignee"),value:v.assignee,children:[Object(g.jsx)("option",{value:"",children:"Select"}),i.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Status"}),Object(g.jsxs)("select",{className:"form-control",name:"status",onChange:e=>_(e,"status"),value:v.status,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"Pending",children:"Pending"}),Object(g.jsx)("option",{value:"In progress",children:"In progress"}),Object(g.jsx)("option",{value:"Successful",children:"Successful"}),Object(g.jsx)("option",{value:"Unsuccessful",children:"Unsuccessful"})]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Service Type"}),Object(g.jsxs)("select",{className:"form-control",name:"service_type",onChange:e=>_(e,"service_type"),value:v.service_type,children:[Object(g.jsx)("option",{value:"",children:"Select"}),x.map(((e,t)=>Object(g.jsx)("option",{value:e,children:e},t)))]})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:"Booking Date"}),Object(g.jsx)(nd.a,{onChange:e=>_(e,"booking_date")})]})})]}),Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsxs)("div",{className:"col-md-12 pr-2 text-right",children:[Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsx)("span",{className:"filter-result-repeat",children:Object(g.jsx)("a",{children:Object(g.jsx)("button",{type:"button",onClick:e=>(N(O),n(!s),void w()),className:"btn btn-primary btn-fw rounded mr-2",children:"Clear All"})})})}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"#",className:"btn btn-dark btn-fw rounded mr-2",onClick:e=>w(e),children:[" ","Apply Filter"," "]})})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:f,data:e,persistTableHead:!0,pagination:!0,paginationServer:!0,paginationTotalRows:u,onChangeRowsPerPage:e=>{N({...v,page_size:e})},onChangePage:e=>{N({...v,page:e})},subHeader:!0,subHeaderComponent:k,onSort:(e,t)=>{N({...v,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})})})})})]})};var wd=()=>{const e=Object(p.useParams)(),[t,s]=Object(d.useState)(!1),[i,o]=Object(d.useState)([]),m=Object(p.useHistory)(),u=Object(d.useRef)(new ec.a);Object(d.useEffect)((()=>{document.title=r.AddService,void 0!==e.id&&(document.title=r.EditService,v(),O())}),[e.id]);const[j,h]=Object(d.useState)({id:0,remarks:"",status:"",user_id:""}),x=e=>{const a=e.target.name,c=e.target.value;j[a]=c,s(!t)},O=()=>{const r={page:1,search:"",page_size:10,id:e.id};a.postApi(c.GetAppointment,r,!1).then((a=>{if(a.data.result){const c=a.data.result[0].filter((t=>t.id===Number(e.id)))[0];h(c),s(!t)}}))},v=()=>{a.getApi(c.GetAppointmentUsers).then((e=>{if(e.data.result){const t=e.data.result[0];o(t)}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",r.EditAppointment," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{m.length>2?m.goBack():m.push(n.Appointment)},children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Name"})}),Object(g.jsx)("label",{className:"col-8",children:j.name})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Email"})}),Object(g.jsx)("label",{className:"col-8",children:j.email})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Phone"})}),Object(g.jsx)("label",{className:"col-8",children:j.contact_number})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Booking Date"})}),Object(g.jsx)("label",{className:"col-8",children:Object(g.jsx)(Zn,{value:j.booking_date})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Service Type"})}),Object(g.jsx)("label",{className:"col-8",children:j.service_type})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Place Date"})}),Object(g.jsx)("label",{className:"col-8",children:Object(g.jsx)(Zn,{value:j.created_at})})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Visit Purpose "})}),Object(g.jsx)("label",{className:"col-8",children:j.purpose})]})}),j.order_no&&Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"order_no"})}),Object(g.jsx)("label",{className:"col-8",children:j.order_no})]})}),j.stone_preferences&&Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Stone Preferences"})}),Object(g.jsx)("label",{className:"col-8",children:j.stone_preferences})]})}),j.attendees&&Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"attendees "})}),Object(g.jsx)("label",{className:"col-8",children:j.attendees})]})}),Object(g.jsx)("div",{className:"col-md-4",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{className:"col-4",children:Object(g.jsx)("b",{children:"Budget "})}),Object(g.jsxs)("label",{className:"col-8",children:[j.budget," ",j.currency]})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{className:"fw-bold mb-2",children:"Description"}),Object(g.jsx)("div",{style:{background:"#f8f9fa",padding:"12px 15px",borderRadius:"8px",border:"1px solid #e0e0e0",fontSize:"14px",lineHeight:"1.6",whiteSpace:"pre-line"},children:j.item_description||"No description provided"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Remarks"}),Object(g.jsx)("textarea",{rows:5,type:"textarea",className:"form-control",name:"remarks",onChange:x,value:j.remarks,placeholder:"Remarks"}),u.current.message("remarks",j.remarks,"required|max:255",{className:"error"})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Status"}),Object(g.jsxs)("select",{className:"form-control",name:"status",onChange:x,value:j.status,children:[Object(g.jsx)("option",{value:"Select",children:"Select"}),Object(g.jsx)("option",{value:"In progress",children:"In progress"}),Object(g.jsx)("option",{value:"Successful",children:"Successful"}),Object(g.jsx)("option",{value:"Unsuccessful",children:"Unsuccessful"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Assign To"}),Object(g.jsx)("select",{className:"form-control",name:"user_id",onChange:x,value:j.user_id,children:i.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:r=>{var n;if(!u.current.allValid())return u.current.showMessages(),void s(!t);const i={id:j.id,remarks:j.remarks,status:null!==(n=j.status)&&void 0!==n?n:"Pending",user_id:j.user_id};a.postApi(c.setAppointment,i).then((a=>{if(a.data.message)return gl.b.warning(a.data.message),void s(!t);void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),s(!t),m.push("/Appointments")}))},className:"btn btn-primary mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/Appointments",className:"btn btn-light",children:"Cancel"})]})})]})})})})})]})};var kd=function(e){return Object(g.jsx)("div",{className:"text-center",children:Object(g.jsx)("h1",{children:"Something went wrong!"})})};var Sd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(new ec.a),n=Object(d.useRef)(),o=Object(d.useContext)(mo),[m,u]=Object(d.useState)(!1),[j,h]=Object(d.useState)([]),[x,O]=Object(d.useState)([]),[N,f]=Object(d.useState)([]),[_,y]=Object(d.useState)([]),[w,k]=Object(d.useState)([]),[S,C]=Object(d.useState)([]),[A,P]=Object(d.useState)([]),[D,M]=Object(d.useState)([]),[R,F]=Object(d.useState)([]),[I,E]=Object(d.useState)([]),[L,G]=Object(d.useState)(!1),[T,B]=Object(d.useState)(!0),[z,U]=Object(d.useState)({id:0,rule_name:"",description:"",discount_type:"percentage",discount_percentage:0,discount_amount:0,start_date:"",end_date:"",status:0}),[q,H]=Object(d.useState)(""),[V,K]=Object(d.useState)(""),[W,Y]=Object(d.useState)([]),[Q,X]=Object(d.useState)([]),[J,Z]=Object(d.useState)(!1),[$,ee]=Object(d.useState)(!1);Object(d.useEffect)((()=>{G(!0),document.title=r.AddCatalogPriceRule,void 0!==e.id?(document.title=r.EditCatalogPriceRule,ne()):re()}),[e.id]);const te=(e,t)=>{const s=t.toLowerCase();return e.map((e=>{const t=e.label.toLowerCase().includes(s);let a=null;return e.children&&(a=te(e.children,s)),t||null!==a&&a.length>0?{...e,children:a}:null})).filter((e=>null!==e))},se=te(x,V),ae=(e,t)=>{const s=t.toLowerCase();return e.map((e=>{const t=e.label.toLowerCase().includes(s);let a=null;return e.children&&(a=ae(e.children,s)),t||null!==a&&a.length>0?{...e,children:a}:null})).filter((e=>null!==e))},ce=ae(j,q),re=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;B(!0),a.postApi(c.GetCategory,null).then((s=>{if(B(!1),s.data.result){s.data.result[0]=s.data.result[0].filter((e=>1===e.status));const i=s.data.result[0].filter((e=>1===e.parent_id)),o=[],d=[];if(i.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id)),a=[];t.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id)),c=[];return t.map((e=>(c.push({label:e.name,value:e.id,checked:!1,children:[]}),!0))),a.push({label:e.name,value:e.id,checked:!1,children:c}),!0}));const c=[];return t.map((e=>{const t=s.data.result[0].filter((t=>t.parent_id===e.id)),a=[];return t.map((e=>(a.push({label:e.name,value:e.id,checked:!1,children:[]}),!0))),c.push({label:e.name,value:e.id,checked:!1,children:a}),!0})),o.push({label:e.name,value:e.id,children:a,checked:!1}),d.push({label:e.name,value:e.id,children:c,checked:!1}),!0})),null!==e)for(var a=0;a(e===o[a].value&&(o[a].checked=!0),!0)));var c=o[a].children;if(c.length>0)for(var r=0;r(e===c[r].value&&(c[r].checked=!0),!0)));var l=c[r].children;if(l.length>0)for(var n=0;n(e===l[n].value&&(l[n].checked=!0),!0)))}}if(h(o),null!==t)for(a=0;a(e===d[a].value&&(d[a].checked=!0),!0))),(c=d[a].children).length>0)for(r=0;r(e===c[r].value&&(c[r].checked=!0),!0))),(l=c[r].children).length>0)for(n=0;n(e===l[n].value&&(l[n].checked=!0),!0)));O(d)}}))},le=e=>{const t=e.target.name,a=e.target.value;z[t]="status"===t?e.target.checked:a,u(!m),"percentage"===t?s.current.hideMessageFor("discount_amount"):"fixed_amount"===t&&s.current.hideMessageFor("discount_percentage")},ne=()=>{const t={id:e.id};B(!0),a.postApi(c.GetCatalogPriceRuleDetail,t).then((e=>{if(B(!1),e.data.result){const a=e.data.result[0][0],c={id:a.id,rule_name:a.rule_name,description:a.description,start_date:a.start_date,end_date:a.end_date,discount_type:a.discount_type,discount_amount:a.discount_amount,discount_percentage:a.discount_percentage,status:a.status};if(""!==c.start_date){var t=c.start_date.slice(0,16);c.start_date=t}if(""!==c.end_date){var s=c.end_date.slice(0,16);c.end_date=s}U(c),u(!m),f(a.category_ids.length>0?a.category_ids:[]),y(null!==a.exclude_categories&&a.exclude_categories.length>0?a.exclude_categories:[]),P(null!==a.product_ids&&a.product_ids.length>0?i.GetJSON(a.product_ids):[]),M(null!==a.product_ids&&a.product_ids.length>0?a.products:[]),E(null!==a.exclude_product_ids&&a.exclude_product_ids.length>0?i.GetJSON(a.exclude_product_ids):[]),F(null!==a.exclude_product_ids&&a.exclude_product_ids.length>0?a.exclude_products:[]),re(i.GetJSON(a.category_ids),i.GetJSON(a.exclude_categories)),u(!m)}}))},ie=e=>{"Minus"!==e.code&&"NumpadSubtract"!==e.code||e.preventDefault()};return!L||T?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditCatalogPriceRule:r.AddCatalogPriceRule," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Rule Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"rule_name",onChange:le,value:z.rule_name,placeholder:"Rule Name"}),s.current.message("Rule Name",z.rule_name,"required|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:le,id:"EnableProduct",checked:z.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("textarea",{className:"form-control",name:"description",onChange:le,value:z.description,placeholder:"Description",rows:"2"}),s.current.message("Description",z.description,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Discount Type"}),Object(g.jsxs)("select",{className:"form-control",name:"discount_type",onChange:le,value:z.discount_type,children:[Object(g.jsx)("option",{value:"percentage",children:"Percentage"}),Object(g.jsx)("option",{value:"fixed_amount",children:"Fixed Amount"})]}),s.current.message("Discount Type",z.discount_type,"required",{className:"error"})]})}),"percentage"===z.discount_type?Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Percentage"}),Object(g.jsx)("input",{type:"number",min:"0",className:"form-control",name:"discount_percentage",onChange:le,value:z.discount_percentage,placeholder:"Discount Percentage",onKeyPress:ie}),s.current.message("Discount Percentage",z.discount_percentage,"required|numeric|max:99,num|min:0,num",{className:"error"})]})}):"","fixed_amount"===z.discount_type?Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Amount"}),Object(g.jsx)("input",{onKeyPress:ie,type:"number",className:"form-control",name:"discount_amount",onChange:le,value:z.discount_amount,placeholder:"Discount Amount",min:"0"}),s.current.message("Discount Amount",z.discount_amount,"required|numeric|min:0,num",{className:"error"})]})}):"",Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Start Date "}),Object(g.jsx)(wi.a,{name:"start_date",value:z.start_date?new Date(z.start_date):null,format:"dd/MM/yyyy hh:mm a",change:e=>{U({...z,start_date:e.value?e.value.toISOString():""})},min:new Date}),s.current.message("Start Date",z.start_date,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"End Date"}),Object(g.jsx)(wi.a,{name:"end_date",value:z.end_date?new Date(z.end_date):null,format:"dd/MM/yyyy hh:mm a",change:e=>{U({...z,end_date:e.value?e.value.toISOString():""})},min:new Date}),s.current.message("End Date",z.end_date,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:(null===N||void 0===N?void 0:N.length)>0||(null===_||void 0===_?void 0:_.length)>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Products"}),Object(g.jsx)(Di.ReactTags,{selected:D,suggestions:w,onDelete:e=>{const t=D.slice(0);t.splice(e,1),M(t),P(t.map((e=>e.value))),u(!m)},onAdd:e=>{const t=[...D,e];M(t),P(t.map((e=>e.value))),u(!m)},onInput:e=>{if(e.trim().length<3)return k();new Promise((t=>{const s={term:e};a.postApi(c.SearchProducts,s).then((e=>{let s=[];s=e.data.result.length>0?e.data.result.map((e=>({value:e.id,label:e.name+" - "+e.sku}))):[],k(s),u(!m),t(s)}))}))},placeholderText:"Choose..."})]})}),Object(g.jsx)("div",{className:(null===N||void 0===N?void 0:N.length)>0||(null===_||void 0===_?void 0:_.length)>0?"col-md-6 d-none":"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Exclude Products"}),Object(g.jsx)(Di.ReactTags,{selected:R,suggestions:S,onDelete:e=>{const t=R.slice(0);t.splice(e,1),F(t),E(t.map((e=>e.value))),u(!m)},onAdd:e=>{const t=[...R,e];F(t),E(t.map((e=>e.value))),u(!m)},onInput:e=>{if(e.trim().length<3)return C();new Promise((t=>{const s={term:e};a.postApi(c.SearchProducts,s).then((e=>{let s=[];s=e.data.result.length>0?e.data.result.map((e=>({value:e.id,label:e.name+" - "+e.sku}))):[],C(s),u(!m),t(s)}))}))},placeholderText:"Choose..."})]})}),Object(g.jsxs)("div",{className:(null===A||void 0===A?void 0:A.length)>0||(null===I||void 0===I?void 0:I.length)>0?"col-md-6 d-none":"col-md-6",children:[Object(g.jsx)("label",{children:"Category"}),Object(g.jsxs)("div",{className:"custom-dropdown text-left",children:[Object(g.jsx)("button",{type:"button",className:J||"text-left form-control custom-select",onClick:()=>{Z(J?"":"text-left form-control custom-select show")},children:"Select Category"}),Object(g.jsxs)("div",{className:"dropdown-menu mt-4",children:[Object(g.jsx)("input",{className:"form-control m-1",placeholder:"Search...",type:"text",onChange:e=>{H(e.target.value.toLowerCase())}}),Object(g.jsx)(_o.a,{checked:N,expandOnClick:!0,expanded:W,nodes:ce,onCheck:e=>{N.length>0&&N.map((t=>e.push(t))),f((t=>{let s=[...t];return e.forEach((e=>{s.includes(e)?s=s.filter((t=>t!==e)):s.push(e)})),s}))},onExpand:e=>{Y(e)},icons:{parentClose:null,parentOpen:null,leaf:null}})]})]})]}),Object(g.jsxs)("div",{className:(null===A||void 0===A?void 0:A.length)>0||(null===I||void 0===I?void 0:I.length)>0?"col-md-6 d-none":"col-md-6",children:[Object(g.jsx)("label",{children:"Exclude Category"}),Object(g.jsxs)("div",{className:"custom-dropdown text-left",children:[Object(g.jsx)("button",{type:"button",className:$||"text-left form-control custom-select",onClick:()=>{ee($?"":"text-left form-control custom-select show")},children:"Select Category"}),Object(g.jsxs)("div",{className:"dropdown-menu mt-4",children:[Object(g.jsx)("input",{className:"form-control m-1",placeholder:"Search...",type:"text",onChange:e=>{K(e.target.value.toLowerCase())}}),Object(g.jsx)(_o.a,{checked:_,expandOnClick:!0,expanded:Q,nodes:se,onCheck:e=>{_.length>0&&_.map((t=>e.push(t))),y((t=>{let s=[...t];return e.forEach((e=>{s.includes(e)?s=s.filter((t=>t!==e)):s.push(e)})),s}))},onExpand:e=>{X(e)},icons:{parentClose:null,parentOpen:null,leaf:null}})]})]})]})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6 mt-4",children:[Object(g.jsxs)("button",{ref:n,type:"button",onClick:r=>{if("percentage"!==z.discount_type&&(s.current.errorMessages["Discount Percentage"]=null,s.current.fields["Discount Percentage"]=!0),"fixed_amount"!==z.discount_type&&(s.current.errorMessages["Discount Amount"]=null,s.current.fields["Discount Amount"]=!0),!s.current.allValid())return s.current.showMessages(),void u(!m);const i=new Date(z.start_date),d=new Date(z.end_date),j=(d.getTime()-i.getTime())/1e3;if(d0||I.length>0?[]:N,exclude_category_ids:A.length>0||I.length>0?[]:_,product_ids:N.length>0||_.length>0?[]:JSON.stringify(A),exclude_product_ids:N.length>0||_.length>0?[]:JSON.stringify(I),status:z.status?1:0,Userid:o.id};"percentage"===z.discount_type?b.discount_amount=0:b.discount_percentage=0,void 0===e.id?(B(!0),a.postApi(c.AddCatalogPriceRule,b).then((e=>{if(B(!1),e.data.message)return gl.b.warning(e.data.message),u(!m),void n.current.removeAttribute("disabled");gl.b.success(l.RecordAdded),u(!m),t.push("/marketing/catalog-price-rule")}))):(B(!0),a.postApi(c.UpdateCatalogPriceRule,b).then((e=>{if(B(!1),e.data.message)return gl.b.warning(e.data.message),u(!m),void n.current.removeAttribute("disabled");gl.b.success(l.RecordUpdated),u(!m),t.push("/marketing/catalog-price-rule")})))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/marketing/catalog-price-rule",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Cd=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(!1),[j,p]=Object(d.useState)(!0),[h,x]=Object(d.useState)(1),[O,N]=Object(d.useState)(""),f=[{name:"Rule Name",sortable:!0,sortField:"rule_name",selector:e=>e.rule_name,wrap:!0},{name:"Start Date",selector:e=>Object(g.jsx)(Zn,{value:e.start_date})},{name:"End Date",selector:e=>Object(g.jsx)(Zn,{value:e.end_date})},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/marketing/catalog-price-rule/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[_,y]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[w,k]=Object(d.useState)();Object(d.useEffect)((()=>{u(!0),document.title=r.CatalogPriceRule,S()}),[_,O]);const S=()=>{const e={page:_.page,search:O,page_size:_.page_size,sort_column:_.sort_column,sort_direction:_.sort_direction};p(!0),a.postApi(c.GetCatalogPriceRuleList,e).then((e=>{if(p(!1),!0===e.data.status){const s=e.data.result[1];t(s),i(!n),k(e.data.result[0][0].total_count)}}))},C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",className:"form-control col-md-3",placeholder:"Search",title:"Search For Rule Name.",onChange:e=>setTimeout((()=>{N(e.target.value)}),1e3)}))),A=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};p(!0),a.postApi(c.DeleteCatalogPriceRule,e).then((e=>{p(!1),gl.b.success(l.RecordDeleted),S(),i(!n)}))}}))};return o?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.CatalogPriceRule," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/marketing/catalog-price-rule/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Catalog Price Rule"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.postApi(c.GetCatalogPriceRuleExcel).then((e=>{e.data.result&&co(e.data.result[0],"Catalog-Price-Rule")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:f,data:e,progressPending:j,progressComponent:Object(g.jsx)(v,{}),persistTableHead:!0,pagination:!0,paginationServer:!0,paginationTotalRows:w,onChangeRowsPerPage:e=>{x(1),y({..._,page:1,page_size:e})},onChangePage:e=>{x(e),y({..._,page:e})},subHeader:!0,subHeaderComponent:C,paginationDefaultPage:h,onSort:(e,t)=>{y({..._,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})]})})})})]}):Object(g.jsx)(v,{})};var Ad=function(e){const[t,s]=Object(d.useState)(!1),[l,n]=Object(d.useState)([]),i=[{name:"Download CSV",selector:e=>e.download_csv?Object(g.jsx)("i",{className:"fa fa-check-circle"}):Object(g.jsx)("i",{className:"fa fa-times-circle"})},{name:"Import in MySQL",selector:e=>e.insert_in_database?Object(g.jsx)("i",{className:"fa fa-check-circle"}):Object(g.jsx)("i",{className:"fa fa-times-circle"})},{name:"Import in mongoDB",selector:e=>e.insert_in_mongodb?Object(g.jsx)("i",{className:"fa fa-check-circle"}):Object(g.jsx)("i",{className:"fa fa-times-circle"})},{name:"Start Time",selector:e=>Object(g.jsx)(Zn,{value:e.start_time})},{name:"End Time",selector:e=>Object(g.jsx)(Zn,{value:e.end_time})},{name:"",selector:e=>null!==e.error_message&&""!==e.error_message?Object(g.jsx)("span",{"data-toggle":"tooltip","data-html":"true",title:e.error_message,children:Object(g.jsx)("i",{className:"fa fa-exclamation-triangle"})}):""}],[o,m]=Object(d.useState)({page:1,search:"",page_size:10}),[u,j]=Object(d.useState)(),[b,p]=Object(d.useState)(!1),[h,x]=Object(d.useState)(!1);Object(d.useEffect)((()=>{O()}),[o]);const O=()=>{const e={page:o.page,search:o.search,page_size:o.page_size};a.postApi(c.GetServiceLogs,e).then((e=>{if(!0===e.data.status){const a=e.data.result[0];a.length>0&&(n(a),s(!t),j(a[0].total_count),b||a.forEach((e=>{"Nivoda Service"===e.service_name&&null===e.end_time&&p(!0)})),h||a.forEach((e=>{"Vendor Service"===e.service_name&&null===e.end_time&&x(!0)})))}}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.SystemService," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:i,data:l,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:u,onChangeRowsPerPage:e=>{m({...o,page_size:e})},onChangePage:e=>{m({...o,page:e})},subHeader:!0})})})})})})]})};var Pd=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(""),[j,p]=Object(d.useState)(1),[h,x]=Object(d.useState)(!1),[O,N]=Object(d.useState)(!0),[f,_]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""}),[y,w]=Object(d.useState)(),k=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Title",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{u(e.target.value)}),1e3)}))),S=[{name:"Title",selector:e=>e.title,sortable:!0,sortField:"title"},{name:"Slug",selector:e=>e.slug,sortable:!0,sortField:"slug"},{name:"Publish Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),sortField:"created_at",sortable:!0},{name:"Status",selector:e=>1===e.status?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/blog/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}];Object(d.useEffect)((()=>{x(!0),document.title=r.Blogs,C()}),[f,o]);const C=()=>{const e={page:f.page,search:o,page_size:f.page_size,sort_column:f.sort_column,sort_direction:f.sort_direction};N(!0),a.postApi(c.GetBlogs,e).then((e=>{if(N(!1),!0===e.data.status&&""!==e.data.result){const s=e.data.result;t(s[1]),i(!n),w(e.data.result[0][0].total)}else t([]),w(0)}))},A=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={id:t,IsDeleted:!0,deleted_by:s.id};N(!0),a.postApi(c.DeleteBlog,e).then((e=>{N(!1),gl.b.success(l.RecordDeleted),C(),i(!n)}))}}))};return h?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Blogs," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/blog/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ",r.AddBlog," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:S,data:e,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:y,onChangeRowsPerPage:e=>{p(1),_({...f,page:1,page_size:e})},onChangePage:e=>{p(e),_({...f,page:e})},subHeader:!0,onSort:(e,t)=>{_({...f,sort_column:e.sortField,sort_direction:t})},progressPending:O,progressComponent:Object(g.jsx)(v,{}),paginationDefaultPage:j,subHeaderComponent:k})})})})})})]}):Object(g.jsx)(v,{})};var Dd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)(!0),[u,j]=Object(d.useState)(!1),[h,x]=Object(d.useState)(""),O=Object(d.useRef)(new ec.a),[N,f]=Object(d.useState)(""),[,_]=Object(d.useState)(),[y,w]=Object(d.useState)(!0),[k,S]=Object(d.useState)(!1),[C,A]=Object(d.useState)({id:0,title:"",description:"",slug:"",image:"",meta_title:"",meta_description:"",status:0,blog_category_id:"",info:"",created_at:(new Date).toISOString().slice(0,16)});let P="";Object(d.useEffect)((()=>{i(!0),m(!1),document.title=r.AddBlog,void 0!==e.id?(D(),document.title=r.EditBlog):setTimeout((()=>{M()}),1e3)}),[e.id]);const D=()=>{const t={id:e.id};m(!0),a.postApi(c.GetBlogById,t).then((e=>{if(m(!1),e.data.result){const t=e.data.result[0][0];t.created_at=t.created_at?new Date(t.created_at).toISOString().slice(0,16):(new Date).toISOString().slice(0,16),A(t),P=Ci.a.blog_category_id,_(P),setTimeout((()=>{""!==t.image?M(t.image):M(),f(e.data.result[0][0].content)}),1e3),j(!u)}}))},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?new ti.a("blogImages",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}):new ti.a("blogImages",{text:{chooseFile:"Choose Image..."}})};window.addEventListener("fileUploadWithPreview:imagesAdded",(async function(e){C.info=e;const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;if("image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t)if(s<=2097152){const t=await new Promise(((t,s)=>{ao(e.detail.cachedFileArray[0],(e=>{t(e)}))}));x(t),w(!0),S(!1)}else S(!0),x("");else x(""),w(!1),S(!1)})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){x(""),w(!0),S(!1)}));const R=e=>t=>{A("status"===e?{...C,[e]:t.target.checked}:{...C,[e]:t.target.value}),"title"===e&&A({...C,[e]:t.target.value,slug:t.target.value.toLowerCase().replaceAll(/[\s&]/g,"-")}),j(!u)};return!n||o?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditBlog:r.AddBlog," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Page Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"title",min:"2",maxLength:"255",onChange:R("title"),onKeyUp:R("title"),onBlur:()=>O.current.showMessageFor("Page Title"),defaultValue:C.title,placeholder:"Page Title"}),O.current.message("Page Title",C.title,"required|max:60",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Short Description"}),Object(g.jsx)("textarea",{className:"form-control",rows:"2",name:"description",onChange:R("description"),onKeyUp:R("description"),onBlur:()=>O.current.showMessageFor("Description"),defaultValue:C.description,placeholder:"Short Description"}),O.current.message("Short Description",C.description,"required",{className:"error"})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("div",{children:Object(g.jsxs)("label",{children:["Slug (URL)",Object(g.jsx)("div",{className:"note mt-1",children:"(Slug contents only alphanumeric)"})]})}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"slug",min:"1",maxLength:"50",onChange:R("slug"),onKeyUp:R("slug"),onBlur:()=>O.current.showMessageFor("Slug"),defaultValue:C.slug,placeholder:"Slug"}),O.current.message("Slug",C.slug,"required|regex:^[a-z0-9][a-z-0-9]*[a-z0-9]$",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsxs)("label",{children:["Publish Date",Object(g.jsxs)("div",{className:"note mt-1",children:[" ","Select the date when this blog should be published."]})]}),Object(g.jsx)("input",{type:"datetime-local",className:"form-control",name:"created_at",onChange:R("created_at"),value:C.created_at,placeholder:"Publish Date",min:new Date}),O.current.message("Publish Date",C.created_at,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Content"}),Object(g.jsx)(to.a,{name:"content",value:N,options:{height:300,toolbar:[["style",["bold","italic","underline","clear"]],["font",["fontname","fontsize","strikethrough","superscript","subscript","style"]],["para",["ul","ol","paragraph"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Times","Verdana"],fontSizeUnits:["px","pt","%"]},onChange:e=>{(e=>{f(e),j(!u)})(e)}})]})})}),Object(g.jsx)("div",{className:"row"}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"meta_title",min:"1",maxLength:"255",onChange:R("meta_title"),onKeyUp:R("meta_title"),onBlur:()=>O.current.showMessageFor("Meta Title"),defaultValue:C.meta_title,placeholder:"Meta Title"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Meta Description"}),Object(g.jsx)("textarea",{className:"form-control",rows:"2",name:"meta_description",onChange:R("meta_description"),onKeyUp:R("meta_description"),onBlur:()=>O.current.showMessageFor("Meta Description"),defaultValue:C.meta_description,placeholder:"Meta Description"})]})})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("p",{className:"m-0",children:["Image"," ",Object(g.jsx)("label",{className:"note",children:"( Only PNG, JPEG, JPG format allowed.)"})]}),Object(g.jsx)("div",{className:"custom-file-container mb-4","data-upload-id":"blogImages"}),Object(g.jsx)("div",{style:y?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:k?{}:{display:"none"},className:"error pt-0 pb-2",children:"File size shouldn't be greater than 2MB."})]}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12 mt-1",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:R("status"),id:"EnableProduct",checked:C.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{if(!O.current.allValid())return O.current.showMessages(),void j(!u);const r={id:C.id,title:C.title,content:N,description:C.description,slug:C.slug.trim(),image:h,status:C.status?1:0,blog_category_id:C.blog_category_id,meta_title:C.meta_title,meta_description:C.meta_description,created_at:C.created_at};m(!0),a.postApi(c.SetBlog,r).then((e=>{if(m(!1),e.data.message)return""!==e.data.message&&M(h),gl.b.warning(e.data.message),j(!u),void s.current.removeAttribute("disabled");0!==C.id&&""!==C.id?gl.b.success(l.RecordUpdated):gl.b.success(l.RecordAdded),j(!u),t.push("/blog")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/blog",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Md=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)([]),[n,i]=Object(d.useState)([]);Object(d.useEffect)((()=>{o()}),[]);const o=()=>{a.getApi(c.GetLinkStatistics).then((e=>{e.data.status&&e.data.result[0].length>0&&(t(e.data.result[0].filter((e=>"products"===e.type))),l(e.data.result[0].filter((e=>"category"===e.type))),i(e.data.result[0].filter((e=>"pages"===e.type))))}))};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.LinkStatistics," "]})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:r.Products})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"w-75",children:"Headline"}),Object(g.jsx)("th",{children:"Clicks"})]}),e.length>0?e.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"w-75",children:Object(g.jsx)(b.b,{to:{pathname:"https://staging.harmonyjewels.co.uk/"+e.URL},target:"_blank",children:e.label})}),Object(g.jsx)("td",{children:e.clicks})]},t))):Object(g.jsx)("tr",{children:Object(g.jsx)("td",{className:"text-center",colSpan:"2",children:"No data available"})})]})})]})})})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:r.Category})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"w-75",children:"Headline"}),Object(g.jsx)("th",{children:"Clicks"})]}),s.length>0?s.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"w-75",children:Object(g.jsx)(b.b,{to:{pathname:"https://staging.harmonyjewels.co.uk/"+e.URL},target:"_blank",children:e.label})}),Object(g.jsx)("td",{children:e.clicks})]},t))):Object(g.jsx)("tr",{children:Object(g.jsx)("td",{className:"text-center",colSpan:"2",children:"No data available"})})]})})]})})})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:r.Pages})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"w-75",children:"Headline"}),Object(g.jsx)("th",{children:"Clicks"})]}),n.length>0?n.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"w-75",children:Object(g.jsx)(b.b,{to:{pathname:"https://staging.harmonyjewels.co.uk/"+e.URL},target:"_blank",children:e.label})}),Object(g.jsx)("td",{children:e.clicks})]},t))):Object(g.jsx)("tr",{children:Object(g.jsx)("td",{className:"text-center",colSpan:"2",children:"No data available"})})]})})]})})})})]})]})};var Rd=()=>{const[e,t]=Object(d.useState)([]),[s,n]=Object(d.useState)(!1),[i,o]=Object(d.useState)(!0),[u,j]=Object(d.useState)(!1),[p,h]=Object(d.useState)(),[x,O]=Object(d.useState)(""),[N,f]=Object(d.useState)(1),_=[{name:"Name",selector:e=>e.name,sortable:!0,sortField:"Name"},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),sortable:!0,sortField:"created_at"},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:"master"!==e.name&&Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/role/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>C(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})})}],[y,w]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""});Object(d.useEffect)((()=>{n(!0),document.title=r.Roles,k()}),[y,x]);const k=()=>{const e={_page:y.page,_search:x,_page_size:y.page_size,_sort_column:y.sort_column,_sort_direction:y.sort_direction};o(!0),a.postApi(c.GetRoles,e).then((e=>{if(o(!1),!0===e.data.status){const s=e.data.result[1];h(e.data.result[0][0].total),t(s),j(!u)}}))},S=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{O(e.target.value)}),1e3)}))),C=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={_id:t};o(!0),a.postApi(c.DeleteRole,e).then((e=>{o(!1),gl.b.success(l.RecordDeleted),k(),j(!u)}))}}))};return s?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Roles," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/role/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Role"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:_,data:e,pagination:!0,paginationServer:!0,paginationTotalRows:p,onChangeRowsPerPage:e=>{f(1),w({...y,page:1,page_size:e})},onChangePage:e=>{f(e),w({...y,page:e})},subHeader:!0,persistTableHead:!0,paginationDefaultPage:N,onSort:(e,t)=>{w({...y,sort_column:e.sortField,sort_direction:t})},progressPending:i,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:S})})})})})})]}):Object(g.jsx)(v,{})};var Fd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)(!0),u=Object(d.useRef)(new ec.a),[j,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)([]),[N,f]=Object(d.useState)({id:0,name:"",permissions:[],status:0});Object(d.useEffect)((()=>{i(!0),document.title=r.AddRole,null!=e.id&&(document.title=r.EditRole,_()),y()}),[e.id]);const _=()=>{const t={id:e.id};m(!0),a.postApi(c.GetRoleByID,t).then((e=>{m(!1),e.data.result&&(f(e.data.result[0][0]),h(!j))}))},y=()=>{m(!0),a.getApi(c.GetPermission).then((e=>{if(m(!1),!0===e.data.status){const t=e.data.result[0];O(t),h(!j)}}))},w=e=>t=>{if("status"===e)f({...N,[e]:t.target.checked});else if("permissions"===e){const e=t.target,s=e.value;e.checked?N.permissions.push(parseInt(s)):N.permissions=N.permissions.filter((e=>e!==parseInt(s)))}else f({...N,[e]:t.target.value});h(!j)};return!n||o?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditRole:r.AddRole," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("form",{className:"forms-sample",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:w("name"),onKeyUp:w("name"),onBlur:()=>u.current.showMessageFor("Name"),value:N.name,placeholder:"Name"}),u.current.message("Name",N.name,"required|alpha_num_space",{className:"error"})]})})})})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsxs)("div",{className:"card",children:[Object(g.jsx)("div",{className:"card-header",children:Object(g.jsxs)("h5",{className:"page-title",children:[" ",r.Permissions," "]})}),Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsx)("div",{className:"row",children:x.length>0?x.map(((e,t)=>Object(g.jsx)("div",{className:"col-md-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("input",{type:"checkbox",className:"mr-2 pointer",name:"permissions",onChange:w("permissions"),value:e.id,checked:N.permissions.includes(e.id),id:"permission_"+e.id}),Object(g.jsx)("label",{className:"mt-1 pointer",htmlFor:"permission_"+e.id,children:e.name})]})},t))):""}),Object(g.jsx)("div",{className:"row",children:u.current.message("Permission",N.permissions,"required",{className:"error"})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:s,type:"button",onClick:r=>{if(!u.current.allValid())return u.current.showMessages(),void h(!j);const n={_id:N.id,_name:N.name,_permission:N.permissions};m(!0),a.postApi(c.SetRole,n).then((a=>{if(m(!1),a.data.message)return gl.b.warning(a.data.message),h(!j),void s.current.removeAttribute("disabled");void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),h(!j),t.push("/roles")}))},className:"btn btn-custom text-white mr-2 ",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/roles",className:"btn btn-primary",children:"Cancel"})]})})]})]})})})]})};var Id=()=>{const e=Object(p.useHistory)(),[t,s]=Object(d.useState)([]),[n,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!0),[h,x]=Object(d.useState)(!1),O=[{name:"Name",selector:e=>e.name},{name:"Description",selector:e=>e.description},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:"Master"!==e.name&&Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/permission/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>y(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})})}],[N,f]=Object(d.useState)({page:1,search:"",page_size:10});Object(d.useEffect)((()=>{m(!0),document.title=r.Permissions,i.validatePermission(o.rolepermission)||e.push("/"),_()}),[N]);const _=()=>{j(!0),a.getApi(c.GetPermission).then((e=>{if(j(!1),!0===e.data.status){const t=e.data.result[0];s(t),x(!h)}}))},y=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={_id:t};j(!0),a.postApi(c.DeletePermission,e).then((e=>{j(!1),gl.b.success(l.RecordDeleted),_(),x(!h)}))}}))};return n?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Permissions," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/permission/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Permission"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:O,data:t,paginationServer:!0,persistTableHead:!0,onChangeRowsPerPage:e=>{f({...N,page_size:e})},onChangePage:e=>{f({...N,page:e})},subHeader:!0,progressPending:u,progressComponent:Object(g.jsx)(v,{})})})})})})})]}):Object(g.jsx)(v,{})};var Ed=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(d.useRef)(),n=Object(d.useRef)(new ec.a),[i,o]=Object(d.useState)(!1),[m,u]=Object(d.useState)({id:0,name:"",description:"",key:""});Object(d.useEffect)((()=>{document.title=r.AddPermission,void 0!==e.id&&(document.title=r.EditPermission,j())}),[e.id]);const j=()=>{const t={id:e.id};a.postApi(c.GetPermissionByID,t).then((e=>{e.data.result&&(u(e.data.result[0][0]),o(!i))}))},h=e=>t=>{u("status"===e?{...m,[e]:t.target.checked}:{...m,[e]:t.target.value}),o(!i)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==e.id?r.EditPermission:r.AddPermission," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Name"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:h("name"),onKeyUp:h("name"),onBlur:()=>n.current.showMessageFor("Name"),value:m.name,placeholder:"Name"}),n.current.message("Name",m.name,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Description"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"description",onChange:h("description"),onKeyUp:h("description"),onBlur:()=>n.current.showMessageFor("Description"),value:m.description,placeholder:"description"}),n.current.message("Description",m.description,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Key"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"key",onChange:h("key"),onKeyUp:h("key"),onBlur:()=>n.current.showMessageFor("Key"),value:m.key,placeholder:"key"}),n.current.message("Key",m.key,"required",{className:"error"})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:s,type:"button",onClick:r=>{if(!n.current.allValid())return n.current.showMessages(),void o(!i);s.current&&s.current.setAttribute("disabled","disabled");const d={_id:m.id,_name:m.name,_description:m.description,_key:m.key};a.postApi(c.SetPermission,d).then((a=>{if(a.data.message)return gl.b.warning(a.data.message),o(!i),void s.current.removeAttribute("disabled");void 0!==e.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),o(!i),t.push("/permissions")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/permissions",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Ld=e=>{console.log(e);const[t,s]=Object(d.useState)(),[a,c]=Object(d.useState)(!1);Object(d.useEffect)((()=>{var t;s(null===(t=e.props)||void 0===t?void 0:t.data),c(!a)}),[]),Object(d.useEffect)((()=>{c(!a)}),[t]);const r=()=>{e.onCloseModal(!0)};return Object(g.jsxs)(li.a,{show:e.props.IsShowModal,onHide:r,keyboard:!0,children:[Object(g.jsxs)(li.a.Header,{children:[Object(g.jsx)("div",{children:Object(g.jsx)("h6",{children:"Virtual Ring Request"})}),Object(g.jsx)("button",{type:"button",className:"btn-close","aria-label":"Close",onClick:r})]}),Object(g.jsx)(li.a.Body,{children:Object(g.jsx)("div",{className:"content-wrapper p-0",children:Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 mb-3"})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsx)("table",{className:"table table-borderless table-diamond-detail",children:Object(g.jsx)("tbody",{children:void 0!==t&&Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("tr",{children:Object(g.jsx)("td",{colSpan:2,className:"text-center",children:Object(g.jsx)("img",{src:t.image,width:300})})}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Product Name:"}),Object(g.jsx)("td",{children:t.product_name})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"SKU:"}),Object(g.jsx)("td",{children:t.sku})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Metal:"}),Object(g.jsx)("td",{children:t.metal})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Style:"}),Object(g.jsx)("td",{children:t.style})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Shape:"}),Object(g.jsx)("td",{children:t.shape})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Carat:"}),Object(g.jsx)("td",{children:t.carat+" ct."})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Name:"}),Object(g.jsx)("td",{children:t.firstname+" "+t.lastname})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Email:"}),Object(g.jsx)("td",{children:t.email})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Message:"}),Object(g.jsx)("td",{children:t.message})]})]})})})})})]})})})})})})})]})};var Gd=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)([]),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(!1),[j]=Object(d.useState)(!1),[b,p]=Object(d.useState)(),[h,x]=Object(d.useState)({page:1,search:"",page_size:10}),O=[{name:"Image",selector:e=>Object(g.jsx)("img",{className:"my-2",width:"95px",height:"95px",src:e.image})},{name:"SKU",selector:e=>e.sku},{name:"Product Name",selector:e=>e.metal+" "+e.product_name+" "+e.style},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"cursor action-btn",children:Object(g.jsxs)("span",{onClick:t=>_(t,e.id),className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"fa fa-eye","aria-hidden":"true"})," "]})})}];Object(d.useEffect)((()=>{document.title=r.VirtualRingBuilder,N()}),[h]);const N=()=>{const e={page:h.page,search:h.search,page_size:h.page_size};a.postApi(c.GetVirtualRingRequestList,e).then((e=>{t(e.data.result[1]),e.data.result[0].length>0&&p(e.data.result[0][0].total)}))},f=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Service, Name, E-mail, Contact No.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>x({...h,page:1,search:e.target.value})}))),_=(t,s)=>{t.preventDefault();const a=e.filter((e=>e.id===s))[0];l(a),u(!0),i(!n)};return j?Object(g.jsx)(v,{}):Object(g.jsxs)(g.Fragment,{children:[!0===o&&Object(g.jsx)(Ld,{props:{IsShowModal:o,data:s},onCloseModal:()=>{u(!1),N(),i(!n)}}),Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.VirtualRingBuilder," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:O,data:e,pagination:!0,paginationServer:!0,paginationTotalRows:b,onChangeRowsPerPage:e=>{x({...h,page_size:e})},onChangePage:e=>{x({...h,page:e})},subHeader:!0,persistTableHead:!0,subHeaderComponent:f})})})})})})]})]})};var Td=()=>{const e=Object(d.useContext)(mo);console.log(e.id);const t=Object(p.useParams)(),s=Object(p.useHistory)(),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!1),[h,x]=Object(d.useState)(!0),O=Object(d.useRef)(),N=Object(d.useRef)(new ec.a),[f,_]=Object(d.useState)(!1),[y,w]=Object(d.useState)([]),[k,S]=Object(d.useState)({id:0,email:"",name:"",password:"",confirm_password:"",is_active:0,roleids:[]}),[C,A]=Object(d.useState)([]);Object(d.useEffect)((()=>{j(!0),document.title=r.AddUser,D(),null!=t.id&&(document.title=r.EditUser,P())}),[t.id]);const P=()=>{const e={_id:t.id};x(!0),a.postApi(c.GetUser,e).then((e=>{if(x(!1),e.data.result){const t=null!=e.data.result[0][0].role_ids?e.data.result[0][0].role_ids.split(","):[];if(t.length>0){const s=t.map((e=>parseInt(e)));e.data.result[0][0].roleids=s}e.data.result[0][0].password="",S(e.data.result[0][0]),A(e.data.result[0][0]),_(!f)}}))},D=()=>{x(!0),a.postApi(c.GetRoles,{_page:1,_search:"",_page_size:10,_sort_column:"",_sort_direction:""}).then((e=>{if(x(!1),e.data.result){const t=[];e.data.result[1].map(((e,s)=>(t.push({label:e.name,value:e.id}),!0))),w(t),_(!f)}}))},M=(e,t)=>{S("is_active"===t?{...k,[t]:e.target.checked}:"roleids"===t?{...k,[t]:Array.isArray(e)?e.map((e=>e.value)):[]}:{...k,[t]:e.target.value}),_(!f)};return!u||h?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",null==t.id?r.AddUser:r.EditUser," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:s.goBack,children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",autoComplete:"off",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Username"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"name",onChange:e=>M(e,"name"),value:k.name}),N.current.message("Name",k.name,"required|alpha_num_space|max:255",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Email"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"email",onChange:e=>M(e,"email"),value:k.email}),N.current.message("Email",k.email,"required|email|max:50",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Password"}),Object(g.jsx)("input",{type:n?"text":"password",className:"form-control",name:"password",minLength:"8",maxLength:"12",onChange:e=>M(e,"password"),placeholder:"Password",autoComplete:"new-password"}),Object(g.jsx)("span",{className:n?"fa-eye fa fa-fw field-icon toggle-password":"fa-eye-slash fa fa-fw field-icon toggle-password",onClick:()=>i((e=>!e))}),void 0!==t.id?N.current.message("Password",k.password,"min:8|max:12",{className:"error"}):N.current.message("Password",k.password,"required|min:8|max:12",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Confirm Password"}),Object(g.jsx)("input",{type:o?"text":"password",className:"form-control",name:"confirm_password",onChange:e=>M(e,"confirm_password"),placeholder:"Confirm Password",minLength:"8",maxLength:"12"}),Object(g.jsx)("span",{className:o?"fa-eye fa fa-fw field-icon toggle-password":"fa-eye-slash fa fa-fw field-icon toggle-password",onClick:()=>m((e=>!e))}),void 0!==t.id&&k.password.length<1?N.current.message("Confirm Password",k.confirm_password,"min:8|max:12|in:".concat(k.password),{className:"error",messages:{in:"Not matched with password!"}}):N.current.message("Confirm Password",k.confirm_password,"required|min:8|max:12|in:".concat(k.password),{className:"error",messages:{in:"Not matched with password!"}})]})}),Object(g.jsx)("div",{className:"col-md-6 ",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Role "}),y.length>0&&Object(g.jsx)(ad.a,{className:"dropdown w-auto",placeholder:"Select Option",value:y.filter((e=>{var t;return null===(t=k.roleids)||void 0===t?void 0:t.includes(e.value)})),options:y,onChange:e=>M(e,"roleids"),isMulti:!0,isClearable:!0}),N.current.message("Role",k.roleids,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"is_active",onChange:e=>M(e,"is_active"),id:"EnableUser",checked:k.is_active}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableUser",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{ref:O,type:"button",onClick:r=>{if(!N.current.allValid())return N.current.showMessages(),void _(!f);O.current&&O.current.setAttribute("disabled","disabled");const n={_id:k.id,_name:k.name.trim(),_email:k.email,_password:k.password,_is_active:k.is_active?1:0,_role_ids:k.roleids};x(!0),a.postApi(c.SetUser,n).then((a=>{if(x(!1),a.data.message)return gl.b.warning(a.data.message),_(!f),void O.current.removeAttribute("disabled");null==t.id?gl.b.success(l.RecordAdded):gl.b.success(l.RecordUpdated),_(!f),e.id===parseInt(t.id)?C.name.trim()===k.name.trim()&&C.email===k.email&&""===k.password&&C.is_active===k.is_active?s.push("/users"):(localStorage.removeItem("appState"),localStorage.removeItem("PermissionList"),window.history.pushState(null,"","/login"),window.history.replaceState(null,"","/login"),window.location.href="/login"):s.push("/users")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/users",className:"btn btn-primary",children:"Cancel"})]})})]})})})})})]})};var Bd=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(),[j,p]=Object(d.useState)(!1),[h,x]=Object(d.useState)(1),[O,N]=Object(d.useState)(!0),[f,_]=Object(d.useState)(""),y=[{name:"Username",selector:e=>e.name,sortable:!0,sortField:"Name"},{name:"Email",selector:e=>e.email,sortField:"Email",sortable:!0},{name:"Role",selector:e=>void 0!==e.roles?e.roles:"",sortable:!1,wrap:!0},{name:"Status",selector:e=>1===e.is_active?Object(g.jsx)("label",{children:"Active"}):Object(g.jsx)("label",{children:"Inactive"})},{name:"Created Date",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),sortField:"created_at",sortable:!0},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/users/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),s.id!==e.id&&Object(g.jsxs)(b.b,{onClick:t=>A(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[w,k]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""});Object(d.useEffect)((()=>{p(!0),document.title=r.Users,S()}),[w,f]);const S=()=>{const e={_id:0,_page:w.page,_search:f,_page_size:w.page_size,_sort_column:w.sort_column,_sort_direction:w.sort_direction};N(!0),a.postApi(c.GetUsers,e).then((e=>{if(N(!1),e.data.status){const s=e.data.result[1];t(s),e.data.result[0].length>0&&u(e.data.result[0][0].total),i(!n)}}))},C=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name, Email.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{_(e.target.value)}),1e3)}))),A=async(e,t)=>{e.preventDefault(),sc()(l.SwalDeleteProp).then((function(e){if(e){const e={_id:t};N(!0),a.postApi(c.DeleteUser,e).then((e=>{N(!1),gl.b.success(l.RecordDeleted),S(),i(!n)}))}}))};return j?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.Users," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/users/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add User"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.postApi(c.GetUserExcel).then((e=>{e.data.result&&co(e.data.result[0],"Users")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:y,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,progressPending:O,progressComponent:Object(g.jsx)(v,{}),paginationTotalRows:o,onChangeRowsPerPage:e=>{x(1),k({...w,page_size:e,page:1})},onChangePage:e=>{x(e),k({...w,page:e})},subHeaderComponent:C,paginationDefaultPage:h,subHeader:!0,onSort:(e,t)=>{k({...w,sort_column:e.sortField,sort_direction:t})},sortServer:!0})})]})})})})]}):Object(g.jsx)(v,{})};var zd=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)(!1),[n,i]=Object(d.useState)(!0),[o,u]=Object(d.useState)(!1),[j,b]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[p,h]=Object(d.useState)(1),[x,O]=Object(d.useState)(),[,N]=Object(d.useState)(!1),[f,_]=Object(d.useState)(!1);let y=null;const w=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Keyword",className:"form-control col-md-3",placeholder:"Search",onChange:e=>(e=>{b({...j,page:1,search:e.target.value}),N(!0),_(!1),y&&clearTimeout(y),y=setTimeout((()=>{N(!1),_(!0)}),1e3)})(e)}))),k=[{name:"Keyword",selector:e=>e.keyword,sortable:!0,sortField:"keyword"},{name:"Number of Uses",selector:e=>e.no_of_users,sortable:!0,sortField:"number_of_uses"},{name:"Number of Results",selector:e=>e.no_of_result,sortable:!0,sortField:"number_of_results"},{name:"Last Search Date",selector:e=>Object(g.jsx)(Zn,{value:e.updated_at}),sortable:!0,sortField:"last_search"}];Object(d.useEffect)((()=>{l(!0),document.title=r.SearchTerms,S()}),[!f,j]),Object(d.useEffect)((()=>()=>{y&&clearTimeout(y)}),[]);const S=()=>{const e={page:j.page,search:j.search,page_size:j.page_size,sort_column:j.sort_column,sort_direction:j.sort_direction};i(!0),a.postApi(c.GetSearchTerms,e).then((e=>{if(i(!1),!0===e.data.status&&""!==e.data.result){const s=e.data.result;t(s[1]),u(!o),O(e.data.result[0][0].total)}else t([]),O(0)}))};return s?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.SearchTerms," "]})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("button",{className:"btn btn-primary float-right m-1",onClick:()=>{a.postApi(c.GetSearchTermsExcel).then((e=>{e.data.result&&co(e.data.result[0],"Search Terms")}))},children:"Export Excel"}),Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:k,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,progressPending:n,progressComponent:Object(g.jsx)(v,{}),paginationTotalRows:x,onChangeRowsPerPage:e=>{h(1),b({...j,page_size:e})},onChangePage:e=>{h(e),b({...j,page:e})},subHeader:!0,onSort:(e,t)=>{b({...j,sort_column:e.sortField,sort_direction:t})},subHeaderComponent:w,paginationDefaultPage:p})})]})})})})]}):Object(g.jsx)(v,{})};var Ud=()=>{const[e,t]=Object(d.useState)([]),[s,l]=Object(d.useState)([]),[n,i]=Object(d.useState)(!1),[o,m]=Object(d.useState)(!1),u={page:1,page_size:10,filter_type:"",from_date:"",to_date:"",assignee:""},[j,p]=Object(d.useState)(u);Object(d.useEffect)((()=>{document.title=r.AppointmentTitle,h()}),[]),Object(d.useEffect)((()=>{x()}),[j]);const h=()=>{a.getApi(c.GetAppointmentUsers).then((e=>{if(e.data.result){const t=e.data.result[0];l(t)}}))},x=()=>{const e={page:j.page,page_size:j.page_size,filter_type:j.filter_type,from_date:""!==j.from_date?new Date(j.from_date+" GMT").toISOString().slice(0,19).replace("T"," "):"",to_date:""!==j.to_date?new Date(j.to_date+" GMT").toISOString().slice(0,19).replace("T"," "):"",assignee:j.assignee};a.postApi(c.GetAppointmentReport,e).then((e=>{t(e.data.result[0])}))},O=(e,t)=>{e.preventDefault(),"booking_date"===t?null!==e.value&&"custom"===j.filter_type?(j.from_date=e.value[0],j.to_date=e.value[1]):(j.from_date="",j.to_date=""):j[t]=e.target.value,i(!n)};return Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.AppointmentReport," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(b.b,{to:"#",onClick:()=>{m(!o)},className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})})]}),Object(g.jsx)("div",{className:o?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-4 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Filter Type"}),Object(g.jsxs)("select",{className:"form-control",name:"filter_type",onChange:e=>O(e,"filter_type"),value:j.filter_type,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"week",children:"Week"}),Object(g.jsx)("option",{value:"month",children:"Month"}),Object(g.jsx)("option",{value:"year",children:"Year"}),Object(g.jsx)("option",{value:"custom",children:"Custom Date"})]})]})}),Object(g.jsx)("div",{className:"col-md-4 col-lg-4",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Assignee"}),Object(g.jsxs)("select",{className:"form-control",name:"assignee",onChange:e=>O(e,"assignee"),value:j.assignee,children:[Object(g.jsx)("option",{value:"",children:"Select"}),s.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]})]})}),Object(g.jsx)("div",{className:"custom"===j.filter_type?"col-md-6 col-lg-4":"d-none",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:"Date"}),Object(g.jsx)(nd.a,{onChange:e=>O(e,"booking_date")})]})})]}),Object(g.jsx)("div",{className:"row mt-2",children:Object(g.jsxs)("div",{className:"col-md-12 pr-2 text-right",children:[Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsx)("span",{className:"filter-result-repeat",children:Object(g.jsx)("a",{children:Object(g.jsx)("button",{type:"button",onClick:e=>(p(u),void i(!n)),className:"btn btn-primary btn-fw rounded mr-2",children:"Clear All"})})})}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"#",className:"btn btn-dark btn-fw rounded mr-2",onClick:e=>x(e),children:[" ","Apply Filter"," "]})})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:[{name:"Assignee",selector:e=>e.name},{name:" In Progress",selector:e=>e.in_progress},{name:"Successful",selector:e=>e.successful},{name:"Unsuccessful",selector:e=>e.unsuccessful}],data:e,persistTableHead:!0,pagination:!0,paginationServer:!0,onChangeRowsPerPage:e=>{p({...j,page_size:e})},onChangePage:e=>{p({...j,page:e})},subHeader:!0})})})})})})]})};var qd=()=>{const[e,t]=Object(d.useState)([]),s=Object(d.useContext)(mo),[n,i]=Object(d.useState)(!1),[o,u]=Object(d.useState)(1),[j,p]=Object(d.useState)(!1),[h,x]=Object(d.useState)(!0),O=[{name:"Section Name",sortable:!0,sortField:"section_name",selector:e=>e.section_name},{name:"Template Name",selector:e=>e.template_name},{name:"Sub Title",selector:e=>e.subtitle},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Sort Order",selector:e=>e.sort_order},{name:"Status",selector:e=>e.status?"Active":"Inactive"},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/widgets/section/edit/"+e.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>S(t,e.id),to:"",className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}],[N,f]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[_,y]=Object(d.useState)(),w=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",onChange:e=>f({...N,search:e.target.value})}))),k=()=>{const e={page:N.page,search:N.search,page_size:N.page_size,sort_column:N.sort_column,sort_direction:N.sort_direction};x(!0),a.postApi(c.GetSectionList,e).then((e=>{x(!1),t(e.data.result[1]),y(e.data.result[0][0].total),i(!n)}))},S=async(e,t)=>{e.preventDefault(),sc()(l.SwalSectionDeleteProp).then((function(e){if(e){const e={_id:t,_deleted_by:s.id};x(!0),a.postApi(c.DeleteSection,e).then((e=>{x(!1),gl.b.success(l.sectiondeleted),k(),i(!n)}))}}))};return Object(d.useEffect)((()=>{p(!0),document.title=r.WidgetsSection,k()}),[N]),j?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.WidgetsSection," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{to:"/widgets/section/add",className:"btn btn-dark btn-fw rounded mr-2",children:[" ","Add Section"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:O,data:e,pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:_,paginationDefaultPage:o,onChangeRowsPerPage:e=>{u(1),f({...N,page:1,page_size:e})},onChangePage:e=>{u(e),f({...N,page:e})},subHeader:!0,subHeaderComponent:w,onSort:(e,t)=>{f({...N,sort_column:e.sortField,sort_direction:t})},progressPending:h,progressComponent:Object(g.jsx)(v,{}),sortServer:!0})})})})})})]}):Object(g.jsx)(v,{})};var Hd=()=>{var e,t=[];const s=["Rings","Bracelets","Pendants","Necklaces","Earrings","Studs"],[n,u]=Object(d.useState)({products_skus:[]}),j=Object(p.useParams)(),h=Object(p.useHistory)(),x=Object(d.useRef)(new ec.a),[O,N]=Object(d.useState)(!1),[f,_]=Object(d.useState)(!1),[y,w]=Object(d.useState)(""),[k,S]=Object(d.useState)(null),[C,A]=Object(d.useState)([]),[P,D]=Object(d.useState)([]),[M,R]=Object(d.useState)(null),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)(),[G,T]=Object(d.useState)(),[B,z]=Object(d.useState)(0),[U,q]=Object(d.useState)(1),[H,V]=Object(d.useState)(!0),K=Object(d.useRef)(null),[W,Y]=Object(d.useState)({id:0,section_name:"",sub_title:"",sort_order:"",status:0,template_id:0,content:"",category_id:0,options:[]}),[Q,X]=Object(d.useState)({page:1,search:"",page_size:10,sort_column:"",sort_direction:""}),[J,Z]=Object(d.useState)([]);Object(d.useEffect)((()=>{void 0!==j.id&&te()}),[Q]);const $=[{name:"Title",sortable:!0,sortField:"title",selector:e=>e.title},{name:"Link Type",selector:e=>e.link_type},{name:"Value",selector:e=>null===e.value?" -":e.value},{name:"Created Date",sortable:!0,sortField:"created_at",selector:e=>Object(g.jsx)(Zn,{value:e.created_at})},{name:"Status",selector:e=>e.status?"Active":"Inactive"},{name:"Action",selector:e=>Object(g.jsxs)("div",{className:"action-btn",children:[Object(g.jsxs)(b.b,{to:"/widgets/section-option/edit/"+e.id+"&"+j.id,className:"text-dark",title:"Edit",children:[Object(g.jsx)("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"})," "]}),Object(g.jsxs)(b.b,{onClick:t=>ne(t,e.id,j.id),className:"text-dark",title:"Delete",children:[Object(g.jsx)("i",{className:"fa fa-trash-o","aria-hidden":"true"})," "]})]})}];Object(d.useEffect)((()=>{document.title=r.AddSection,i.validatePermission(o.Section)||h.push("/"),N(!0),void 0!==j.id&&(document.title=r.EditSection,te()),se(),ae()}),[j.id]);const ee=e=>t=>{Y("status"===e?{...W,[e]:t.target.checked}:{...W,[e]:t.target.value}),_(!f)};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){const s=e.detail.cachedFileArray[0].type,a=e.detail.cachedFileArray[0].type.split("/")[1],c=e.detail.cachedFileArray[0].size,r=e.detail.uploadId.split("_")[2];"image/jpeg"!==s&&"image/jpg"!==s&&"image/png"!==s||c<=2097152&&ao(e.detail.cachedFileArray[0],(e=>{t.push({imageId:r,image:e,type:"."+a})}))})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){if(t.length>0){const s=e.detail.uploadId.split("_")[2];t=t.filter((e=>e.imageId!==s))}}));const te=()=>{const e={id:j.id,page:Q.page,search:Q.search,page_size:Q.page_size,sort_column:Q.sort_column,sort_direction:Q.sort_direction};a.postApi(c.GetSectionById,e).then((e=>{if(e.data.result){const t=e.data.result[0][0],s=e.data.result[2];void 0!==t&&(Y({id:t.id,section_name:t.section_name,sub_title:t.sub_title,sort_order:t.sort_order,status:t.status,template_id:t.template_id,content:t.content}),5===t.template_id&&((()=>{const e={priceColumn:"US_price",is_admin:1,section_id:j.id};V(!0),a.postApi(c.getHomeContent,e).then((e=>{V(!1);try{var t;const s=null===(t=e.data.result[1])||void 0===t?void 0:t.filter((e=>"best_seller"===e.template_name))[0].content;Z(s)}catch(s){console.log(s)}}))})(),T(de(JSON.parse(t.content))),u({...n,products_skus:JSON.parse(t.content)})),0!==s.length?I(s):I(0),L(e.data.result[1][0].total),1===t.template_id?w("three_column"):2===t.template_id?w("slider"):3===t.template_id?w("two_column"):4===t.template_id?w("custom_html"):5===t.template_id?w("best_seller"):6===t.template_id&&w("one_column"),0!==s.length?R(s.filter((e=>e.status)).length):R(0),S(t.template_id))}}))},se=()=>{V(!0),a.postApi(c.GetTemplatesList,{}).then((e=>{V(!1),A(e.data.result),_(!f)}))},ae=()=>{V(!0),a.getApi(c.BestsellerCategory).then((e=>{V(!1);const t=e.data.result[0];D(t),_(!f)}))},ce={position:"relative",padding:"10px 10px",fontSize:"15px",border:"1px solid #f9fafa",background:"#f9fafa",cursor:"move"},re=e=>t=>{t.preventDefault();let s=[...W.options];s=s.filter((t=>t.id!==e)),W.options=s;const a=Object.groupBy(s,(e=>{let{parentid:t}=e;return t})),c=[];for(const e in a){const t=a[e],s=[];for(const e in t)s.push(t[e].value);c.push({categoryid:e,products:s})}if(0!==n.length&&void 0!==j.id)if(0!==c.length){const e=n.products_skus.map((e=>e[0].categoryid===c[0].categoryid)).findIndex((e=>e));n.products_skus[e][0].products=c[0].products}else{const e=n.products_skus.map((e=>parseInt(e[0].categoryid)===W.category_id)).findIndex((e=>e));n.products_skus[e][0].products=[]}_(!f)},le={sid:j.id},ne=(e,t,s)=>{sc()(l.SwalDeleteProp).then((function(e){if(e){const e={_id:t,_section_id:s};a.postApi(c.DeleteSectionItem,e).then((e=>{gl.b.success(l.RecordDeleted),te()}))}}))},ie=()=>{const e={_section_id:j.id};a.postApi(c.ClearSectionItems,e).then((e=>{}))},oe=m.a.useMemo((()=>Object(g.jsx)("input",{name:"Search",type:"text",title:"Search For Name.",className:"form-control col-md-3",placeholder:"Search",value:Q.search,onChange:e=>X({...Q,search:e.target.value})}))),de=e=>e.flatMap((e=>{const t=parseInt(e[0].categoryid);return e[0].products.map(((e,s)=>({parentid:t,id:Math.floor(1e3+9e3*Math.random()),value:e,sort_order:s})))}));return!O||H?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[" ",void 0!==j.id?r.EditSection:r.AddSection," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(b.b,{className:"btn btn-dark btn-fw rounded mr-2",to:"/widgets/section",children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",autoComplete:"off",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Section Name"}),Object(g.jsx)("input",{type:"text",maxLength:"255",className:"form-control",name:"section_name",onChange:ee("section_name"),onKeyUp:ee("section_name"),onBlur:()=>x.current.showMessageFor("section_name"),value:W.section_name,placeholder:"Section Name"}),x.current.message("Section Name",W.section_name,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Sub Title"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"sub_title",onChange:ee("sub_title"),onKeyUp:ee("sub_title"),defaultValue:W.sub_title,placeholder:"Sub Title"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Sort Order"}),Object(g.jsx)("input",{type:"number",min:1,className:"form-control",name:"sort_order",onChange:ee("sort_order"),onKeyUp:ee("sort_order"),value:W.sort_order,onKeyPress:e=>{"Minus"!==e.code&&"Equal"!==e.code&&"NumpadAdd"!==e.code&&"NumpadSubtract"!==e.code||e.preventDefault()},placeholder:"Sort Order"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Select Template"}),Object(g.jsxs)("select",{className:"form-control",name:"template_id",onChange:e=>{const t=C.filter((t=>t.id===parseInt(e.currentTarget.value)))[0].name;w((null!==t||void 0!==t)&&"custom_html"===t||(null!==t||void 0!==t)&&"best_seller"===t?t:""),Y({...W,template_id:parseInt(e.target.value)}),_(!f)},value:W.template_id,children:[Object(g.jsx)("option",{value:"",children:"Select"}),C.length>0&&C.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"best_seller"===y?"row-col-md-6 ":"row d-none",children:[Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Select Category"}),Object(g.jsxs)("div",{className:"d-flex",children:[Object(g.jsxs)("select",{className:"form-control",name:"category_id",onChange:e=>{if(void 0!==j.id){const t=G.filter((t=>t.parentid===parseInt(e.target.value)));Y({...W,options:t,category_id:parseInt(e.target.value)})}else Y({...W,category_id:parseInt(e.target.value),options:[]});_(!f)},value:W.category_id,children:[Object(g.jsx)("option",{value:0,children:"Select"}),P.length>0&&P.map(((e,t)=>Object(g.jsx)("option",{value:e.id,children:e.name},t)))]}),0!==W.category_id&&void 0!==W.category_id&&W.options.length<4?Object(g.jsx)("button",{className:"btn btn-primary ml-2 white-space-nowrap",onClick:e=>{e.preventDefault();let t=W.options;void 0===t&&(t=[]),t.push({parentid:W.category_id,id:Math.floor(1e3+9e3*Math.random()),value:"",sort_order:t.length>0?Math.max(...t.map((e=>e.sort_order)))+1:0}),Y({...W,options:t}),_(!f)},children:"Add Item"}):null]}),0!==W.category_id&&void 0!==W.category_id&&Object(g.jsx)("p",{className:"m-1 note",children:"Submit your changes before changing a new category."})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-12 mb-2",children:(null===(e=W.options)||void 0===e?void 0:e.length)>0&&Object(g.jsx)(ai.a,{items:W.options,renderItem:e=>{return Object(g.jsx)("div",{style:ce,children:Object(g.jsxs)("div",{className:"d-flex form-group mb-0",children:[Object(g.jsx)("div",{className:"w-100 pr-0",children:Object(g.jsx)("input",{type:"text",title:"itemskus",className:"form-control col-md-12",placeholder:"Enter Child Sku",onChange:(t=e.item.value,e=>{const s=[...W.options],a=s.findIndex((e=>e.value===t));s[a]={parentid:W.category_id,id:a,value:e.target.value.trim(),sort_order:void 0!==s[a].sort_order?s[a].sort_order:0};const c=Object.groupBy(s,(e=>{let{parentid:t}=e;return t})),r=[];for(const t in c){const e=c[t],s=[];for(const t in e)s.push(e[t].value);r.push({categoryid:t,products:s})}if(0!==r.length&&(u({...n,skus:r}),Y({...W,options:s})),0!==r.length&&void 0!==j.id){const e=n.products_skus.map((e=>e[0].categoryid===r[0].categoryid)).findIndex((e=>e));-1!==e?n.products_skus[e][0].products=r[0].products:n.products_skus.push(r)}else if(0!==r.length){const e=n.products_skus.map((e=>e[0].categoryid===r[0].categoryid)).findIndex((e=>e));-1!==e?n.products_skus[e][0].products=r[0].products:n.products_skus.push(r)}_(!f)}),value:e.item.value})}),Object(g.jsx)("div",{className:"col-auto pl-2 pr-0",children:Object(g.jsx)("button",{className:"btn btn-danger input-btn btn-block",onClick:re(e.item.id),children:"X"})})]})});var t},onChange:e=>{const t=[];if(e.items.map(((e,s)=>(t.push({option_id:e.id,value:e.value,sort_order:s}),!0))),Y({...W,options:t}),null!==j.id){const e={items:t};a.postApi(c.ChangeCategoryAttributeOrder,e).then((e=>{}))}},collapsed:!1,maxDepth:1})})})]})}),Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("div",{className:"form-group ",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",children:"Status"}),Object(g.jsx)("div",{children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:ee("status"),id:"EnableProduct",checked:W.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]}),Object(g.jsx)("div",{className:"best_seller"===y?"form-group mt-2 ":"row d-none",children:Object(g.jsx)("div",{id:"accordion",className:"custom-accordion",children:J.filter((e=>void 0!==e.category_name)).sort(((e,t)=>s.indexOf(e.category_name)-s.indexOf(t.category_name))).map(((e,t)=>Object(g.jsxs)("div",{className:"card shadow-none border-top",children:[Object(g.jsx)("a",{"data-toggle":"collapse","data-target":"#"+B,onClick:t=>(e=>{z(e)})(e.category_name),"aria-expanded":"true","aria-controls":"collapseOne",children:Object(g.jsxs)("div",{className:"card-header border-none",children:[Object(g.jsx)("label",{className:"mb-0",children:e.category_name}),Object(g.jsx)("i",{className:"mdi mdi-chevron-down fs-16 float-right"})]})}),Object(g.jsx)("div",{id:e.category_name,className:"collapse","aria-labelledby":"headingOne","data-parent":"#accordion",children:Object(g.jsxs)("table",{className:"table table-responsive",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{children:"Image"}),Object(g.jsx)("th",{children:"Product Name"}),Object(g.jsx)("th",{children:"Sku"}),Object(g.jsx)("th",{children:"Price"})]})}),Object(g.jsx)("tbody",{children:e.products.map(((e,t)=>Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("img",{src:e.base_image,alt:e.name})}),Object(g.jsx)("td",{children:e.name}),Object(g.jsx)("td",{children:e.sku}),Object(g.jsx)("td",{children:e.formated_price})]},t)))})]})})]},t)))})})]})]}),Object(g.jsx)("div",{className:"custom_html"===y?"row ":"row d-none",children:Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Content"}),Object(g.jsx)(to.a,{name:"content",value:W.content,options:{height:350,dialogsInBody:!0,toolbar:[["style",["style"]],["font",["bold","underline","clear","strikethrough","superscript","subscript"]],["fontname",["fontname"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview"]],["height",["height"]]]},onChange:e=>{(e=>{Y({...W,content:e}),_(!f)})(e)}})]})})}),Object(g.jsx)("div",{className:null!==j.id?"custom_html"===y||k!==W.template_id||"best_seller"===y?"row d-none":"row":"custom_html"===y||""===y?"row d-none":"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"table-responsive",children:["two_column"===y&&M<2||"one_column"===y&&M<1||"three_column"===y||"slider"===y||"best_seller"===y?Object(g.jsx)("button",{to:"/widgets/section-option/Add/",className:"btn btn-primary float-right mb-2",onClick:e=>{h.push({pathname:"/widgets/section-option/Add/",state:le})},children:"Add Option"}):null,0!==F.length?Object(g.jsx)(Ci.a,{columns:$,data:F,onSort:(e,t)=>{X({...Q,sort_column:e.sortField,sort_direction:t})},pagination:!0,paginationServer:!0,persistTableHead:!0,paginationTotalRows:E,paginationDefaultPage:U,onChangeRowsPerPage:e=>{q(1),X({...Q,page:1,page_size:e})},onChangePage:e=>{q(e),X({...Q,page:e})},sortServer:!0,subHeader:!0,progressPending:H,progressComponent:Object(g.jsx)(v,{}),subHeaderComponent:oe}):null]})})})})}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:e=>{var t;if(!x.current.allValid())return x.current.showMessages(),void _(!f);const s={custom:""};5===W.template_id?s.custom=JSON.stringify(n.products_skus):s.custom=W.content;const r={_id:W.id,_section_name:W.section_name,_sub_title:W.sub_title,_status:null!==(t=W.status)&&void 0!==t?t:0,_sort_order:""===W.sort_order?null:W.sort_order,_template_id:W.template_id,_custom:s.custom,_page:Q.page,_search:Q.search,_page_size:Q.page_size,_sort_column:Q.sort_column,_sort_direction:Q.sort_direction};V(!0),a.postApi(c.SetSection,r).then((e=>{if(V(!1),e.data.message){const t=e.data.message.invalidSkusString,s=e.data.message.duplicateSkusString;let a="";return t&&(a+="Invalid SKU(s): ".concat(t,"\n")),s&&(a+="Duplicate SKU(s): ".concat(s)),sc()({title:"Error",text:a.trim()}),gl.b.warning(e.data.message),_(!f),void te()}void 0!==j.id?(gl.b.success(l.sectionupdate),void 0!==k&&W.template_id!==k&&ie()):gl.b.success(l.sectionadd),_(!f),h.push("/widgets/section")}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/widgets/section",className:"btn btn-primary mr-2",children:"Cancel"})]})})]})})})})}),Object(g.jsx)("canvas",{ref:K,style:{display:"none"}})]})};var Vd=()=>Object(g.jsx)("div",{className:"content-wrapper pb-0",children:Object(g.jsx)("label",{children:"pages"})});var Kd=()=>{const e=Object(p.useParams)(),t=Object(p.useHistory)(),s=Object(p.useLocation)(),n=Object(d.useRef)(new ec.a({validators:{noDomain:{message:"Custom links cannot contain a domain.",rule:e=>!/^(https?:\/\/|www\.)/i.test(e),required:!0}}})),[o,m]=Object(d.useState)(!1),[u,j]=Object(d.useState)(!1),[h,x]=Object(d.useState)("invalid"),[O,N]=Object(d.useState)(!0),[f,_]=Object(d.useState)(!0),[y,w]=Object(d.useState)(!1),[k,S]=Object(d.useState)(""),[C,A]=Object(d.useState)(!0),[P,D]=Object(d.useState)(!0),[M,R]=Object(d.useState)(!1),[F,I]=Object(d.useState)([]),[E,L]=Object(d.useState)(!1),[G,T]=Object(d.useState)([]),[B,z]=Object(d.useState)(null),[U,q]=Object(d.useState)(null),[H,V]=Object(d.useState)({id:0,section_id:0,section_name:"",title:"",description:"",link_type:"",link:"",external_link:"",status:0,category_id:"",page_id:"",desktop_img:"",mobile_img:"",selectedCategoryId:"",selectedMenu:"",section_type:"",DesktopbtnX:"",DesktopbtnY:"",MobilebtnX:"",MobilebtnY:"",desk_btn_theme:"white",mob_btn_theme:"white"}),[K,W]=Object(d.useState)(null),[Y,Q]=Object(d.useState)(null),X=Object(d.useRef)(null),J=Object(d.useRef)(null);Object(d.useEffect)((()=>{if(document.title=r.AddSectionOption,m(!0),void 0!==e.id)document.title=r.EditSectionOption,ee();else{Z();const e=s.state.sid;V({...H,section_id:e}),setTimeout((()=>{ae(),se()}),2e3)}$()}),[e.id]);const Z=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.postApi(c.GetCategory,null).then((s=>{if(s.data.result){const a=s.data.result[0].filter((e=>1===e.parent_id&&e.status)),c=[];a.map((a=>{const r=s.data.result[0].filter((e=>e.parent_id===a.id&&e.status)),l=[];r.map((a=>{const c=s.data.result[0].filter((e=>e.parent_id===a.id&&e.status)),r=[];c.map((a=>{const c=s.data.result[0].filter((e=>e.parent_id===a.id&&e.status)),l=[];c.map((a=>{const c=s.data.result[0].filter((e=>e.parent_id===a.id&&e.status)),r=[];c.map((s=>{let a=!1;return(void 0!==e.id&&H.category_id===s.id||t===s.id)&&(a=!0),r.push({label:s.name,value:s.id,checked:a}),!0}));let n=!1;return(void 0!==e.id&&H.category_id===a.id||t===a.id)&&(n=!0),l.push({label:a.name,value:a.id,checked:n,children:r}),!0}));let n=!1;return(void 0!==e.id&&H.category_id===a.id||t===a.id)&&(n=!0),r.push({label:a.name,value:a.id,checked:n,children:l}),!0}));let n=!1;return(void 0!==e.id&&H.category_id===a.id||t===a.id)&&(n=!0),l.push({label:a.name,value:a.id,checked:n,children:r}),!0}));let n=!1;return(void 0!==e.id&&H.category_id===a.id||t===a.id)&&(n=!0),c.push({label:a.name,value:a.id,children:l,checked:n}),!0})),I(c)}}))},$=()=>{a.getApi(c.GetContentManagementList).then((e=>{T(e.data.result)}))},ee=()=>{const t={_id:e.id.split("&")[0],_section_id:e.id.split("&")[1]};a.postApi(c.GetSectionItemById,t).then((e=>{if(e.data.result){const t=e.data.result[0][0],s=t.desk_btn_x_position,a=t.desk_btn_y_position,c=t.mob_btn_x_position,r=t.mob_btn_y_position;V({...H,id:t.id,section_id:t.section_id,section_name:t.section_name,title:t.title,description:t.description,link_type:t.link_type,link:"custom_link"===t.link_type?t.link:0,external_link:"external_link"===t.link_type?t.link:0,status:t.status,page_id:t.page_id,desktop_img:t.desktop_image,mobile_img:t.mobile_image,selectedCategoryId:t.category_id,section_type:t.section_type,MobilebtnX:c,MobilebtnY:r,DesktopbtnX:s,DesktopbtnY:a,desk_btn_theme:null!==t.desk_btn_theme?t.desk_btn_theme:H.desk_btn_theme,mob_btn_theme:null!==t.mob_btn_theme?t.mob_btn_theme:H.mob_btn_theme}),W({xPercentDesk:s,yPercentDesk:a}),Q({xPercentMob:c,yPercentMob:r}),Z(t.category_id),""!==t.desktop_image?ae(t.desktop_image):ae(),""!==t.mobile_image?se(t.mobile_image):se()}}))},te=e=>t=>{V("status"===e?{...H,[e]:t.target.checked}:{...H,[e]:t.target.value}),j(!u)},se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("mobile_image",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),A(!0)):new ti.a("mobile_image",{text:{chooseFile:"Choose Image..."}})},ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""!==e&&null!==e?(new ti.a("desktop_image",{text:{chooseFile:"Choose Image..."},presetFiles:[e]}),N(!0)):new ti.a("desktop_image",{text:{chooseFile:"Choose Image..."}})};window.addEventListener("fileUploadWithPreview:imagesAdded",(function(e){if("desktop_image"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{x(e)})),N(!0),_(!0),w(!1)):(w(!0),N(!0),x("")):(x(""),N(!0),_(!1),w(!1))}else if("mobile_image"===e.detail.uploadId){const t=e.detail.cachedFileArray[0].type,s=e.detail.cachedFileArray[0].size;"image/jpeg"===t||"image/jpg"===t||"image/png"===t||"image/webp"===t?s<=2097152?(ao(e.detail.cachedFileArray[0],(e=>{S(e)})),A(!0),D(!0),R(!1)):R(!0):(S(""),A(!0),D(!1))}})),window.addEventListener("fileUploadWithPreview:clearButtonClicked",(function(e){"desktop_image"===e.detail.uploadId?(x(""),_(!0),w(!1),N(!1)):"mobile_image"===e.detail.uploadId&&(S(""),D(!0),R(!1))}));return!o||E?Object(g.jsx)(v,{}):Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title mb-0",children:[void 0!==e.id?r.EditSectionOption:r.AddSectionOption," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:t.goBack,children:"Back"})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("form",{className:"forms-sample",autoComplete:"off",children:[Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Title"}),Object(g.jsx)("input",{type:"text",maxLength:"255",className:"form-control",name:"title",onChange:te("title"),onKeyUp:te("title"),onBlur:()=>n.showMessageFor("title"),value:H.title,placeholder:"Title"}),n.current.message("Title",H.title,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"one_column"===H.section_type||"two_column"===H.section_type?"Button Text":"Description"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"Button Text",onChange:te("description"),value:H.description,placeholder:"one_column"===H.section_type||"two_column"===H.section_type?"Button Text":"Description"})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Link Type"}),Object(g.jsxs)("select",{className:"form-control",name:"link_type",onChange:e=>{V({...H,link_type:e.target.value}),"category"===e.target.value?V({...H,page_id:""===H.page_id?0:H.page_id,link:""===H.link?0:H.link,selectedCategoryId:0===H.selectedCategoryId?"":H.selectedCategoryId,external_link:""===H.external_link?0:H.external_link,link_type:e.target.value}):"page"===e.target.value?V({...H,link:""===H.link?0:H.link,selectedCategoryId:""===H.selectedCategoryId?0:H.selectedCategoryId,external_link:""===H.external_link?0:H.external_link,page_id:0===H.page_id?"":H.page_id,link_type:e.target.value}):"custom_link"===e.target.value?V({...H,page_id:""===H.page_id?0:H.page_id,selectedCategoryId:""===H.selectedCategoryId?0:H.selectedCategoryId,link:0===H.link?"":H.link,link_type:e.target.value,external_link:""===H.external_link?0:H.external_link}):"blank"===e.target.value?V({...H,page_id:0,selectedCategoryId:0,link:0,link_type:e.target.value,external_link:0}):"external_link"===e.target.value&&V({...H,page_id:""===H.page_id?0:H.page_id,selectedCategoryId:""===H.selectedCategoryId?0:H.selectedCategoryId,external_link:0===H.external_link?"":H.external_link,link:""===H.link?0:H.link,link_type:e.target.value}),j(!u)},value:H.link_type,children:[Object(g.jsx)("option",{value:"",children:"Select"}),Object(g.jsx)("option",{value:"category",children:"Category"}),Object(g.jsx)("option",{value:"page",children:"Page"}),Object(g.jsx)("option",{value:"custom_link",children:"Custom Link"}),Object(g.jsx)("option",{value:"external_link",children:"External link"}),Object(g.jsx)("option",{value:"blank",children:"Blank"})]}),n.current.message("Menu Type",H.link_type,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",style:"category"===H.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Category"}),F.length>0&&Object(g.jsx)(ei.a,{placeholder:"Choose",multi:!1,data:F,onChange:(e,t)=>{t.length>0?(V({...H,selectedCategoryId:t[0].value}),H.selectedCategoryId=H.category_id=t[0].value):V({...H,selectedCategoryId:""}),F.map(((e,t)=>(e.value===H.category_id?F[t].checked=!0:F[t].checked=!1,e.children&&e.children.map(((e,s)=>(e.value===H.category_id?F[t].children[s].checked=!0:F[t].children[s].checked=!1,e.children&&e.children.map(((e,a)=>(e.value===H.category_id?F[t].children[s].children[a].checked=!0:F[t].children[s].children[a].checked=!1,e.children&&e.children.map(((e,c)=>(e.value===H.category_id?F[t].children[s].children[a].children[c].checked=!0:F[t].children[s].children[a].children[c].checked=!1,!0))),!0))),!0))),!0)))},mode:"radioSelect",className:"bootstrap-demo w-100"}),Object(g.jsx)("input",{type:"hidden",className:"form-control",name:"category",onBlur:()=>n.current.showMessageFor("category"),value:H.selectedCategoryId})," ",n.current.message("Category",H.selectedCategoryId,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",style:"page"===H.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Page"}),Object(g.jsxs)("select",{className:"form-control",name:"page_id",onChange:te("page_id"),onBlur:()=>n.current.showMessageFor("page"),value:H.page_id,children:[Object(g.jsx)("option",{value:"",children:"select"},""),G.map((e=>Object(g.jsx)("option",{value:e.id,children:e.title},e.id)))]}),n.current.message("Page",H.page_id,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",style:"custom_link"===H.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[" ",Object(g.jsx)("label",{children:"Custom Link"})," ",Object(g.jsx)("input",{type:"text",className:"form-control",name:"link",onChange:te("link"),onBlur:()=>n.current.showMessageFor("link"),value:H.link,placeholder:"Custom Link"}),Object(g.jsxs)("label",{style:{color:"#505050"},className:"note mt-1",children:[" ",'(Do not include "https://www.example.com/" in link.)']}),n.current.message("Custom Link",H.link,"required|noDomain",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",style:"external_link"===H.link_type?{}:{display:"none"},children:Object(g.jsxs)("div",{className:"form-group",children:[" ",Object(g.jsx)("label",{children:"External Link"}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"external_link",onChange:te("external_link"),onBlur:()=>n.current.showMessageFor("external_link"),value:H.external_link,placeholder:"External Link"}),n.current.message("External Link",H.external_link,"required",{className:"error"})]})}),Object(g.jsx)("div",{className:"col-md-6",style:"blank"===H.link_type||""===H.link_type?{}:{display:"none"},children:Object(g.jsx)("div",{className:"form-group"})})]}),Object(g.jsxs)("div",{children:[Object(g.jsx)("div",{className:"form-group mb-0",children:Object(g.jsx)("label",{children:"Image"})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col",children:[Object(g.jsxs)("label",{className:"note",children:["Note:","For One Column size must be 1920(Width) X Auto(Height) pixels"]}),Object(g.jsxs)("label",{className:"note ml-1",children:[" "," and for Two Column size must be 900(Width) X Auto(Height) pixels."]}),Object(g.jsxs)("div",{className:"custom-file-container mb-5","data-upload-id":"desktop_image",children:[Object(g.jsx)("label",{children:"Desktop Image"}),Object(g.jsxs)("label",{className:"note ml-1",children:[" ","(Only PNG, JPEG, JPG format allowed.)"]})]}),Object(g.jsx)("div",{style:f?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:y?{}:{display:"none"},className:"error pt-0 pb-2",children:"File size shouldn't be greater than 2MB."}),Object(g.jsx)("div",{style:O?{display:"none"}:{},className:"error pt-2 pb-4",children:"Desktop Image is required."})]}),Object(g.jsxs)("div",{className:"col",children:[Object(g.jsxs)("label",{className:"note",children:["Note:","For One Column or Two Column size must be 767(Width) X Auto(Height) pixels"]}),Object(g.jsxs)("div",{className:"custom-file-container mb-5","data-upload-id":"mobile_image",children:[Object(g.jsx)("label",{children:"Mobile Image"}),Object(g.jsxs)("label",{className:"note ml-1",children:[" ","(Only PNG, JPEG, JPG format allowed.)"]})]}),Object(g.jsx)("div",{style:C?{display:"none"}:{display:"block"},children:Object(g.jsx)("small",{className:"error",children:"Image is required."})}),Object(g.jsx)("div",{style:P?{display:"none"}:{},className:"error pt-2 pb-4",children:l.formatnotsupport}),Object(g.jsx)("div",{style:M?{}:{display:"none"},className:"error pt-0 pb-2",children:"File size shouldn't be greater than 2MB."})]})]}),"one_column"===H.section_type||"two_column"===H.section_type?Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 d-none",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Desktop Button Theme"}),Object(g.jsxs)("select",{className:"form-control",name:"desk_btn_theme",onChange:te("desk_btn_theme"),value:H.desk_btn_theme,children:[Object(g.jsx)("option",{value:"black",children:"Black"}),Object(g.jsx)("option",{value:"white",children:"White"}),Object(g.jsx)("option",{value:"theme_color",children:"Theme color"})]})]})}),Object(g.jsx)("div",{className:"col-md-6 d-none",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{children:"Mobile Button Theme"}),Object(g.jsxs)("select",{className:"form-control",name:"mob_btn_theme",onChange:te("mob_btn_theme"),value:H.mob_btn_theme,children:[Object(g.jsx)("option",{value:"black",children:"Black"}),Object(g.jsx)("option",{value:"white",children:"White"}),Object(g.jsx)("option",{value:"theme_color",children:"Theme color"})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Set Desktop Button Position"}),Object(g.jsxs)("div",{className:"mt-1 px-3",style:{position:"relative",display:"inline-block"},children:[Object(g.jsx)("img",{src:""!==h?h:i.setImage("assets/images/icon/place_holder_1.jpg"),ref:X,onClick:e=>{const t=X.current.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*100,a=(e.clientY-t.top)/t.height*100;W({xPercentDesk:s,yPercentDesk:a}),V({...H,DesktopbtnX:s,DesktopbtnY:a})},onMouseMove:e=>{const t=X.current.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*100,a=(e.clientY-t.top)/t.height*100;z({xPercent:s,yPercent:a,buttonNumber:1})},onMouseLeave:()=>{z(null)},style:{width:"100%",cursor:"crosshair"}}),B&&Object(g.jsx)("div",{style:{position:"absolute",top:"".concat(B.yPercent,"%"),left:"".concat(B.xPercent,"%"),transform:"translate(-50%, -50%)",backgroundColor:"#FFD700",color:"#000",padding:"6px 10px",borderRadius:"5px",fontSize:"11px",fontWeight:"bold",zIndex:5,pointerEvents:"none"},children:"Button"}),K&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(K.yPercentDesk,"%"),left:"".concat(K.xPercentDesk,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{fontSize:"10px"},onClick:()=>{W(null)},title:"Click to remove",children:H.description}),Object(g.jsx)("div",{style:{fontSize:"10px",background:"#FFD700",padding:"2px 6px",borderRadius:"4px",marginTop:"2px"},children:"Button"})]})]})]})}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Set Mobile Button Position"}),Object(g.jsxs)("div",{className:"mt-1 px-3",style:{position:"relative",display:"inline-block"},children:[Object(g.jsx)("img",{src:""!==k?k:i.setImage("assets/images/icon/place_holder_1.jpg"),ref:J,onClick:e=>{const t=J.current.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*100,a=(e.clientY-t.top)/t.height*100;Q({xPercentMob:s,yPercentMob:a}),V({...H,MobilebtnX:s,MobilebtnY:a})},onMouseMove:e=>{const t=J.current.getBoundingClientRect(),s=(e.clientX-t.left)/t.width*100,a=(e.clientY-t.top)/t.height*100;q({xPercent:s,yPercent:a,buttonNumber:1})},onMouseLeave:()=>{q(null)},style:{width:"100%",cursor:"crosshair"}}),U&&Object(g.jsx)("div",{style:{position:"absolute",top:"".concat(U.yPercent,"%"),left:"".concat(U.xPercent,"%"),transform:"translate(-50%, -50%)",backgroundColor:"#FFD700",color:"#000",padding:"6px 10px",borderRadius:"5px",fontSize:"11px",fontWeight:"bold",zIndex:5,pointerEvents:"none"},children:"Button"}),Y&&Object(g.jsxs)("div",{style:{position:"absolute",top:"".concat(Y.yPercentMob,"%"),left:"".concat(Y.xPercentMob,"%"),transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center"},children:[Object(g.jsx)("button",{type:"button",className:"btn btn-dark btn-sm",style:{fontSize:"10px"},onClick:()=>{Q(null)},title:"Click to remove",children:H.description}),Object(g.jsx)("div",{style:{fontSize:"10px",background:"#FFD700",padding:"2px 6px",borderRadius:"4px",marginTop:"2px"},children:"Button"})]})]})]})})]}):Object(g.jsx)(g.Fragment,{}),Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsxs)("div",{className:"form-group row",children:[Object(g.jsx)("label",{htmlFor:"exampleInputUsername2",className:"col-sm-12",children:"Status"}),Object(g.jsx)("div",{className:"col-sm-12",children:Object(g.jsxs)("div",{className:"custom-control custom-switch mt-1",children:[Object(g.jsx)("input",{type:"checkbox",className:"custom-control-input",name:"status",onChange:te("status"),id:"EnableProduct",checked:H.status}),Object(g.jsx)("label",{className:"custom-control-label",htmlFor:"EnableProduct",children:" "})]})})]})})]}),Object(g.jsx)("div",{className:"row mt-3",children:Object(g.jsxs)("div",{className:"col-md-6",children:[Object(g.jsxs)("button",{type:"button",onClick:s=>{if("invalid"===h&&N(!1),!n.current.allValid()||"invalid"===h||!1===O||!0===y||!1===f)return n.current.showMessages(),void j(!u);const r={_id:H.id,_section_id:H.section_id,_section_name:H.section_name,_description:H.description,_link:"custom_link"===H.link_type?0===H.link?"":H.link:"external_link"===H.link_type?0===H.external_link?"":H.external_link:H.link,_link_type:H.link_type,_title:H.title,_status:H.status,_category_id:H.selectedCategoryId,_page_id:H.page_id,_desktop_img:h,_mobile_img:k,_desk_btn_theme:H.desk_btn_theme,_mob_btn_theme:H.mob_btn_theme,_desk_btnX:H.DesktopbtnX,_desk_btnY:H.DesktopbtnY,_mob_btnX:H.MobilebtnX,_mob_btnY:H.MobilebtnY};L(!0),a.postApi(c.SetSectionItem,r).then((s=>{if(L(!1),s.data.message)return gl.b.warning(s.data.message),void j(!u);void 0!==e.id?gl.b.success(l.section_option_add):gl.b.success(l.section_update),j(!u),t.push("/widgets/section/edit/"+H.section_id)}))},className:"btn btn-custom text-white mr-2",children:[" ","Submit"," "]}),Object(g.jsx)(b.b,{to:"/widgets/section/edit/"+H.section_id,className:"btn btn-primary mr-2",children:"Cancel"})]})})]})})})})})]})},Wd=s(93);var Yd=()=>{const e=Object(Wd.useLocation)(),[t,s]=Object(d.useState)(null);Object(d.useEffect)((()=>{const t=new URLSearchParams(e.search).get("code");t?async function(e){const t={code:e};a.postApi(c.GenerateAccessToken,t).then((e=>(e.data.result&&r(e.data.result.expires_in),!0)))}(t):window.location.href="https://www.dropbox.com/oauth2/authorize?client_id=rvaq0ic0369pr9r&response_type=code&redirect_uri=http://localhost:3000&token_access_type=offline"}),[]);const r=e=>{const a=Date.now()+1e3*e;localStorage.setItem("tokenExpiration",a),s(new Date(a).toLocaleString()),console.log(t)};return Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("h1",{children:["DropBoxImageSync",e.search]})})};var Qd=()=>{var e,t,s,l,n,m,u,j;const b=Object(Wd.useLocation)(),[p,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)(!0),[N,f]=Object(d.useState)(!1),[_,y]=Object(d.useState)(!1),[w,k]=Object(d.useState)(),[S,C]=Object(d.useState)([]),[A,P]=Object(d.useState)(b.state?0===parseInt(b.state.state.page)?1:parseInt(b.state.state.page):1);console.log(b.state);const D={ordernumber:void 0!==(null===(e=b.state)||void 0===e||null===(t=e.state)||void 0===t?void 0:t.ordernumber)?b.state.state.ordernumber:"",email:void 0!==(null===(s=b.state)||void 0===s||null===(l=s.state)||void 0===l?void 0:l.email)?b.state.state.email:"",orderfromdate:void 0!==(null===(n=b.state)||void 0===n||null===(m=n.state)||void 0===m?void 0:m.orderfromdate)?new Date(b.state.state.orderfromdate):"",ordertodate:void 0!==(null===(u=b.state)||void 0===u||null===(j=u.state)||void 0===j?void 0:j.ordertodate)?new Date(b.state.state.ordertodate):"",page:A,page_size:10},[M,R]=Object(d.useState)(D),F=[{name:"Inquiry Number",selector:e=>e.order_number,wrap:!0},{name:"Email",selector:e=>e.email,wrap:!0},{name:"Total",selector:e=>e.symbol+e.order_total},{name:"Item(s)",selector:e=>e.qty},{name:"Inquiry Date",selector:e=>Object(g.jsx)(Zn,{value:e.order_date}),wrap:!0},{name:"Action",selector:e=>Object(g.jsx)("div",{className:"action-btn",children:Object(g.jsxs)(Wd.Link,{to:"/inquiry/view/inquiry_id/"+e.order_number+"?page="+M.page+"&ordernumber="+M.ordernumber+"&email="+M.email+"&orderfromdate="+M.orderfromdate+"&ordertodate="+M.ordertodate,className:"text-dark",title:"View",children:[Object(g.jsx)("i",{className:"mdi mdi-eye","aria-hidden":"true"})," "]})})}];Object(d.useEffect)((()=>{i.validatePermission(o.Sales)||history.push("/"),h(!0),f(!N),document.title=r.OrderInquiry,I()}),[M]);const I=()=>{const e={ordernumber:M.ordernumber,email:M.email,orderfromdate:M.orderfromdate,ordertodate:M.ordertodate,page:M.page,page_size:M.page_size};O(!0),a.postApi(c.GetInquiryAdminLists,e).then((e=>{try{O(!1);const t=e.data.result[1];C(t),k(e.data.result[0][0].total_row),f(!N)}catch(t){O(!1),console.log(t)}}))},E=(e,t)=>{"orderdate"===t?null!==e.value?(Object.assign(M,{orderfromdate:e.value[0]}),Object.assign(M,{ordertodate:e.value[1]})):(Object.assign(M,{orderfromdate:""}),Object.assign(M,{ordertodate:""})):M[t]=e.target.value,f(!N)};return p?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.OrderInquiry," "]}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsxs)(Wd.Link,{to:"#",onClick:()=>{y(!_)},className:"btn btn-primary btn-fw rounded filter-btn mr-2",children:[" ","Filters"," "]})})]}),Object(g.jsx)("div",{className:_?"filter-bar d-block":"filter-bar",id:"filter-bar",children:Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Inquiry Number"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:e=>E(e,"ordernumber"),value:M.ordernumber})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Email"})}),Object(g.jsx)("input",{type:"text",className:"form-control",onChange:e=>E(e,"email"),value:M.email})]})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-3",children:Object(g.jsxs)("div",{className:"form-group",children:[Object(g.jsx)("label",{htmlFor:"exampleInputEmail1",children:Object(g.jsx)("strong",{children:"Inquiry Date"})}),Object(g.jsx)(nd.a,{onChange:e=>E(e,"orderdate"),value:[M.orderfromdate,M.ordertodate]})]})}),Object(g.jsxs)("div",{className:"col-md-6 col-lg-3 mt-1 pt-3 text-left",children:[Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)(Wd.Link,{to:"#",className:"btn btn-dark btn-fw-130 rounded mr-2",onClick:e=>I(e),children:[" ","Apply"," "]})}),Object(g.jsx)("div",{className:"btn-group ml-auto",children:Object(g.jsx)("span",{className:"filter-result-repeat",children:Object(g.jsx)(Wd.Link,{children:Object(g.jsx)("button",{className:"btn btn-primary btn-fw-130 rounded mr-2",onClick:()=>{R(D),f(!N)},children:"Reset"})})})})]})]})})})})}),Object(g.jsx)("div",{className:"grid-margin w-100 stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:F,data:S,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:w,onChangeRowsPerPage:e=>{P(1),R({...M,page:1,page_size:e})},onChangePage:e=>{P(e),R({...M,page:e})},responsive:!0,progressPending:x,paginationDefaultPage:A,progressComponent:Object(g.jsx)(v,{})})})})})})]}):Object(g.jsx)(v,{})};var Xd=()=>{const e=Object(Wd.useParams)(),t=Object(Wd.useLocation)(),s=new URLSearchParams(t.search),l=s.get("ordernumber"),n=s.get("email"),m=s.get("orderfromdate"),u=s.get("ordertodate"),j=s.get("page"),b=Object(Wd.useHistory)(),[p,h]=Object(d.useState)(!1),[x,O]=Object(d.useState)(!1),[N,f]=Object(d.useState)([]),[_,y]=Object(d.useState)([]);Object(d.useEffect)((()=>{i.validatePermission(o.Products)||b.push("/"),h(!0),O(!x),document.title=r.InquiryDetails,w()}),[e.id]);const w=()=>{const t={OrderNumber:e.id};a.postApi(c.GetInquiryDetails,t).then((e=>{f(e.data.result[0][0]),y(e.data.result[0][0].products)}))};return p?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsxs)("div",{className:"page-header",children:[Object(g.jsxs)("h3",{className:"page-title",children:[r.InquiryDetails," "]}),Object(g.jsx)("div",{className:"btn-group",children:Object(g.jsxs)("button",{type:"button",className:"btn btn-dark btn-fw rounded mr-2",onClick:()=>{b.push("/sales/inquiry",{state:{page:0===parseInt(j)?1:parseInt(j),ordernumber:l,ordertodate:u,email:n,orderfromdate:m}})},children:[" ","Back"," "]})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Inquiry & Account Information"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsxs)("h4",{children:["Inquiry ",N.order_number]}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsx)("tbody",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Inquiry Date"}),Object(g.jsx)("td",{className:"text-right",children:Object(g.jsx)(Zn,{value:N.created_at})})]})})})]})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Account Information"}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Customer Name"}),Object(g.jsxs)("td",{className:"text-right",children:[N.firstname," ",N.lastname]})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Email"}),Object(g.jsx)("td",{className:"text-right",children:Object(g.jsx)("a",{href:"mailto:"+N.email,children:N.email})})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"text-left",children:"Phone"}),Object(g.jsx)("td",{className:"text-right",children:N.contact_number})]})]})})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Address Information"})})}),Object(g.jsx)("div",{className:"col-md-5",children:Object(g.jsxs)("div",{className:"address-info",children:[Object(g.jsx)("h4",{children:"Billing Address "}),Object(g.jsxs)("p",{children:[N.firstname," ",N.lastname,Object(g.jsx)("br",{}),N.street," ",N.country,Object(g.jsx)("br",{}),"Pin code :",N.postcode,Object(g.jsx)("br",{})]})]})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"row justify-content-between",children:[Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Items Inquired"})})}),Object(g.jsx)("div",{className:"col-md-12",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsxs)("table",{className:"table text-center",children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{children:"Product"}),Object(g.jsx)("th",{children:"Size"}),Object(g.jsx)("th",{children:"Model"}),Object(g.jsx)("th",{children:"SKU/Certificate"}),Object(g.jsx)("th",{children:"System SKU"}),Object(g.jsx)("th",{children:"Price"}),Object(g.jsx)("th",{children:"Qty"}),Object(g.jsx)("th",{children:"Product Discount"}),Object(g.jsx)("th",{children:"Total"})]})}),Object(g.jsx)("tbody",{children:null===_||void 0===_?void 0:_.map(((e,t)=>{var s,a;return Object(g.jsxs)("tr",{children:[Object(g.jsxs)("td",{children:[e.name,null!==e.vendor?Object(g.jsxs)("span",{children:[" ( Vendor : "," ",Object(g.jsxs)("b",{children:[" ",e.vendor," "]}),")"]}):Object(g.jsx)(g.Fragment,{}),Object(g.jsx)("br",{}),e.is_diamond?"":Object(g.jsx)(g.Fragment,{children:Object(g.jsx)(g.Fragment,{children:JSON.parse(e.product_options).filter((e=>1===e.show_in_storefront)).map(((e,t,s)=>Object(g.jsxs)("span",{children:[e.title,": ",Object(g.jsx)("b",{children:e.value}),t!==s.length-1&&(t+1)%3!==0&&", ",(t+1)%3===0&&Object(g.jsx)("br",{})]},t)))})})]}),Object(g.jsx)("td",{children:0===e.is_diamond&&0!==e.size?e.size:"-"}),Object(g.jsx)("td",{children:e.parent_sku?e.parent_sku:"-"}),Object(g.jsxs)("td",{children:[" ",0!==e.is_diamond?null===(s=JSON.parse(e.product_options))||void 0===s||null===(a=s.filter((e=>"Certificate"===e.title))[0])||void 0===a?void 0:a.value:e.model_number,Object(g.jsx)("br",{})]}),Object(g.jsx)("td",{children:e.sku}),Object(g.jsxs)("td",{children:[N.symbol," ",e.price]}),Object(g.jsx)("td",{children:e.qty}),Object(g.jsxs)("td",{children:[N.symbol,e.discount_amount]}),Object(g.jsxs)("td",{children:[N.symbol,e.final_price]})]},t)}))})]})})})]})})})})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsxs)("div",{className:"card-body",children:[Object(g.jsx)("div",{className:"card-header p-0 pb-2 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Inquiry Total"})}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-md-6",children:Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("div",{className:"col-md-12 pl-0",children:Object(g.jsx)("div",{className:"address-info",children:Object(g.jsxs)("table",{className:"table table-striped table-borderless",children:[Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Subtotal"}),Object(g.jsx)("th",{className:"text-right",children:N.subtotal})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{className:"border-bottom text-left",children:"Coupon Discount"}),Object(g.jsxs)("td",{className:"text-right border-bottom",children:[N.symbol,N.discount_amount]})]})]}),Object(g.jsx)("tfoot",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"text-left",children:"Grand Total"}),Object(g.jsx)("th",{className:"text-right",children:N.formated_order_total})]})})]})})})})})})]})})})})]}):Object(g.jsx)(v,{})};var Jd=()=>{const[e,t]=Object(d.useState)(!1),[s,l]=Object(d.useState)(!1),[n,i]=Object(d.useState)(1),[o,u]=Object(d.useState)(!1),[j,b]=Object(d.useState)(""),[p,h]=Object(d.useState)(0),[x,O]=Object(d.useState)([]),[N,f]=Object(d.useState)({page_visit:0,form_submitted:0,conversion_rate:0}),[_,y]=Object(d.useState)({page:1,page_size:10,sort_column:"",sort_direction:""});Object(d.useEffect)((()=>{l(!0),document.title=r.AppointmentQRStatistics,w()}),[_,j]);const w=()=>{const e={page:_.page,search:j,page_size:_.page_size,sort_column:_.sort_column,sort_direction:_.sort_direction};t(!0),a.postApi(c.GetAppointmentQRStatisticsList,e).then((e=>{if(t(!1),!0===e.data.status&&""!==e.data.result){const t=e.data.result;console.log("LN 143 GetAppointmentQRList ",t),u(!o),h(e.data.result[0][0].total),f({page_visit:e.data.result[2][0].total_visits,form_submitted:e.data.result[2][0].submitted,conversion_rate:e.data.result[2][0].conversion_rate}),O(e.data.result[1])}else h(0),O([])}))},k=[{name:"IP Address",selector:e=>{var t;return(null===(t=e.ip_address)||void 0===t?void 0:t.replace("::ffff:",""))||"-"},sortable:!0,sortField:"ip_address"},{name:"Source",selector:e=>e.source||"-",sortable:!0,sortField:"source"},{name:"Campaign",selector:e=>e.campaign||"-",sortable:!0,sortField:"campaign"},{name:"Country",selector:e=>e.country||"-",sortable:!0,sortField:"country"},{name:"User Device",selector:e=>e.user_agent?/mobile/i.test(e.user_agent)?"Mobile":/tablet|ipad/i.test(e.user_agent)?"Tablet":"Desktop":"-"},{name:"Form Submitted",selector:e=>1===e.is_submitted?Object(g.jsx)("span",{className:"badge bg-primary",children:"Yes"}):Object(g.jsx)("span",{className:"badge bg-primary",children:"No"}),sortable:!0,sortField:"is_submitted"},{name:"Created At",selector:e=>Object(g.jsx)(Zn,{value:e.created_at}),sortable:!0,sortField:"created_at"}],S=m.a.useMemo((()=>Object(g.jsx)("input",{type:"text",title:"Search For Title",className:"form-control col-md-3",placeholder:"Search",onChange:e=>setTimeout((()=>{b(e.target.value)}),1e3)})));return s?Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsxs)("h3",{className:"page-title",children:[" ",r.AppointmentQRStatistics," "]})}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Page Visit"})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsx)("tbody",{children:Object(g.jsx)("tr",{children:Object(g.jsx)("td",{className:"w-75",children:N.page_visit})})})})]})})})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Form Submitted"})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsx)("tbody",{children:Object(g.jsx)("tr",{children:Object(g.jsx)("td",{className:"w-75",children:N.form_submitted})})})})]})})})}),Object(g.jsx)("div",{className:"col-md-6 col-lg-4 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsxs)("div",{className:"w-100",children:[Object(g.jsx)("div",{className:"card-header p-0 mb-3",children:Object(g.jsx)("h3",{className:"title font-20",children:"Conversion Rate"})}),Object(g.jsx)("table",{className:"table table-striped table-borderless",children:Object(g.jsx)("tbody",{children:Object(g.jsx)("tr",{children:Object(g.jsxs)("td",{className:"w-75",children:[N.conversion_rate,"%"]})})})})]})})})})]}),Object(g.jsx)("div",{className:"row",children:Object(g.jsx)("div",{className:"col-lg-12 grid-margin stretch-card",children:Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("div",{className:"table-responsive",children:Object(g.jsx)(Ci.a,{columns:k,data:x,pagination:!0,persistTableHead:!0,paginationServer:!0,paginationTotalRows:p,onChangeRowsPerPage:e=>{i(1),y({..._,page:1,page_size:e})},onChangePage:e=>{i(e),y({..._,page:e})},subHeader:!0,onSort:(e,t)=>{y({..._,sort_column:e.sortField,sort_direction:t})},progressPending:e,progressComponent:Object(g.jsx)(v,{}),paginationDefaultPage:n,subHeaderComponent:S})})})})})})]}):Object(g.jsx)(v,{})};var Zd=()=>Object(g.jsxs)("div",{className:"content-wrapper pb-0",children:[Object(g.jsx)("div",{className:"page-header",children:Object(g.jsx)("h3",{className:"page-title",children:" Analytics "})}),Object(g.jsx)("div",{className:"card",children:Object(g.jsx)("div",{className:"card-body",children:Object(g.jsx)("iframe",{className:"d-block",width:"100%",height:"650px",src:"https://lookerstudio.google.com/embed/reporting/53adf2c3-b0ef-4d64-9c37-35076650df13/",style:{border:0},allowFullScreen:!0,title:"Looker Studio Report"})})})]});var $d=()=>Object(g.jsx)("div",{children:Object(g.jsxs)(p.Switch,{children:[Object(g.jsx)(p.Route,{exact:!0,path:"/dashboard",component:lo}),Object(g.jsx)(p.Route,{path:"/sales/orders",component:id}),Object(g.jsx)(p.Route,{exact:!0,path:"/sales/inquiry",component:Qd}),Object(g.jsx)(p.Route,{exact:!0,path:"/dropboximagesync",component:Yd}),Object(g.jsx)(p.Route,{exact:!0,path:"/report/link-statistics",component:Md}),Object(g.jsx)(p.Route,{exact:!0,path:"/report/searchterm",component:zd}),Object(g.jsx)(p.Route,{exact:!0,path:"/report/appointment-qr-statistics",component:Jd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondshape",component:no}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondshape/add",component:io}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondshape/edit/:id",component:io}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondquality",component:Oo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondquality/add",component:go}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondquality/edit/:id",component:go}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondmarkup",component:oo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondmarkup/add",component:uo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/diamondmarkup/edit/:id",component:uo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/metal",component:jo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/metal/edit/:id",component:bo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/metalquality",component:ho}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/metalquality/add",component:xo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/metalquality/edit/:id",component:xo}),Object(g.jsx)(p.Route,{exact:!0,path:"/products/add",component:So}),Object(g.jsx)(p.Route,{exact:!0,path:"/products/importexcel",component:Po}),Object(g.jsx)(p.Route,{exact:!0,path:"/products/updateprice",component:Do}),Object(g.jsx)(p.Route,{exact:!0,path:"/products/edit/:id",component:So}),Object(g.jsx)(p.Route,{exact:!0,path:"/products",component:yo}),Object(g.jsx)(p.Route,{exact:!0,path:"/diamonds?type=:type",component:ld}),Object(g.jsx)(p.Route,{exact:!0,path:"/coupons",component:dd}),Object(g.jsx)(p.Route,{exact:!0,path:"/coupons/add",component:md}),Object(g.jsx)(p.Route,{exact:!0,path:"/coupons/edit/:id",component:md}),Object(g.jsx)(p.Route,{exact:!0,path:"/order/view/order_id/:id",component:od}),Object(g.jsx)(p.Route,{exact:!0,path:"/inquiry/view/inquiry_id/:id",component:Xd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/productsize",component:Mo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/productsize/add",component:Ro}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/productsize/edit/:id",component:Ro}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/shippingrate",component:vo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/shippingrate/add",component:No}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/shippingrate/edit/:id",component:No}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/settings",component:vd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/settings/edit/:id",component:Nd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/settings/add",component:Nd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/settings/instagram",component:gd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/settings/instagram/auth",component:gd}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/nivoda-logs",component:Ad}),Object(g.jsx)(p.Route,{exact:!0,path:"/categories",component:Fo}),Object(g.jsx)(p.Route,{exact:!0,path:"/categories/add",component:zo}),Object(g.jsx)(p.Route,{exact:!0,path:"/categories/edit/:id",component:zo}),Object(g.jsx)(p.Route,{exact:!0,path:"/contentManagement",component:Uo}),Object(g.jsx)(p.Route,{exact:!0,path:"/contentManagement/add",component:Ho}),Object(g.jsx)(p.Route,{exact:!0,path:"/contentManagement/edit/:id",component:Ho}),Object(g.jsx)(p.Route,{exact:!0,path:"/cacheManagement",component:qo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/navigation-menu",component:Vo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/navigation-menu/edit/:id",component:Vo}),Object(g.jsx)(p.Route,{exact:!0,path:"/customers",component:Wo}),Object(g.jsx)(p.Route,{exact:!0,path:"/customers/add",component:Ko}),Object(g.jsx)(p.Route,{exact:!0,path:"/customers/edit/:id",component:Ko}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/customer-group",component:Yo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/customer-group/add",component:Qo}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/customer-group/edit/:id",component:Qo}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/productattribute",component:Xo}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/productattribute/add",component:Jo}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/productattribute/edit/:id",component:Jo}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/attributeset",component:Zo}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/attributeset/add",component:ed}),Object(g.jsx)(p.Route,{exact:!0,path:"/attribute/attributeset/edit/:id",component:ed}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/banner",component:td}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/banner/add",component:sd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/banner/edit/:id",component:sd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/section",component:qd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/section/add",component:Hd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/section/edit/:id",component:Hd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/section-option/add/",component:Kd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/section-option/edit/:id",component:Kd}),Object(g.jsx)(p.Route,{exact:!0,path:"/widgets/pages",component:Vd}),Object(g.jsx)(p.Route,{exact:!0,path:"/newsletter/list",component:ud}),Object(g.jsx)(p.Route,{exact:!0,path:"/newsletter/add",component:jd}),Object(g.jsx)(p.Route,{exact:!0,path:"/newsletter/subscribers",component:bd}),Object(g.jsx)(p.Route,{exact:!0,path:"/contact_form",component:hd}),Object(g.jsx)(p.Route,{exact:!0,path:"/diamond",component:ld}),Object(g.jsx)(p.Route,{exact:!0,path:"/marketing/reviews",component:xd}),Object(g.jsx)(p.Route,{exact:!0,path:"/marketing/reviews/edit/:id",component:Od}),Object(g.jsx)(p.Route,{exact:!0,path:"/marketing/catalog-price-rule/add",component:Sd}),Object(g.jsx)(p.Route,{exact:!0,path:"/marketing/catalog-price-rule/",component:Cd}),Object(g.jsx)(p.Route,{exact:!0,path:"/marketing/catalog-price-rule/edit/:id",component:Sd}),Object(g.jsx)(p.Route,{exact:!0,path:"/services/addService",component:fd}),Object(g.jsx)(p.Route,{exact:!0,path:"/services",component:_d}),Object(g.jsx)(p.Route,{exact:!0,path:"/services/edit/:id",component:fd}),Object(g.jsx)(p.Route,{exact:!0,path:n.Appointment,component:yd}),Object(g.jsx)(p.Route,{exact:!0,path:n.EditAppointment,component:wd}),Object(g.jsx)(p.Route,{exact:!0,path:n.AppointmentReport,component:Ud}),Object(g.jsx)(p.Route,{exact:!0,path:"/system/service",component:Ad}),Object(g.jsx)(p.Route,{exact:!0,path:"/blog",component:Pd}),Object(g.jsx)(p.Route,{exact:!0,path:"/blog/add",component:Dd}),Object(g.jsx)(p.Route,{exact:!0,path:"/blog/edit/:id",component:Dd}),Object(g.jsx)(p.Route,{exact:!0,path:"/role/add",component:Fd}),Object(g.jsx)(p.Route,{exact:!0,path:"/roles",component:Rd}),Object(g.jsx)(p.Route,{exact:!0,path:"/role/edit/:id",component:Fd}),Object(g.jsx)(p.Route,{exact:!0,path:"/users/add",component:Td}),Object(g.jsx)(p.Route,{exact:!0,path:"/users",component:Bd}),Object(g.jsx)(p.Route,{exact:!0,path:"/users/edit/:id",component:Td}),Object(g.jsx)(p.Route,{exact:!0,path:"/permission/add",component:Ed}),Object(g.jsx)(p.Route,{exact:!0,path:"/permissions",component:Id}),Object(g.jsx)(p.Route,{exact:!0,path:"/permission/edit/:id",component:Ed}),Object(g.jsx)(p.Route,{exact:!0,path:"/virtual-ring-builder",component:Gd}),Object(g.jsx)(p.Route,{exact:!0,path:"/form",component:po}),Object(g.jsx)(p.Route,{exact:!0,path:"/error",component:kd}),Object(g.jsx)(p.Route,{exact:!0,path:"/",component:lo}),Object(g.jsx)(p.Route,{exact:!0,path:"/analytics",component:Zd})]})});s(994);var em=()=>{const e=Object(p.useHistory)(),t=Object(p.useLocation)();Object(d.useEffect)((()=>{const s=new URLSearchParams(t.search).get("code");s&&e.push({pathname:"/dropboximagesync",search:"code=".concat(s)})}),[]);return Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("header",{children:[Object(g.jsx)("nav",{className:"navbar default-layout-navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row",children:Object(g.jsxs)("div",{className:"navbar-menu-wrapper d-flex align-items-stretch",children:[Object(g.jsx)("button",{className:"navbar-toggler navbar-toggler align-self-center",type:"button","data-toggle":"minimize",children:Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#c394a8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-chevron-left",children:Object(g.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),Object(g.jsx)("div",{className:"text-center navbar-brand-wrapper d-flex align-items-center justify-content-center",children:Object(g.jsx)(b.b,{className:"navbar-brand brand-logo-mini",to:"/",children:Object(g.jsx)("img",{src:P+"assests/images/logo-dark.png",width:"79px",alt:"logo"})})}),Object(g.jsxs)("ul",{className:"navbar-nav navbar-nav-right",children:[Object(g.jsx)("li",{className:"nav-item nav-logout d-none d-lg-block",title:"Analytics",children:Object(g.jsx)(b.b,{className:"nav-link",to:"/analytics",children:Object(g.jsx)("i",{className:"fa fa-line-chart","aria-hidden":"true"})})}),Object(g.jsx)("li",{className:"nav-item nav-logout d-none d-lg-block",title:"Logout",children:Object(g.jsx)(b.b,{className:"nav-link",to:"",onClick:e=>{e.preventDefault(),localStorage.removeItem("appState"),localStorage.removeItem("PermissionList"),window.location.href="/login"},children:Object(g.jsx)("img",{src:P+"assets/images/logout.svg",alt:"logout"})})})]}),Object(g.jsx)("button",{className:"navbar-toggler navbar-toggler-right d-lg-none align-self-center",type:"button","data-toggle":"offcanvas",children:Object(g.jsx)("span",{className:"mdi mdi-menu"})})]})}),Object(g.jsx)(gl.a,{})]})})};var tm=()=>Object(g.jsx)("footer",{className:"footer",children:Object(g.jsx)("div",{className:"d-sm-flex justify-content-center",children:Object(g.jsxs)("span",{className:"text-muted d-block text-center text-sm-left d-sm-inline-block",children:["Copyright \xa9 ",(new Date).getFullYear()," Harmony Jewels"]})})});var sm=()=>{const e=Object(p.useLocation)(),t=new URLSearchParams(e.search),s=Object(d.useContext)(mo),[a,c]=Object(d.useState)(""),[r,l]=Object(d.useState)(!1),n=JSON.parse(localStorage.getItem("PermissionList")),i=null===JSON.parse(localStorage.appState).permission?[]:JSON.parse(localStorage.appState).permission;Object(d.useEffect)((()=>{c(e.pathname)}),[e]);const o=t.get("type"),m=e=>{e.preventDefault(),l(!r)},u=e=>(null!==i&&0!==i.length&&null!==n&&0!==n.length||(localStorage.removeItem("appState"),window.location.href="/login"),!!i.map((e=>e.name)).includes(n.filter((e=>"all-master"===e.key)).length>0?n.filter((e=>"all-master"===e.key))[0].name:null)||i.map((e=>e.name)).includes(n.filter((t=>t.key===e)).length>0?n.filter((t=>t.key===e))[0].name:null));return Object(g.jsx)("nav",{className:"sidebar sidebar-offcanvas",id:"sidebar",children:Object(g.jsxs)("ul",{className:"nav accordion",id:"accordionMenu",children:[Object(g.jsx)("li",{className:"nav-item mb-0 nav-logo",children:Object(g.jsxs)(b.b,{className:"nav-link text-center px-1 bg-transparent d-block",to:"/",children:[Object(g.jsx)("img",{className:"sidebar-brand-logo",src:P+"assets/images/logo/logo-dark.png",alt:"logo"}),Object(g.jsx)("img",{className:"sidebar-brand-logomini",src:P+"assets/images/logo/logo-dark.png",alt:"logo"})]})}),Object(g.jsx)("li",{className:"nav-item nav-profile",children:Object(g.jsxs)("a",{className:"nav-link d-flex justify-content-center bg-transparent",children:[Object(g.jsx)("div",{className:"nav-profile-image",children:Object(g.jsx)("img",{src:P+"assets/images/icon/face1.jpg",alt:"profile"})}),Object(g.jsx)("div",{className:"nav-profile-text d-flex ml-0 flex-column",children:Object(g.jsx)("span",{className:"font-weight-semibold mb-1 mt-2 text-center",children:s.name})})]})}),Object(g.jsx)("li",{name:"Dashboard",className:"nav-item "+("/"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{className:"nav-link",name:"Dashboard",to:"/",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-trello",children:[Object(g.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),Object(g.jsx)("rect",{x:"7",y:"7",width:"3",height:"9"}),Object(g.jsx)("rect",{x:"14",y:"7",width:"3",height:"5"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Dashboard"})]})}),u("sales")?Object(g.jsxs)("li",{className:"nav-item "+("/sales/orders"===a||"/sales/invoices"===a||"/sales/inquiry"===a?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#sales",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-dollar-sign",children:[Object(g.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),Object(g.jsx)("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Sales"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/sales/orders"===a||"/sales/invoices"===a||"/sales/inquiry"===a?"show":""),id:"sales","data-parent":"#accordionMenu",children:Object(g.jsx)("ul",{className:"nav flex-column sub-menu",children:Object(g.jsx)("li",{className:"nav-item "+("/sales/orders"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Orders",className:"nav-link",to:"/sales/orders",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-book",children:[Object(g.jsx)("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),Object(g.jsx)("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]}),"Orders"]})})})})]}):null,u("products")?Object(g.jsx)("li",{className:"nav-item "+("/products"===a?"active":""),children:Object(g.jsxs)(b.b,{name:"Products",className:"nav-link",to:"/products",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Products"})]})}):null,u("diamonds")?Object(g.jsx)("li",{className:"nav-item "+("/diamond"===a&&null==o?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Diamond",className:"nav-link",to:"/diamond",children:[Object(g.jsx)("img",{src:"https://hj-website-media.s3.eu-west-2.amazonaws.com/assets/images/menu-diamond.svg",width:"20",className:"opacity-4"}),Object(g.jsx)("span",{className:"menu-title",children:"Diamonds"})]})}):null,u("gemstones")?Object(g.jsx)("li",{className:"nav-item "+("/diamond"===a&&"gemstone"===o?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Diamond",className:"nav-link",to:"/diamond?type=gemstone",children:[Object(g.jsx)("img",{src:"https://hj-website-media.s3.eu-west-2.amazonaws.com/assets/images/menu-diamond.svg",width:"20",className:"opacity-4"}),Object(g.jsx)("span",{className:"menu-title",children:"Gemstones"})]})}):null,u("categories")?Object(g.jsx)("li",{className:"nav-item "+("/categories"===a||"/categories/add"===a||/categories\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Categories",className:"nav-link",to:"/categories",children:[Object(g.jsx)("img",{width:"20",src:P+"assets/images/menu-category.svg",alt:"Categories"}),Object(g.jsx)("span",{className:"menu-title",children:"Categories"})]})}):null,u("customers")?Object(g.jsx)("li",{className:"nav-item "+("/customers"===a||"/customers/add"===a||/customers\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Customers",className:"nav-link",to:"/customers",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-users",children:[Object(g.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),Object(g.jsx)("circle",{cx:"9",cy:"7",r:"4"}),Object(g.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),Object(g.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Customers"})]})}):null,u("book_an_appointment")?Object(g.jsxs)("li",{className:"nav-item "+("/services"===a||"/appointments"===a||"/appointments/report"===a?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#services",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-calendar",children:[Object(g.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),Object(g.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),Object(g.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),Object(g.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Book An Appointment"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/services"===a||"/appointments"===a?"show":""),id:"services","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/appointments"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"appointment",className:"nav-link",to:"/appointments",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-calendar",children:[Object(g.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),Object(g.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),Object(g.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),Object(g.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),"Appointments"]})}),Object(g.jsx)("li",{className:"nav-item "+("/appointments/report"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"appointment_report",className:"nav-link",to:"/appointments/report",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-clipboard",children:[Object(g.jsx)("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),Object(g.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]}),"Report"]})})]})})]}):null,u("content_management")?Object(g.jsx)("li",{className:"nav-item "+("/contentManagement"===a||"/contentManagement/add"===a||/contentManagement\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"ContentManagement",className:"nav-link",to:"/contentManagement",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-file-text",children:[Object(g.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),Object(g.jsx)("polyline",{points:"14 2 14 8 20 8"}),Object(g.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),Object(g.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),Object(g.jsx)("polyline",{points:"10 9 9 9 8 9"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Content Management"})]})}):null,u("cache_management")?Object(g.jsx)("li",{className:"nav-item "+("/cacheManagement"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"CacheManagement",className:"nav-link",to:"/cacheManagement",children:[Object(g.jsx)("img",{src:"https://hj-website-media.s3.eu-west-2.amazonaws.com/assets/images/menu-catch-mgt.svg",width:"20",className:"opacity-4"}),Object(g.jsx)("span",{className:"menu-title",children:"Cache Management"})]})}):null,u("widgets")?Object(g.jsxs)("li",{className:"nav-item "+("/widgets/banner"===a||"/widgets/banner/add"===a||/widgets\/banner\/edit\/\d+/.test(a)||"/widgets/section/add"===a||/widgets\/section\/edit\/\d+/.test(a)||"/widgets/section"===a?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#banner",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-grid",children:[Object(g.jsx)("rect",{x:"3",y:"3",width:"7",height:"7"}),Object(g.jsx)("rect",{x:"14",y:"3",width:"7",height:"7"}),Object(g.jsx)("rect",{x:"14",y:"14",width:"7",height:"7"}),Object(g.jsx)("rect",{x:"3",y:"14",width:"7",height:"7"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Widgets"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/widgets/banner"===a||"/widgets/banner/add"===a||/widgets\/banner\/edit\/\d+/.test(a)?"show":""),id:"banner","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/widgets/banner"===a||"/widgets/banner/add"===a||/widgets\/banner\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"BannerAttribute",className:"nav-link",to:"/widgets/banner",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Banner"]})}),Object(g.jsx)("li",{className:"nav-item "+("/widgets/section"===a||"/widgets/section/add"===a||/widgets\/section\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"SectionAttribute",className:"nav-link",to:"/widgets/section",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Section"]})})]})})]}):null,u("attribute")?Object(g.jsxs)("li",{className:"nav-item "+("/attribute/productattribute"===a||"/attribute/attributeset"===a||"/attribute/productattribute/add"===a||/attribute\/productattribute\/edit\/\d+/.test(a)||"/attribute/attributeset/add"===a||/attribute\/attributeset\/edit\/\d+/.test(a)?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#attribute",children:[Object(g.jsx)("img",{width:"20",src:P+"assets/images/menu-attribute.svg",alt:"Attribute"}),Object(g.jsx)("span",{className:"menu-title",children:"Attribute"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/attribute/productattribute"===a||"/attribute/attributeset"===a||"/attribute/productattribute/add"===a||/attribute\/productattribute\/edit\/\d+/.test(a)||"/attribute/attributeset/add"===a||/attribute\/attributeset\/edit\/\d+/.test(a)?"show":""),id:"attribute","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/attribute/productattribute"===a||"/attribute/productattribute/add"===a||/attribute\/productattribute\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"ProductAttribute",className:"nav-link",to:"/attribute/productattribute",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Single Attribute"]})}),Object(g.jsx)("li",{className:"nav-item "+("/attribute/attributeset"===a||"/attribute/attributeset/add"===a||/attribute\/attributeset\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"AttributeSet",className:"nav-link",to:"/attribute/attributeset",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Attribute Set"]})})]})})]}):null,u("report")?Object(g.jsxs)("li",{className:"nav-item "+("/report/link-statistics"===a||"/report/searchterm"===a?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#report",children:[Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-activity",children:Object(g.jsx)("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),Object(g.jsx)("span",{className:"menu-title",children:"Report"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse",id:"report","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/report/searchterm"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"SearchTerms",className:"nav-link",to:"/report/searchterm",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-book-open",children:[Object(g.jsx)("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),Object(g.jsx)("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),"Search Terms"]})}),Object(g.jsx)("li",{className:"nav-item "+("/report/link-statistics"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Link Statistics",className:"nav-link",to:"/report/appointment-qr-statistics",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Appointment QR"]})})]})})]}):null,u("blogs")?Object(g.jsx)("li",{className:"nav-item "+("/cacheManagement"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"CacheManagement",className:"nav-link",to:"/blog",children:[Object(g.jsx)("img",{width:"20",src:P+"assets/images/menu-blog.svg",alt:"Blog"}),Object(g.jsx)("span",{className:"menu-title",children:"Blog"})]})}):null,u("newsletter")?Object(g.jsxs)("li",{className:"nav-item "+("/newsletter/list"===a||"/newsletter/subscribers"===a||"/newsletter/list/add"===a||/newsletter\/list\/edit\/\d+/.test(a)?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#newsletter",children:[Object(g.jsx)("img",{width:"20",src:P+"assets/images/menu-newsletter.svg",alt:"newsletter"}),Object(g.jsx)("span",{className:"menu-title",children:"Newsletter "}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/newsletter/list"===a||"/newsletter/subscribers"===a||"/newsletter/add"===a||/newsletter\/edit\/\d+/.test(a)?"show":""),id:"newsletter","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/newsletter/list"===a||"/newsletter/add"===a||/newsletter\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Newsletter",className:"nav-link",to:"/newsletter/list",children:[Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-bookmark",children:Object(g.jsx)("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),"Newsletter"]})}),Object(g.jsx)("li",{className:"nav-item "+("/newsletter/subscribers"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Subscriber",className:"nav-link",to:"/newsletter/subscribers",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-tag",children:[Object(g.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),Object(g.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),"Subscribers List"]})})]})})]}):null,u("contact_form")?Object(g.jsx)("li",{className:"nav-item "+("/contact_form"===a||"/contact_form/add"===a||/contact_form\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Contact-Form",className:"nav-link",to:"/contact_form",children:[Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-phone",children:Object(g.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})}),Object(g.jsx)("span",{className:"menu-title",children:"Contact Us"})]})}):null,u("marketing")?Object(g.jsxs)("li",{className:"nav-item "+("/marketing/catalog-price-rule"===a||"/marketing/reviews"===a||"/marketing/catalog-price-rule/add"===a||/marketing\/reviews\/edit\/\d+/.test(a)||/marketing\/catalog-price-rule\/edit\/\d+/.test(a)?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#marketing",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-percent",children:[Object(g.jsx)("line",{x1:"19",y1:"5",x2:"5",y2:"19"}),Object(g.jsx)("circle",{cx:"6.5",cy:"6.5",r:"2.5"}),Object(g.jsx)("circle",{cx:"17.5",cy:"17.5",r:"2.5"})]}),Object(g.jsx)("span",{className:"menu-title",children:"Marketing "}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/marketing/catalog-price-rule"===a||"/marketing/catalog-price-rule/add"===a||/marketing\/catalog-price-rule\/edit\/\d+/.test(a)?"show":""),id:"marketing","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/coupons"===a||"/coupons/add"===a||/coupons\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Coupons",className:"nav-link",to:"/coupons",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-tag",children:[Object(g.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),Object(g.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),Object(g.jsx)("span",{children:"Coupons"})]})}),Object(g.jsx)("li",{className:"nav-item "+("/marketing/catalog-price-rule"===a||"/marketing/catalog-price-rule/add"===a||/marketing\/catalog-price-rule\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"CatelogPriceRule",className:"nav-link",to:"/marketing/catalog-price-rule",children:[Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-bookmark",children:Object(g.jsx)("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),"Catalog Price Rule"]})}),Object(g.jsx)("li",{className:"nav-item "+("/marketing/reviews"===a||/marketing\/reviews\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Reviews",className:"nav-link",to:"/marketing/reviews",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Reviews"]})})]})})]}):null,u("user_management")?Object(g.jsxs)("li",{className:"nav-item "+("/roles"===a||"/users"===a||"/permissions"===a||"/role/add"===a||/role\/edit\/\d+/.test(a)||"/users/add"===a||/users\/edit\/\d+/.test(a)||"/permission/add"===a||/permission\/edit\/\d+/.test(a)?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#user-management",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-user",children:[Object(g.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),Object(g.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}),Object(g.jsx)("span",{className:"menu-title",children:"User Management "}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/roles"===a||"/users"===a||"/permissions"===a||"/role/add"===a||/role\/edit\/\d+/.test(a)||"/users/add"===a||/users\/edit\/\d+/.test(a)||"/permission/add"===a||/permission\/edit\/\d+/.test(a)?"show":""),id:"user-management","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/permissions"===a||"/permission/add"===a||/permission\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Permissions",className:"nav-link",to:"/permissions",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-tag",children:[Object(g.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),Object(g.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),"Permissions"]})}),Object(g.jsx)("li",{className:"nav-item "+("/roles"===a||"/role/add"===a||/role\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Roles",className:"nav-link",to:"/roles",children:[Object(g.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-bookmark",children:Object(g.jsx)("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),"Roles"]})}),Object(g.jsx)("li",{className:"nav-item "+("/users"===a||"/users/add"===a||/users\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Users",className:"nav-link",to:"/users",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-tag",children:[Object(g.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),Object(g.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),"Users"]})})]})})]}):null,u("system")?Object(g.jsxs)("li",{className:"nav-item "+("/system/diamondshape"===a||"/system/diamondquality"===a||"/system/diamondmarkup"===a||"/system/metal"===a||"/system/metalquality"===a||"/system/productsize"===a||"/system/navigation-menu"===a||"/system/customer-group"===a||"/system/settings"===a||"/system/settings/instagram"===a||"/system/customer-group/add"===a||"/system/nivoda-logs"===a||/system\/customer-group\/edit\/\d+/.test(a)||"/system/settings/add"===a||/system\/settings\/edit\/\d+/.test(a)||"/system/productsize/add"===a||/system\/productsize\/edit\/\d+/.test(a)||"/system/shippingrate"===a||"/system/shippingrate/add"===a||/system\/shippingrate\/edit\/\d+/.test(a)?"active":""),children:[Object(g.jsxs)("a",{className:"nav-link","data-toggle":"collapse","data-target":"#system",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-settings",children:[Object(g.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),Object(g.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),Object(g.jsx)("span",{className:"menu-title",children:"System"}),Object(g.jsx)("i",{className:"menu-arrow"})]}),Object(g.jsx)("div",{className:"collapse "+("/system/diamondshape"===a||"/system/diamondquality"===a||"/system/diamondmarkup"===a||"/system/metal"===a||"/system/metalquality"===a||"/system/productsize"===a||"/system/productsize/add"===a||/system\/productsize\/edit\/\d+/.test(a)||"/system/navigation-menu"===a||"/system/customer-group"===a||"/system/customer-group/add"===a||/system\/customer-group\/edit\/\d+/.test(a)||"/system/settings"===a||"/system/settings/add"===a||"/system/nivoda-logs"===a||/system\/settings\/edit\/\d+/.test(a)||"/system/settings/instagram"===a||"/system/shippingrate"===a||"/system/shippingrate/add"===a||/system\/shippingrate\/edit\/\d+/.test(a)?"show":""),id:"system","data-parent":"#accordionMenu",children:Object(g.jsxs)("ul",{className:"nav flex-column sub-menu",children:[Object(g.jsx)("li",{className:"nav-item "+("/system/productsize"===a||"/system/productsize/add"===a||/system\/productsize\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"ProductSize",className:"nav-link",to:"/system/productsize",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Product Size"]})}),Object(g.jsx)("li",{className:"nav-item "+("/system/navigation-menu"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"NavigationMenu",className:"nav-link",to:"/system/navigation-menu",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Navigation Menu"]})}),Object(g.jsx)("li",{className:"nav-item "+("/system/settings"===a||"/system/settings/add"===a||/system\/settings\/edit\/\d+/.test(a)?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Settings",className:"nav-link",to:"/system/settings",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Settings"]})}),Object(g.jsx)("li",{className:"nav-item "+("/system/nivoda-logs"===a?"active":""),onClick:m,children:Object(g.jsxs)(b.b,{name:"Nivoda Logs",className:"nav-link",to:"/system/nivoda-logs",children:[Object(g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#3e4b5b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-package",children:[Object(g.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),Object(g.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),Object(g.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),Object(g.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Nivoda Logs"]})})]})})]}):null]})})};function am(){const e=Object(p.useLocation)();return Object(d.useEffect)((()=>{window.scrollTo(0,0)}),[e]),null}var cm=()=>{const e=Object(p.useHistory)(),[t,s]=Object(d.useState)(!1),r=JSON.parse(localStorage.getItem("appState")),l=Object(d.useRef)(new ec.a),[n,i]=Object(d.useState)(),[o,m]=Object(d.useState)(!1),[u]=Object(d.useState)({Username:"",Password:""});Object(d.useEffect)((()=>{null!==r&&r.user&&(j(r.user.token),e.push("/"))}),[]);const j=t=>{const s={token:t};a.postApi(c.ValidateToken,s).then((t=>{e.push("/")}))},b=e=>{u[e.target.name]=e.target.value,m(!o)},h=e=>{13===e.keyCode&&x()},x=()=>{if(!l.current.allValid())return""===u.Username&&l.current.showMessageFor("Username"),""===u.Password&&l.current.showMessageFor("Password"),void m(!o);const t={Username:u.Username,Password:u.Password};a.postApi(c.ValidateUser,t).then((t=>{if(void 0===t.data.result.id||0===t.data.result.id)return void i(t.data.message);const s={isLoggedIn:!0,permission:t.data.result.permissions,session_token:t.data.result.token};localStorage.setItem("PermissionList",JSON.stringify(t.data.result.all_permissions)),localStorage.appState=JSON.stringify(s),a.getApi(c.GetPermission).then((t=>{if(!0===t.data.status){const s=t.data.result[0];localStorage.setItem("PermissionList",JSON.stringify(s)),e.push("/")}})),e.push("/")}))};return Object(g.jsx)("div",{className:"login-page",style:{backgroundImage:"url(https://hj-website-media.s3.eu-west-2.amazonaws.com/assets/images/login-dark-bg.jpg)"},children:Object(g.jsx)("div",{className:"container",children:Object(g.jsx)("div",{className:"login-box",children:Object(g.jsxs)("div",{className:"row align-items-center",children:[Object(g.jsx)("div",{className:"col-md-5 text-center",children:Object(g.jsx)("div",{className:"login-logo",children:Object(g.jsx)("img",{src:P+"assets/images/logo-brand-white.svg",alt:"logo"})})}),Object(g.jsx)("div",{className:"col-md-7",children:Object(g.jsxs)("div",{className:"login-form bg-white",children:[Object(g.jsx)("h1",{className:"logo-name-text",children:"HARMONY JEWELS"}),Object(g.jsxs)("form",{action:"#",id:"form",className:"login-form-box",method:"post",children:[Object(g.jsxs)("div",{className:"input-group mb-4",children:[Object(g.jsx)("span",{className:"input-group-text",children:Object(g.jsx)("img",{src:P+"assets/images/user-icon.svg",className:"",alt:"user-icon"})}),Object(g.jsx)("input",{type:"text",className:"form-control",name:"Username",onChange:b,onKeyUp:h,defaultValue:u.Username,placeholder:"Username",required:!0}),l.current.message("Username",u.Username,"required",{className:"text-danger"})]}),Object(g.jsxs)("div",{className:"input-group mb-4",children:[Object(g.jsx)("span",{className:"input-group-text",children:Object(g.jsx)("img",{src:P+"assets/images/pass-icon.svg",className:"",alt:"pass-icon"})}),Object(g.jsx)("input",{type:t?"text":"password",className:"form-control",name:"Password",onChange:b,onKeyUp:h,defaultValue:u.Password,placeholder:"Password",required:!0}),Object(g.jsx)("span",{className:"input-group-text",children:Object(g.jsx)("span",{className:t?"fa-eye fa fa-fw field-icon toggle-password":"fa-eye-slash fa fa-fw field-icon toggle-password",onClick:()=>s((e=>!e))})}),l.current.message("Password",u.Password,"required",{className:"text-danger"})]}),Object(g.jsx)("div",{className:"row mb-3",children:Object(g.jsx)("div",{className:"col ",children:Object(g.jsx)("div",{className:"form-check my-0",children:Object(g.jsx)("label",{className:"text-danger font-12",children:n})})})}),Object(g.jsx)("button",{type:"button",onClick:x,className:"w-100 rounded btn login-btn",children:"LOGIN"})]}),Object(g.jsxs)("p",{className:"text-center",children:["\xa9 ",(new Date).getFullYear()," Harmony Jewels. All Rights Reserved."]})]})})]})})})})};const rm=()=>{const e=JSON.parse(localStorage.getItem("appState")),[t,s]=Object(d.useState)([]);return Object(d.useEffect)((()=>{localStorage.getItem("version")!==h.version&&("caches"in window&&(caches.keys().then((e=>{e.forEach((e=>{caches.delete(e)}))})),window.location.reload(!0)),localStorage.clear(),localStorage.setItem("version",h.version)),e&&s(O.a.decode(e.session_token))}),[]),null==e?Object(g.jsx)(p.Redirect,{to:"/login"}):Object(g.jsxs)(b.a,{children:[Object(g.jsx)(am,{}),Object(g.jsx)(mo.Provider,{value:t,children:Object(g.jsxs)("div",{className:"container-scroller",children:[Object(g.jsx)(sm,{}),Object(g.jsxs)("div",{className:"container-fluid page-body-wrapper",children:[Object(g.jsx)(em,{}),Object(g.jsxs)("div",{className:"main-panel",children:[Object(g.jsx)($d,{}),Object(g.jsx)(tm,{})]})]})]})})]})};var lm=()=>Object(g.jsx)(b.a,{children:Object(g.jsxs)(p.Switch,{children:[Object(g.jsx)(p.Route,{exact:!0,path:"/login",component:cm}),Object(g.jsx)(p.Route,{exact:!0,path:"/form",component:po}),Object(g.jsx)(p.Route,{exact:!0,path:"login",component:cm}),Object(g.jsx)(p.Route,{exact:!0,path:"/",component:rm}),Object(g.jsx)(p.Route,{exact:!0,path:"",component:rm})]})});var nm=e=>{e&&e instanceof Function&&s.e(6).then(s.bind(null,1148)).then((t=>{let{getCLS:s,getFID:a,getFCP:c,getLCP:r,getTTFB:l}=t;s(e),a(e),c(e),r(e),l(e)}))},im=(s(995),s(996),s(68)),om=s.n(im);const dm=document.getElementById("root");om()(document).mouseup((function(){om()('[data-toggle="minimize"]').on("click",(function(){dm.classList.contains("sidebar-toggle-display")||dm.classList.contains("sidebar-absolute")?dm.classList.remove("sidebar-icon-only"):dm.classList.add("sidebar-icon-only")})),om()('.sidebar-icon-only [data-toggle="minimize"]').on("click",(function(){dm.classList.remove("sidebar-icon-only")})),om()("#accordionMenu li .nav-link[href]").on("click",(function(){dm.classList.add("sidebar-icon-only")})),om()(".main-panel").on("click",(function(){dm.classList.add("sidebar-icon-only")})),om()('[data-toggle="offcanvas"]').on("click",(function(){const e=document.getElementById("sidebar");e.classList.contains("active")?e.classList.remove("active"):e.classList.add("active")}))})),om()(document).ready((function(){om()(".form-check label, .form-radio label").append(''),om()(".filter-btn").on("click",(function(){const e=document.getElementById("filter-bar");null!=e&&(e.classList.contains("filter-show")?e.classList.remove("filter-show"):e.classList.add("filter-show"))})),om()('[data-toggle="tooltip"]').tooltip()})),j.a.render(Object(g.jsx)(m.a.StrictMode,{children:Object(g.jsx)(lm,{})}),document.getElementById("root")),nm()}},[[997,1,2]]]); //# sourceMappingURL=main.81a5d545.chunk.js.map