1"use strict";(self.webpackChunkreact_app=self.webpackChunkreact_app||[]).push([[14463],{74419(e,t,i){i.r(t),i.d(t,{default:()=>X});var a=i(89379),l=i(9950),s=(i(58679),i(28429)),n=i(17575),o=i(4359),r=i(27232),d=i(46707),c=i(99262),u=i(8110),p=i(99977),h=i(58710),m=i(66819),g=i(59807),v=i(94919),x=i(21413),y=(i(10413),i(59051)),f=i.n(y),b=i(34371),j=i(54356),N=i(38431),S=i(84279),C=i(14e3),k=i(43805),A=i(98082),P=i(3919),w=i(97937),I=i(95252),D=i(16339),T=i(44414);const _=e=>(null===e||void 0===e?void 0:e.title)||(null===e||void 0===e?void 0:e.product_name)||(null===e||void 0===e?void 0:e.Title)||(null===e||void 0===e?void 0:e.productTitle)||"Auction Listing",F=e=>(null===e||void 0===e?void 0:e.homeShowId)||(null===e||void 0===e?void 0:e.sku)||(null===e||void 0===e?void 0:e.ProductSKU)||(null===e||void 0===e?void 0:e.id)||"N/A";const R=function(e){let{show:t,onClose:i,product:a,onSuccess:s}=e;const d=(0,l.useContext)(n.A),c=null===d||void 0===d?void 0:d.Darkmode,[u,p]=(0,l.useState)(""),[h,m]=(0,l.useState)(""),[g,v]=(0,l.useState)(""),[x,y]=(0,l.useState)("7"),[f,b]=(0,l.useState)(0),[j,N]=(0,l.useState)(""),[S,C]=(0,l.useState)(!1),[k,A]=(0,l.useState)({});if((0,l.useEffect)(()=>{var e,i,l,s,n,o,r,d;a&&t&&(p(null!==(e=null!==(i=a.starting_bid)&&void 0!==i?i:a.startingbid)&&void 0!==e?e:""),m(null!==(l=null!==(s=a.reserve_price)&&void 0!==s?s:a.reserveprice)&&void 0!==l?l:""),v(null!==(n=null!==(o=a.buy_it_now)&&void 0!==o?o:a.buyitnowprice)&&void 0!==n?n:""),y(String(null!==(r=null!==(d=a.auction_duration_days)&&void 0!==d?d:a.auctionduration)&&void 0!==r?r:"7")),b(a.isScheduled?1:0),N(""),A({}))},[a,t]),!a)return null;const R=(e=>{var t,i,a,l,s,n,o;if(null!==e&&void 0!==e&&e.mainImage)return e.mainImage;if(null!==e&&void 0!==e&&null!==(t=e.defaultprodImg)&&void 0!==t&&null!==(i=t[0])&&void 0!==i&&i.path)return e.defaultprodImg[0].path;const r=null===e||void 0===e||null===(a=e.Media)||void 0===a||null===(l=a[0])||void 0===l||null===(s=l.node)||void 0===s||null===(n=s.preview)||void 0===n||null===(o=n.image)||void 0===o?void 0:o.originalSrc;return r||null})(a),W=(e=>{const t=Number(e);return!Number.isFinite(t)||t<=0?null:"$".concat(t.toFixed(2))})(a.max_bid),E=(e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})})(a.auction_end_date);return(0,T.jsxs)(P.A,{show:t,onHide:i,centered:!0,size:"lg",className:"relist-auction-modal ".concat(c?"dark-modal":""),children:[(0,T.jsx)(P.A.Header,{closeButton:!0,children:(0,T.jsxs)(P.A.Title,{className:"d-flex align-items-center",children:[(0,T.jsx)(D.jTZ,{className:"text-primary"}),"Relist Auction"]})}),(0,T.jsxs)("form",{onSubmit:async e=>{if(e&&e.preventDefault(),(()=>{const e={},t=parseFloat(u),i=parseFloat(h),a=parseFloat(g);return(Number.isNaN(t)||t<=0)&&(e.startingBid="Starting bid must be greater than 0"),!Number.isNaN(i)&&i>0&&t>0&&i<t&&(e.reservePrice="Reserve price cannot be less than starting bid"),!Number.isNaN(a)&&a>0&&t>0&&a<=t&&(e.buyItNowPrice="Buy It Now price must be greater than starting bid"),1===f&&(j?new Date(j)<=new Date&&(e.scheduledDate="Scheduled time must be in the future"):e.scheduledDate="Please select a future schedule date"),A(e),0===Object.keys(e).length})()){C(!0);try{const e={AuctionId:a.id,AuctionStates:{startingbid:parseFloat(u),reserveprice:h?parseFloat(h):null,buyitnowprice:g?parseFloat(g):null,auctionduration:parseInt(x,10),Scheduled:f,formattedDate:1===f?j:null}},t=await o.A.httpPost("auction/relist",e);t&&t.success?(r.oR.success(t.message||"Auction relisted successfully!"),s&&s(),i()):r.oR.error((null===t||void 0===t?void 0:t.message)||"Failed to relist auction")}catch(n){var t,l;console.error("Error relisting auction:",n),r.oR.error((null===n||void 0===n||null===(t=n.response)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.message)||"Failed to relist auction")}finally{C(!1)}}},children:[(0,T.jsxs)(P.A.Body,{children:[(0,T.jsx)("p",{className:"relist-auction-modal__intro",children:"Set new pricing and timing, then relist this expired auction. Previous bids will not carry over."}),(0,T.jsxs)("div",{className:"relist-auction-modal__product-card",children:[R?(0,T.jsx)("img",{src:R,alt:_(a),className:"relist-auction-modal__product-image",onError:e=>{e.currentTarget.style.display="none"}}):(0,T.jsx)("div",{className:"relist-auction-modal__product-image relist-auction-modal__product-image--placeholder","aria-hidden":"true",children:"\ud83d\udce6"}),(0,T.jsxs)("div",{className:"relist-auction-modal__product-meta",children:[(0,T.jsx)("h6",{className:"relist-auction-modal__product-title",children:_(a)}),(0,T.jsxs)("div",{className:"relist-auction-modal__product-details",children:[(0,T.jsxs)("span",{children:["SKU: ",F(a)]}),(0,T.jsx)("span",{className:"relist-auction-modal__status-badge",children:a.auction_status||"expired"}),E&&(0,T.jsxs)("span",{children:["Ended: ",E]}),(0,T.jsxs)("span",{children:["Final bid: ",W||"No bids"]})]})]})]}),(0,T.jsxs)("div",{className:"relist-auction-modal__section",children:[(0,T.jsxs)("h5",{className:"relist-auction-modal__section-title",children:[(0,T.jsx)(D.z8N,{"aria-hidden":"true"}),"Pricing"]}),(0,T.jsx)("p",{className:"relist-auction-modal__section-desc",children:"Set the starting bid and optional reserve or Buy It Now price for the new auction run."}),(0,T.jsxs)("div",{className:"relist-auction-modal__field-grid relist-auction-modal__field-grid--three",children:[(0,T.jsxs)("div",{className:"relist-auction-modal__field",children:[(0,T.jsxs)("label",{className:"relist-auction-modal__label",htmlFor:"relist-starting-bid",children:["Starting bid (USD) ",(0,T.jsx)("span",{className:"text-danger",children:"*"})]}),(0,T.jsx)("input",{id:"relist-starting-bid",type:"number",step:"0.01",min:"0.01",value:u,onChange:e=>p(e.target.value),className:"relist-auction-modal__input ".concat(k.startingBid?"
1is-invalid":""),placeholder:"0.00"}),k.startingBid&&(0,T.jsx)("span",{className:"relist-auction-modal__error",children:k.startingBid})]}),(0,T.jsxs)("div",{className:"relist-auction-modal__field",children:[(0,T.jsxs)("label",{className:"relist-auction-modal__label",htmlFor:"relist-reserve-price",children:["Reserve price ",(0,T.jsx)("span",{className:"relist-auction-modal__label-hint",children:"(optional)"})]}),(0,T.jsx)("input",{id:"relist-reserve-price",type:"number",step:"0.01",min:"0",value:h,onChange:e=>m(e.target.value),className:"relist-auction-modal__input ".concat(k.reservePrice?"is-invalid":""),placeholder:"Optional reserve"}),k.reservePrice&&(0,T.jsx)("span",{className:"relist-auction-modal__error",children:k.reservePrice})]}),(0,T.jsxs)("div",{className:"relist-auction-modal__field",children:[(0,T.jsxs)("label",{className:"relist-auction-modal__label",htmlFor:"relist-buy-it-now",children:["Buy It Now price ",(0,T.jsx)("span",{className:"relist-auction-modal__label-hint",children:"(optional)"})]}),(0,T.jsx)("input",{id:"relist-buy-it-now",type:"number",step:"0.01",min:"0",value:g,onChange:e=>v(e.target.value),className:"relist-auction-modal__input ".concat(k.buyItNowPrice?"is-invalid":""),placeholder:"Optional Buy It Now"}),k.buyItNowPrice&&(0,T.jsx)("span",{className:"relist-auction-modal__error",children:k.buyItNowPrice})]})]})]}),(0,T.jsxs)("div",{className:"relist-auction-modal__section",children:[(0,T.jsxs)("h5",{className:"relist-auction-modal__section-title",children:[(0,T.jsx)(D.Ohp,{"aria-hidden":"true"}),"Duration & start"]}),(0,T.jsx)("p",{className:"relist-auction-modal__section-desc",children:"Choose how long the auction runs and when bidding should begin."}),(0,T.jsxs)("div",{className:"relist-auction-modal__field-grid",children:[(0,T.jsxs)("div",{className:"relist-auction-modal__field",children:[(0,T.jsx)("label",{className:"relist-auction-modal__label",htmlFor:"relist-auction-duration",children:"Auction duration"}),(0,T.jsxs)("select",{id:"relist-auction-duration",value:x,onChange:e=>y(e.target.value),className:"relist-auction-modal__select",children:[(0,T.jsx)("option",{value:"1",children:"1 day"}),(0,T.jsx)("option",{value:"3",children:"3 days"}),(0,T.jsx)("option",{value:"5",children:"5 days"}),(0,T.jsx)("option",{value:"7",children:"7 days (recommended)"}),(0,T.jsx)("option",{value:"10",children:"10 days"}),(0,T.jsx)("option",{value:"14",children:"14 days"}),(0,T.jsx)("option",{value:"30",children:"30 days"})]})]}),(0,T.jsxs)("div",{className:"relist-auction-modal__field relist-auction-modal__field--full",children:[(0,T.jsx)("span",{className:"relist-auction-modal__label",children:"Start timing"}),(0,T.jsxs)("div",{className:"relist-auction-modal__timing-options",children:[(0,T.jsxs)("label",{className:"relist-auction-modal__timing-option ".concat(0===f?"relist-auction-modal__timing-option--active":""),htmlFor:"relist-start-immediately",children:[(0,T.jsx)("input",{type:"radio",name:"scheduleType",id:"relist-start-immediately",checked:0===f,onChange:()=>b(0)}),(0,T.jsxs)("span",{className:"relist-auction-modal__timing-copy",children:[(0,T.jsx)("span",{className:"relist-auction-modal__timing-title",children:"Start immediately"}),(0,T.jsx)("span",{className:"relist-auction-modal__timing-desc",children:"Bidding opens as soon as you relist."})]})]}),(0,T.jsxs)("label",{className:"relist-auction-modal__timing-option ".concat(1===f?"relist-auction-modal__timing-option--active":""),htmlFor:"relist-schedule-later",children:[(0,T.jsx)("input",{type:"radio",name:"scheduleType",id:"relist-schedule-later",checked:1===f,onChange:()=>b(1)}),(0,T.jsxs)("span",{className:"relist-auction-modal__timing-copy",children:[(0,T.jsx)("span",{className:"relist-auction-modal__timing-title",children:"Schedule for later"}),(0,T.jsx)("span",{className:"relist-auction-modal__timing-desc",children:"Pick a future date and time to open bidding."})]})]})]})]}),1===f&&(0,T.jsxs)("div",{className:"relist-auction-modal__field relist-auction-modal__field--full",children:[(0,T.jsxs)("label",{className:"relist-auction-modal__label",htmlFor:"relist-scheduled-date",children:[(0,T.jsx)(D.wIk,{"aria-hidden":"true"})," Schedule start date & time"]}),(0,T.jsx)("input",{id:"relist-scheduled-date",type:"datetime-local",value:j,onChange:e=>N(e.target.value),className:"relist-auction-modal__input ".concat(k.scheduledDate?"is-invalid":"")}),k.scheduledDate&&(0,T.jsx)("span",{className:"relist-auction-modal__error",children:k.scheduledDate})]})]})]})]}),(0,T.jsxs)(P.A.Footer,{children:[(0,T.jsx)(w.A,{variant:"light",onClick:i,disabled:S,className:"relist-auction-modal__footer-btn",children:"Cancel"}),(0,T.jsx)(w.A,{variant:"primary",type:"submit",disabled:S,className:"relist-auction-modal__submit-btn",children:S?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(I.A,{size:"sm",animation:"border"}),"Relisting..."]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(D.jTZ,{"aria-hidden":"true"}),"Relist Auction"]})})]})]})]})};var W=i(85505),E=(i(58728),i(7285)),M=i(12053),B=i(31857),q=i(75563),O=i(22875);const L=e=>{let{show:t,onHide:i,requiredFields:a,onEdit:l,darkMode:s}=e;return(0,T.jsxs)(P.A,{show:t,onHide:i,centered:!0,className:"required-fields-modal ".concat(s?"dark-mode":""),children:[(0,T.jsx)(P.A.Header,{closeButton:!0,className:s?"bg-dark text-white":"",children:(0,T.jsx)(P.A.Title,{children:"Required Fields to Activate Listing"})}),(0,T.jsx)(P.A.Body,{className:s?"bg-dark text-white":"",children:(0,T.jsxs)("div",{className:"required-fields-list",children:[(0,T.jsx)("p",{className:"mb-3",children:"Please fill the following required fields to activate this listing:"}),(0,T.jsx)("ul",{className:"fields-list",children:a.map((e,t)=>(0,T.jsxs)("li",{className:"field-item",children:[(0,T.jsx)("span",{className:"field-icon",children:"\u26a0\ufe0f"}),(0,T.jsx)("span",{className:"field-name",children:e})]},t))})]})}),(0,T.jsxs)(P.A.Footer,{className:s?"bg-dark":"",children:[(0,T.jsx)("button",{className:"btn-cancel",onClick:i,children:"Cancel"}),(0,T.jsx)("button",{className:"btn-edit",onClick:l,children:"Go to Edit Page"})]})]})},H=e=>{var t,i,a;const l=[],s=(null===e||void 0===e?void 0:e.otherData)||{},n=!!(null!==s&&void 0!==s&&s.clothingStyle||null!==s&&void 0!==s&&s.clothingType||null!==s&&void 0!==s&&s.clothingSize),o=!!(null!==s&&void 0!==s&&s.CandleType||null!==s&&void 0!==s&&s.candleType||null!==s&&void 0!==s&&s.CandleWaxType);(null===s||void 0===s?void 0:s.productImages)&&s.productImages.length>0||(null===s||void 0===s||null===(t=s.productData)||void 0===t?void 0:t.AllImages)&&s.productData.AllImages.length>0||(null===s||void 0===s||null===(i=s.originalProduct)||void 0===i||null===(a=i.originalProduct)||void 0===a?void 0:a.media)&&s.originalProduct.originalProduct.media.length>0||(null===s||void 0===s?void 0:s.ProductMedia)&&s.ProductMedia.length>0||(null===s||void 0===s?void 0:s.Media)&&s.Media.length>0||l.push("Media (at least one image)"),null!==s&&void 0!==s&&s.Condition||l.push("Condition");return(null===s||void 0===s?void 0:s.isDeliveryType)||(null===s||void 0===s?void 0:s.isPickupType)||(null===s||void 0===s?void 0:s.shipItYourself)||(null===s||void 0===s?void 0:s.thirdParty)||(null===s||void 0===s?void 0:s.uShip)||(null===s||void 0===s?void 0:s.dolly)||(null===s||void 0===s?void 0:s.easyPost)||l.push("Shipping Options"),n?(null!==s&&void 0!==s&&s.clothingStyle||null!==s&&void 0!==s&&s.firstTextCloth||l.push("Clothing Style"),null!==s&&void 0!==s&&s.clothingType||null!==s&&void 0!==s&&s.secondTextCloth||l.push("Clothing Type"),null!==s&&void 0!==s&&s.clothingSize||l.push("Clothing Size"),null!==s&&void 0!==s&&s.clothingMaterial||l.push("Clothing Material"),null!==s&&void 0!==s&&s.clothingColor||l.push("Clothing Color")):o?(null!==s&&void 0!==s&&s.ProductHeight||null!==s&&void 0!==s&&s.ProductHeightValue||l.push("Product Height"),null!==s&&void 0!==s&&s.ProductWidth||null!==s&&void 0!==s&&s.Width||null!==s&&void 0!==s&&s.WidthValue||l.push("Product Width"),null!==s&&void 0!==s&&s.Depth||null!==s&&void 0!==s&&s.DepthValue||l.push("Product Depth"),null!==s&&void 0!==s&&s.ProductWeight||null!==s&&void 0!==s&&s.ProductWeightV
1alue||l.push("Product Weight"),null!==s&&void 0!==s&&s.ShippingWeight||null!==s&&void 0!==s&&s.ShippingWeightIn||l.push("Shipping Weight"),null!==s&&void 0!==s&&s.ShippingHeight||null!==s&&void 0!==s&&s.ShippingHeightIn||l.push("Shipping Height"),null!==s&&void 0!==s&&s.ShippingWidth||null!==s&&void 0!==s&&s.ShippingWidthIn||l.push("Shipping Width"),null!==s&&void 0!==s&&s.ShippingDepth||null!==s&&void 0!==s&&s.ShippingDepthIn||l.push("Shipping Length"),null!==s&&void 0!==s&&s.CandleType||null!==s&&void 0!==s&&s.candleType||l.push("Candle Type"),null!==s&&void 0!==s&&s.CandleWaxType||null!==s&&void 0!==s&&s.candleWaxType||l.push("Candle Wax Type"),null!==s&&void 0!==s&&s.CandleFragrance||null!==s&&void 0!==s&&s.candleFragrance||l.push("Candle Fragrance"),null!==s&&void 0!==s&&s.CandleBurnTime||null!==s&&void 0!==s&&s.candleBurnTime||l.push("Candle Burn Time"),null!==s&&void 0!==s&&s.CandleContainerMaterial||null!==s&&void 0!==s&&s.candleContainerMaterial||l.push("Candle Container Material"),null!==s&&void 0!==s&&s.CandleIntensity||l.push("Candle Intensity"),null!==s&&void 0!==s&&s.CandleWickMaterial||l.push("Candle Wick Material"),null!==s&&void 0!==s&&s.CandleFlameType||l.push("Candle Flame Type"),null!==s&&void 0!==s&&s.CandleColor||l.push("Candle Color"),null!==s&&void 0!==s&&s.CandleShape||l.push("Candle Shape"),null!==s&&void 0!==s&&s.CandleSize||l.push("Candle Size"),null!==s&&void 0!==s&&s.CandlePackaging||l.push("Candle Packaging"),null!==s&&void 0!==s&&s.CandleSustainabilityFeatures||l.push("Candle Sustainability Features"),null!==s&&void 0!==s&&s.CandleCertifications||l.push("Candle Certifications"),null!==s&&void 0!==s&&s.CandleOccasion||l.push("Candle Occasion"),null!==s&&void 0!==s&&s.CandleTheme||l.push("Candle Theme")):(null!==s&&void 0!==s&&s.ProductHeight||null!==s&&void 0!==s&&s.ProductHeightValue||l.push("Product Height"),null!==s&&void 0!==s&&s.ProductWidth||null!==s&&void 0!==s&&s.Width||null!==s&&void 0!==s&&s.WidthValue||l.push("Product Width"),null!==s&&void 0!==s&&s.Depth||null!==s&&void 0!==s&&s.DepthValue||l.push("Product Depth"),null!==s&&void 0!==s&&s.ProductWeight||null!==s&&void 0!==s&&s.ProductWeightValue||l.push("Product Weight"),null!==s&&void 0!==s&&s.ShippingWeight||null!==s&&void 0!==s&&s.ShippingWeightIn||l.push("Shipping Weight"),null!==s&&void 0!==s&&s.ShippingHeight||null!==s&&void 0!==s&&s.ShippingHeightIn||l.push("Shipping Height"),null!==s&&void 0!==s&&s.ShippingWidth||null!==s&&void 0!==s&&s.ShippingWidthIn||l.push("Shipping Width"),null!==s&&void 0!==s&&s.ShippingDepth||null!==s&&void 0!==s&&s.ShippingDepthIn||l.push("Shipping Length")),l};var U=i(60748),z=i(72835),Q=i(18819),J=i(94406),V=i(40777);const G="https://homeshow.ai/new-images/stock_img.png",Y="https://homeshow.ai/new-images/seller_img.png",Z="https://thehomeshowlive.s3-accelerate.amazonaws.com/Assets/Product/Vector.png",$="https://homeshow.ai/new-images/placeholder-new2.jpg",K="https://thehomeshowlive.s3-accelerate.amazonaws.com/Assets/Product/sorts.png";const X=function(){var e;const t=(0,E.Rs)(),i=(0,s.Zp)(),[y,P]=(0,l.useState)(1),[w,I]=(0,l.useState)(1),[_,F]=(0,l.useState)({}),[X,ee]=(0,l.useState)([]),[te,ie]=(0,l.useState)({}),[ae,le]=(0,l.useState)({}),[se,ne]=(0,l.useState)([]),[oe,re]=(0,l.useState)({}),[de,ce]=(0,l.useState)(!1),[ue,pe]=(0,l.useState)(!1),[he,me]=(0,l.useState)(!1);let{state:ge}=(0,s.zy)();const ve=(0,l.useContext)(n.A),xe=(0,J.A)(),[ye,fe]=(0,l.useState)(!1),[be,je]=(0,l.useState)(0),[Ne,Se]=(0,l.useState)(0),[Ce,ke]=(0,l.useState)([]),[Ae,Pe]=(0,l.useState)(null),[we,Ie]=(0,l.useState)(null),[De,Te]=(0,l.useState)(null),[_e,Fe]=(0,l.useState)(!1),[Re,We]=(0,l.useState)(""),[Ee,Me]=(0,l.useState)(null),[Be,qe]=(0,l.useState)(null),[Oe,Le]=(0,l.useState)(null),[He,Ue]=(0,l.useState)(null),[ze,Qe]=(0,l.useState)(null),[Je,Ve]=(0,l.useState)(null),[Ge,Ye]=(0,l.useState)(null),Ze=ve.Darkmode?"textwhite":"",$e=ve.Darkmode?"darkbackground text-white":"",Ke=ve.Darkmode?"darksecondry ":"background-light",Xe=(ve.Darkmode,ve.Darkmode?"darksecondry":""),et=ve.Darkmode?"text-white":"",[tt,it]=(0,l.useState)(1),[at,lt]=(0,l.useState)(null),st=void 0,[nt,ot]=(0,l.useState)(1),rt=9*(nt-1),[dt,ct]=(0,l.useState)(null),[ut,pt]=(0,l.useState)(!1),[ht,mt]=(0,l.useState)(1),[gt,vt]=(0,l.useState)(null),[xt,yt]=(0,l.useState)(""),[ft,bt]=(0,l.useState)(!1),[jt,Nt]=(0,l.useState)(null),[St,Ct]=(0,l.useState)(null),[kt,At]=(0,l.useState)(""),Pt=(0,s.zy)(),[wt,It]=(0,l.useState)(""),Dt=(0,l.useRef)(null),Tt=(0,l.useRef)(null),[_t,Ft]=(0,l.useState)([]),[Rt,Wt]=(0,l.useState)(0),[Et,Mt]=(0,l.useState)(!1),[Bt,qt]=(0,l.useState)(null),[Ot,Lt]=(0,l.useState)(!1),[Ht,Ut]=(0,l.useState)(1),[zt,Qt]=(0,l.useState)(1),[Jt,Vt]=(0,l.useState)(!1),[Gt,Yt]=(0,l.useState)({pricefilter:null,Productsort:null,cat1:null,cat2:null,cat3:null,Date:null,brandsort:null,Quantityfilter:null,expiredPricefilter:null,expiredProductsort:null,expiredCat1:null,expiredCat2:null,expiredCat3:null,expiredDate:null,expiredBrandsort:null,expiredQuantityfilter:null}),[Zt,$t]=(0,l.useState)(""),[Kt,Xt]=(0,l.useState)("Products"),[ei,ti]=(0,l.useState)(!1),[ii,ai]=(0,l.useState)(""),[li,si]=(0,l.useState)(!1),[ni,oi]=(0,l.useState)(!1),[ri,di]=(0,l.useState)(null),[ci,ui]=(0,l.useState)(null),[pi,hi]=(0,l.useState)(null),[mi,gi]=(0,l.useState)(0),[vi,xi]=(0,l.useState)([]),[yi,fi]=(0,l.useState)([]),bi=e=>2===Number(e)?2:1,ji=()=>{var e;const t=JSON.parse(localStorage.getItem("userProfile")||"{}");return bi(null===t||void 0===t||null===(e=t.user)||void 0===e?void 0:e.businessUserType)},[Ni,Si]=(0,l.useState)(ji),[Ci,ki]=(0,l.useState)(!1),[Ai,Pi]=(0,l.useState)(0),wi=new URLSearchParams(Pt.search).get("openintegration"),[Ii,Di]=(0,l.useState)(null),[Ti,_i]=(0,l.useState)(null),[Fi,Ri]=(0,l.useState)(!1),[Wi,Ei]=(0,l.useState)(null),[Mi,Bi]=(0,l.useState)([]),[qi,Oi]=(0,l.useState)(!1),Li=JSON.parse(localStorage.getItem("userProfile")||"{}"),Hi=null===Li||void 0===Li||null===(e=Li.user)||void 0===e?void 0:e.userType,Ui=()=>{var e,t;return(null===(e=JSON.parse(localStorage.getItem("userProfile")||"{}"))||void 0===e||null===(t=e.user)||void 0===t?void 0:t.businessUserType)||1},zi=e=>{if(ia(!1),e.target.checked){let e=[];1===ht||2===ht?se.forEach(t=>{t.products&&t.products.length>
10&&t.products.forEach(i=>{(1===ht&&"Active"===t.status||2===ht&&"Paused"===t.status)&&e.push(i.id)})}):3===ht?(Qa||[]).forEach(t=>e.push(t.id)):4===ht&&vi&&vi.products&&vi.products.forEach(t=>e.push(t.id)),Bi(e)}else Bi([])},Qi=e=>{ta&&ia(!1),Bi(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},Ji=(e,t)=>{var i,a,l;sa(e.id),oa(t);const s=null!==(i=null!==(a=null===e||void 0===e||null===(l=e.Defaultprod)||void 0===l?void 0:l.productTitle)&&void 0!==a?a:null===e||void 0===e?void 0:e.title)&&void 0!==i?i:"";da({price:e.ProductPrice||"",quantity:e.Quantity||"",title:String(s)})},Vi=()=>{sa(null),oa(null),da({price:"",quantity:"",title:""})},Gi=async()=>{if(!la||!na)return;const e=la,t=na;ua(!0);try{const i={field:t};if("price"===t&&(i.price=parseFloat(ra.price)),"quantity"===t&&(i.quantity=parseInt(ra.quantity,10)),"title"===t){const e=String(ra.title||"").trim();if(!e)return r.oR.error("Title cannot be empty"),void ua(!1);i.title=e}const l=await o.A.httpPatch("shopify/VendorProduct/".concat(e,"/quickedit"),i);null!==l&&void 0!==l&&l.success?(r.oR.success("Product updated successfully!"),"title"===t&&i.title&&((e,t)=>{const i=(0,j.Ef)(t);ne(l=>l.map(l=>l.products&&Array.isArray(l.products)?(0,a.A)((0,a.A)({},l),{},{products:l.products.map(l=>l.id===e?(0,a.A)((0,a.A)({},l),{},{title:i,Defaultprod:l.Defaultprod?(0,a.A)((0,a.A)({},l.Defaultprod),{},{productTitle:t}):l.Defaultprod}):l)}):l))})(e,i.title),Vi(),"title"!==t&&Ea()):r.oR.error((null===l||void 0===l?void 0:l.msg)||"Failed to update product")}catch(i){r.oR.error((null===i||void 0===i?void 0:i.msg)||(null===i||void 0===i?void 0:i.message)||(null===i||void 0===i?void 0:i.detail)||"Failed to update product")}finally{ua(!1)}},[Yi,Zi]=(0,l.useState)(!1),[$i,Ki]=(0,l.useState)(null),[Xi,ea]=(0,l.useState)(null),[ta,ia]=(0,l.useState)(!1),aa=e=>{let i=null;if("activate"===e){const e=2===Ni?null===t||void 0===t?void 0:t.BusinessPlanUsage:null===t||void 0===t?void 0:t.IndividualUsage,a=null===e||void 0===e?void 0:e.ProductListingsLimit,l=null===e||void 0===e?void 0:e.ActiveListings,s=parseInt((null===l||void 0===l?void 0:l.auto)||0)+parseInt((null===l||void 0===l?void 0:l.vendor)||0)||0,n=ta?Za||0:Mi.length;if("Unlimited"!==a&&"unlimited"!==a){const e=parseInt(a||0);if(s+n>e){const t=Math.max(0,e-s);i=0===t?"You've reached your ".concat(2===Ni?"business":"personal"," plan limit of ").concat(e," active listings. Upgrade your plan to activate more."):"You can only activate ".concat(t," more listing").concat(1===t?"":"s"," (").concat(s,"/").concat(e," used). Deselect ").concat(n-t," listing").concat(n-t===1?"":"s"," or upgrade your plan.")}}}ea({action:e,quotaError:i})},[la,sa]=(0,l.useState)(null),[na,oa]=(0,l.useState)(null),[ra,da]=(0,l.useState)({price:"",quantity:"",title:""}),[ca,ua]=(0,l.useState)(!1),pa=(0,l.useCallback)(()=>{const e=ze||JSON.parse(localStorage.getItem("userProfile")||"{}"),a=(0,z.DD)(e,null===t||void 0===t?void 0:t.BusinessPlanUsage);return a.allowed?(i("/unified-integrations"),!0):(Ki(a.restrictionType),Zi(!0),!1)},[i,ze,null===t||void 0===t?void 0:t.BusinessPlanUsage]);(0,l.useEffect)(()=>{wi&&(i("/listings",{replace:!0}),pa())},[wi,i,pa]),(0,l.useEffect)(()=>{Bi([]),ia(!1)},[ht,wt,He,Oe,Be,Ee,jt,Ni,Ai,tt,nt,Ht,zt]);const ha=(0,l.useCallback)(()=>{var e;const t=bi(null!==(e=null===ve||void 0===ve?void 0:ve.Profilemode)&&void 0!==e?e:null===ve||void 0===ve?void 0:ve.userType),i=bi(t||ji());Si(e=>e===i?e:i)},[null===ve||void 0===ve?void 0:ve.Profilemode,null===ve||void 0===ve?void 0:ve.userType]);(0,l.useEffect)(()=>{ha();const e=e=>{null!==e&&void 0!==e&&e.key&&"userProfile"!==e.key||ha()};return window.addEventListener("storage",e),window.addEventListener("focus",ha),()=>{window.removeEventListener("storage",e),window.removeEventListener("focus",ha)}},[ha]),(0,l.useEffect)(()=>{ha()},[null===ve||void 0===ve?void 0:ve.Profilemode,null===ve||void 0===ve?void 0:ve.userType,ha]);const ma=(e,t)=>{Yt(i=>(0,a.A)((0,a.A)({},Object.fromEntries(Object.keys(i).map(e=>[e,null]))),{},{[e]:t})),Nt(null)},ga=(0,l.useCallback)((0,j.sg)(e=>{const{value:t}=e.target;It(t),ot(1),it(1),Ut(1),Qt(1),Tt.current&&Tt.current.blur()},1e3),[]),[va,xa]=(0,l.useState)({category:null,subcategory:null,search:"",brand:null}),ya=()=>{xa({category:null,subcategory:null,search:"",brand:null})},fa=()=>{window.history.replaceState(null,null,window.location.pathname)};(0,l.useEffect)(()=>{const e=localStorage.getItem("token"),t=localStorage.getItem("inventory_listing_details");if(e){let e=JSON.parse(localStorage.getItem("userProfile"));Qe(e)}else i("/login");if(t){const e=JSON.parse(t),i=JSON.parse(localStorage.getItem("headermanu")||"[]").find(t=>e.categoryId==t.id),l=i.submenu.find(t=>e.subCategoryId==t.id).submenu.find(t=>e.subCategoryId3==t.id);let s=e.warrantyNote,n=e.sellerWarranty,o={};o=n&&"Yes"==n?{plan:"",warrantyname:"Full Manufacturer's Warranty",duration:"",years:""}:{warrantyname:"No Warranty"};try{const e=JSON.parse(s);Array.isArray(e)&&(s=e.join("<br/>"))}catch(a){s=s.split(",").join("<br/>")}
1ie({Type:i.urlKey,Type1:i.urlKey,categoryName:i.categoryName,childId:i.childId,childId1:i.childId,firstcategory:i.id,parantId:i.id,parantId1:i.id,ParantCategoryId:null===e||void 0===e?void 0:e.subCategoryId,productBrandName:null===e||void 0===e?void 0:e.brandName,SubName1:null===l||void 0===l?void 0:l.categoryName,CategoryId:null===e||void 0===e?void 0:e.subCategoryId3,WarrantyNote:s,Warranty:o}),Ve(e),localStorage.removeItem("inventory_listing_details"),re(null),P(3)}localStorage.getItem("switchToDraftTab")&&(mt(3),localStorage.removeItem("switchToDraftTab"))},[]),(0,l.useEffect)(()=>{2!==y&&1!==y||ya()},[y]);const ba=async e=>{if(e!==Ni)try{var t,i,a;pe(!0);const s=await o.A.httpPost("updateBusinessProfileType",{businessUserType:e});let n=JSON.parse(localStorage.getItem("userProfile"));null!==n&&void 0!==n&&n.user&&(null!==s&&void 0!==s&&s.userDetail&&(n.userDetail=s.userDetail),null!==s&&void 0!==s&&s.businessUserDetails&&(n.businessUserDetails=s.businessUserDetails),n.user.businessUserType=e,localStorage.setItem("userProfile",JSON.stringify(n)));let r=JSON.parse(localStorage.getItem("servicePortalAuth"));null!==r&&void 0!==r&&r.userData&&(r.userData.businessUserType=e,null!==s&&void 0!==s&&s.serviceData&&(r.profileData=s.serviceData),localStorage.setItem("servicePortalAuth",JSON.stringify(r))),null===ve||void 0===ve||null===(t=ve.UpdateProfileMode)||void 0===t||t.call(ve,e);const d=2===e?null===n||void 0===n||null===(i=n.businessUserDetails)||void 0===i?void 0:i.profileImage:null===n||void 0===n||null===(a=n.userDetail)||void 0===a?void 0:a.profileImage;var l;if(d)null===ve||void 0===ve||null===(l=ve.UpdateProfileImage)||void 0===l||l.call(ve,d);localStorage.setItem("profileTypeText","product"),ne([]),Ft([]),xi([]),lt(0),ct(0),Wt(0),fi(0),it(1),ot(1),Ut(1),Qt(1),Si(e),Pi(e=>e+1)}catch(s){r.oR.error("Failed to switch profile type")}finally{pe(!1)}},ja=async(e,i)=>{const a=JSON.parse(localStorage.getItem("userProfile")).userDetail.userId;try{let l={productId:e.id,userId:a,businessType:i};pe(!0);const s=await o.A.httpPost("shopify/updateproducttype",l);s.success?(2==i?r.oR.success("Product moved to business listings successfully!"):r.oR.success("Product moved to personal listings successfully!"),null===t||void 0===t||t.Refreshdata(),1==ht&&tt>1?it(1):2==ht&&nt>1?ot(1):Ea(1,1)):(pe(!1),r.oR.error(s.msg))}catch(l){pe(!1),r.oR.error("Getting error while updating product type!")}},Na=async e=>{const t=JSON.parse(localStorage.getItem("userProfile")).userDetail.userId;let i={title:e.Title,description:e.Description,price:e.Price?parseInt(e.Price):null,msrp:e.Msrp?parseInt(e.Msrp):null,otherData:e,dataFinity:e.dataFinity,customproduct:1==e.customProduct?1:0,defaultId:e.Id?e.Id:null,draftId:e.draftId,isAuction:e.isAuction};i.vendorid=t;let l=(0,a.A)((0,a.A)({},e),{},{DefaultProduct:_});i.otherData=l;try{Lt(!0);const e=await o.A.httpPost("shopify/savedraft",i);e.success?(te.draftId=e.data.id,ai(e.msg),Lt(!1),ti(!0),localStorage.setItem("switchToDraftTab",!0)):r.oR.error(e.msg)}catch(s){}};(0,l.useRef)(),(0,l.useEffect)(()=>((0,j.J3)(),window.addEventListener("beforeunload",fa),null!==ge&&(ie((0,a.A)((0,a.A)({},te),ge.obj)),F(ge.product),re(null),P(4)),()=>{ie({}),window.removeEventListener("beforeunload",fa)}),[]);const Sa=e=>{Ct(e.id),At(e.title);const t=e.AllImages?e.AllImages.filter(e=>"image"===e.flag):[];$t(t.length>0?t[0].path:$),ce(!0)},[Ca,ka]=(0,l.useState)(Number),Aa=()=>{P(y+1)},Pa=()=>{ie({}),F({}),re(null),P(1),it(1),ot(1),qe(null),Le(null),Ue(null),Me(null),It(""),Yt({pricefilter:null,Productsort:null,cat1:null,cat2:null,cat3:null,Date:null,brandsort:null,Quantityfilter:null,expiredPricefilter:null,expiredProductsort:null,expiredCat1:null,expiredCat2:null,expiredCat3:null,expiredDate:null,expiredBrandsort:null,expiredQuantityfilter:null}),Nt(null),mt(1),Pi(e=>e+1),Di(null),_i(null)},wa=()=>{P(y-1)},Ia=e=>t=>{const{value:i}=t.target;ie(t=>(0,a.A)((0,a.A)({},t),{},{[e]:i}))},Da=e=>{JSON.parse(localStorage.getItem("userProfile"));try{pe(!0),o.A.ViewProduct("shopify/VendorProduct",e.id).then(t=>{var i,a,l,s,n,o,r,d,c,u,p,h,m,g,v,x,y,f,b,j,N,S,C,k,A,w,I,D,T,_,F,R,W,E,M,B,q,O,L,H,U,z,Q,J,V,G,Y,Z,$,K,X,ee,te,ae,le,se,ne,oe,de,ce,ue,he,me,ge,ve,xe,ye,fe,be,je,Ne,Se,Ce,ke,Ae,Pe,we,Ie,De,Te,_e;re(t.data.product);const Fe=(null===t||void 0===t||null===(i=t.data)||void 0===i||null===(a=i.product)||void 0===a?void 0:a.thirdPartyShipping)||{};let Re={Title:t.data.product.title||(null===e||void 0===e||null===(l=e.Defaultprod)||void 0===l?void 0:l.productTitle)||(null===e||void 0===e?void 0:e.title)||"",Description:t.data.product.description?t.data.product.description:e.description,vendorProduct:t.data.product.vendorProduct?1:0,Price:parseInt(e.ProductPrice),SellBy:t.data.product.SellBy,ShippingWeightIn:t.data.product.ShippingWeightIn,ShippingWidthIn:t.data.product.ShippingWidthIn,ShippingHeightIn:t.data.product.ShippingHeightIn,ShippingDepthIn:t.data.product.ShippingDepthIn,ModelNumber:t.data.product.ModelNumber,UPCNumber:t.data.product.UPCNumber,ProductSKU:t.data.product.ProductSKU,PackageType:t.data.product.PackageType,defaultprodImg:null!==(s=t.data.product)&&void 0!==s&&s.defaultprodImg&&t.data.product.defaultprodImg.length>0?t.data.product.defaultprodImg:[],DiscountedPrice:t.data.product.DiscountedPrice,QuantityState:t.data.product.QuantityState,Quantity:t.data.product.inventoryQuantity,Type:e.type,Condition:t.data.product.productType,dataFinity:e.isDatafinityProduct?1:0,defaultProductId:e.defaultProductId,productClassifications:e.productClassifications,firstTextCloth:t.data.product.clothingStyle,secondTextCloth:t.data.product.clothingType,clothingSize:t.data.product.clothingSize,clothingMaterial:t.data.product.clothingMaterial,clothingColor:t.data.product.clothingColor,CandleType:t.data.product.CandleType,CandleFragrance:t.data.product.CandleFragrance,CandleWaxType:t.data.product.CandleWaxType,CandleBurnTime:t.data.product.CandleBurnTime,CandleContainerMaterial:t.data.product.CandleContainerMaterial,CandleIntensity:t.data.product.CandleIntensity,CandleWickMaterial:t.data.product.CandleWickMaterial,CandleFlameType:t.data.product.CandleFlameType,CandleColor:t.data.product.CandleColor,CandleShape:t.data.product.CandleShape,CandleSize:t.data.product.CandleSize,CandlePackaging:t.data.product.CandlePackaging,CandleSustainabilityFeatures:t.data.product.CandleSustainabilityFeatures,CandleCertifications:t.data.product.CandleCertifications,CandleOccasion:t.data.product.CandleOccasion,CandleTheme:t.data.product.CandleTheme,Classifications:[],firstcategory:null===e||void 0===e||null===(n=e.Defaultprod)||void 0===n?void 0:n.parentcategory,secondcategory:null===e||void 0===e||null===(o=e.Defaultprod)||void 0===o?void 0:o.subcategory,thirdcategory:null===e||void 0===e||null===(r=e.Defaultprod)||void 0===r?void 0:r.productCategoryId,CategoryId:null===e||void 0===e||null===(d=e.Defaultprod)||void 0===d?void 0:d.productCategoryId,ParantCategoryId:null===e||void 0===e||null===(c=e.Defaultprod)||void 0===c?void 0:c.subcategory,parantId:null===e||void 0===e||null===(u=e.Defaultprod)||void 0===u?void 0:u.parentcategory,parantId1:null===e||void 0===e||null===(p=e.Defaultprod)||void 0===p?void 0:p.parentcategory,childId1:null===e||void 0===e||null===(h=e.Defaultprod)||void 0===h?void 0:h.subcategory,unit:{},shippingunits:{},SpecialOrder:!1,WaitingPeriod:"",WaitingPeriodType:"",AdditionalWarranty:[],WarrantyNote:"",ApplyAllNote:!1,markoffer:!0,minimumOfferAmount:"",ShopifyAcces:[],ProductMedia:[],freeshipping:!1,Msrp:"",Warranty:{},shipping_area:"",productImages:[],Addressinfo:null,customproduct:0,zohoid:t.data.product.zohoId,isDeliveryType:t.data.product.isDeliveryType?t.data.product.isDeliveryType:0,isPickupType:t.data.product.isPickupType?t.data.product.isPickupType:0,returnType:(()=>{const e=t.data.product.ReturnType;return e?/^no\s*return$/i.test(String(e).trim())?"No Return":e:"No Return"})(),shipItYourself:!(null===t||void 0===t||null===(m=t.data)||void 0===m||null===(g=m.product)||void 0===g||!g.shipItYourself),neutralMeetingLocation:!(null===t||void 0===t||null===(v=t.data)||void 0===v||null===(x=v.product)||void 0===x||!x.neutralMeetingLocation),neutralMeetingLocationData:(null===t||void 0===t||null===(y=t.data)||void 0===y||null===(f=y.product)||void 0===f?void 0:f.neutralMeetingLocationData)||null,pickupRequireAppointment:!(null===t||void 0===t||null===(b=t.data)||void 0===b||null===(j=b.product)||void 0===j||!j.pickupRequireAppointment),SellerShipping:{shipItYourself:!(null===t||void 0===t||null===(N=t.data)||void 0===N||null===(S=N.product)||void 0===S||!S.shipItYourself),neutralMeetingLocation:!(null===t||void 0===t||null===(C=t.data)||void 0===C||null===(k=C.product)||void 0===k||!k.neutralMeetingLocation),neutralMeetingLocationData:(null===t||void 0===t||null===(A=t.data)||void 0===A||null===(w=A.product)||void 0===w?void 0:w.neutralMeetingLocationData)||null},shipItYourselfData:(null===t||void 0===t||null===(I=t.data)||void 0===I||null===(D=I.product)||void 0===D?void 0:D.shipItYourselfData)||null,prePackagingProofMedia:(null===t||void 0===t||null===(T=t.data)||void 0===T||null===(_=T.product)||void 0===_?void 0:_.prePackagingProofMedia)||(null===t||void 0===t||null===(F=t.data)||void 0===F||null===(R=F.product)||void 0===R?void 0:R.uploadedVerificationMedia)||[],uploadedVerificationMedia:(null===t||void 0===t||null===(W=t.data)||void 0===W||null===(E=W.product)||void 0===E?void 0:E.uploadedVerificationMedia)||(null===t||void 0===t||null===(M=t.data)||void 0===M||null===(B=M.product)||void 0===B?void 0:B.prePackagingProofMedia)||[],prePackagingProofReferenceId:(null===t||void 0===t||null===(q=t.data)||void 0===q||null===(O=q.product)||void 0===O?void 0:O.prePackagingProofReferenceId)||(null===t||void 0===t||null===(L=t.data)||void 0===L||null===(H=L.product)||void 0===H?void 0:H.verificationMediaReferenceId)||"",verificationMediaReferenceId:(null===t||void 0===t||null===(U=t.data)||void 0===U||null===(z=U.product)||void 0===z?void 0:z.verificationMediaReferenceId)||(null===t||void 0===t||null===(Q=t.data)||void 0===Q||null===(J=Q.product)||void 0===J?void 0:J.prePackagingProofReferenceId)||"",thirdParty:!!(null!==(V=Fe.thirdParty)&&void 0!==V?V:null===t||void 0===t||null===(G=t.data)||void 0===G||null===(Y=G.product)||void 0===Y?void 0:Y.thirdParty),uShip:!!(null!==(Z=Fe.uShip)&&void 0!==Z?Z:null===t||void 0===t||null===($=t.data)||void 0===$||null===(K=$.product)||void 0===K?void 0:K.uShip),dolly:!!(null!==(X=Fe.dolly)&&void 0!==X?X:null===t||void 0===t||null===(ee=t.data)||void 0===ee||null===(te=ee.product)||void 0===te?void 0:te.dolly),easyPost:!!(null!==(ae=Fe.easyPost)&&void 0!==ae?ae:null===t||void 0===t||null===(le=t.data)||void 0===le||null===(se=le.product)||void 0===se?void 0:se.easyPost),lugg:!!(null!==(ne=Fe.lugg)&&void 0!==ne?ne:null===t||void 0===t||null===(oe=t.data)||void 0===oe||null===(de=oe.product)||void 0===de?void 0:de.lugg),shipping_tc:!!(null!==(ce=Fe.acceptedTerms)&&void 0!==ce?ce:null===t||void 0===t||null===(ue=t.data)||void 0===ue||null===(he=ue.product)||void 0===he?void 0:he.shipping_tc),thirdPartyShipping:{thirdParty:!!(null!==(me=Fe.thirdParty)&&void 0!==me?me:null===t||void 0===t||null===(ge=t.data)||void 0===ge||null===(ve=ge.product)||void 0===ve?void 0:ve.thirdParty),uShip:!!(null!==(xe=Fe.uShip)&&void 0!==xe?xe:null===t||void 0===t||null===(ye=t.data)||void 0===ye||null===(fe=ye.product)||void 0===fe?void 0:fe.uShip),dolly:!!(null!==(be=Fe.dolly)&&void 0!==be?be:null===t||void 0===t||null===(je=t.data)||void 0===je||null===(Ne=je.product)||void 0===Ne?void 0:Ne.dolly),easyPost:!!(null!==(Se=Fe.easyPost)&&void 0!==Se?Se:null===t||void 0===t||null===(Ce=t.data)||void 0===Ce||null===(ke=Ce.product)||void 0===ke?void 0:ke.easyPost),lugg:!!(null!==(Ae=Fe.lugg)&&void 0!==Ae?Ae:null===t||void 0===t||null===(Pe=t.data)||void 0===Pe||null===(we=Pe.product)||void 0===we?void 0:we.lugg),acceptedTerms:!!(null!==(Ie=Fe.acceptedTerms)&&void 0!==Ie?Ie:null===t||void 0===t||null===(De=t.data)||void 0===De||null===(Te=De.product)||void 0===Te?void 0:Te.shipping_tc)}};if(1==t.data.product.customproduct&&(Re.customproduct=1),t.data.product.Addressinfo&&(Re.Addressinfo=t.data.product.Addressinfo),t.data.product.Warranty&&null!=t.data.product.Warranty.value&&(Re.Warranty=t.data.product.Warranty.value),t.data.product.ReorderImages&&t.data.product.ReorderImages.length>0&&(Re.productImages=t.data.product.ReorderImages),t.data.product.MSRP&&(Re.Msrp=parseInt(t.data.product.MSRP)),t.data.product.freeshipping&&(Re.freeshipping=1==t.data.product.freeshipping),t.data.product.globalfree&&(Re.shipping_area=1==t.data.product.globalfree?"globalfree":""),t.data.product.Lower48free&&(Re.shipping_area=1==t.data.product.Lower48free?"lower48":""),null!==t.data.product.Classifications&&(Re.Classifications=t.data.product.Classifications),null!==t.data.product.ProductMedia){Re.ProductMedia=t.data.product.ProductMedia;for(const e of Re.ProductMedia)e.src=e.path}if(null!==t.data.product.markoffer&&t.data.product.markoffer.value&&null!==t.data.product.markoffer.value&&("json"==t.data.product.markoffer.type?(t.data.product.markoffer.value=t.data.product.markoffer.value.replace(/\\\\/g,"\\").replace(/\\"/g,'"').replace(/^\"|\"$/g,""),t.data.product.markoffer.value=JSON.parse(t.data.product.markoffer.value),"null"==t.data.product.markoffer.value?Re.markoffer=!1:Re.markoffer=JSON.parse(t.data.product.markoffer.value)):Re.markoffer=t.data.product.markoffer.value),console.log("response-----\x3e",t.data.product),console.log("response.data.product.minimumOfferAmount-----\x3e",t.data.product.minimumOfferAmount),console.log("conditioon-----\x3e",null!==t.data.product.minimumOfferAmount&&void 0!==t.data.product.minimumOfferAmount),null!==t.data.product.minimumOfferAmount&&void 0!==t.data.product.minimumOfferAmount){const e=t.data.product.minimumOfferAmount;Re.minimumOfferAmount="string"===typeof e?e.replace(/^"|"$/g,""):String(e)}if(null!==t.data.product.AdditionalWarranty&&null!==t.data.product.AdditionalWarranty.value&&"[]"!=t.data.product.AdditionalWarranty.value&&(Re.AdditionalWarranty=JSON.parse(t.data.product.AdditionalWarranty.value)),null!==t.data.product.WarrantyNote&&""!==t.data.product.WarrantyNote.value&&"null"!=t.data.product.WarrantyNote.value&&(Re.WarrantyNote=t.data.product.WarrantyNote.value),null!==t.data.product.DimensionNote&&""!==t.data.product.DimensionNote.value&&"null"!=t.data.product.DimensionNote.value&&(Re.DimensionNote=t.data.product.DimensionNote.value),null!==t.data.product.Applywarrantynote&&""!==t.data.product.Applywarrantynote.value&&(Re.ApplyAllNote="true"==t.data.product.Applywarrantynote.value),t.data.product.productType&&(Re.Condition=t.data.product.productType),t.data.product.media.edges.length>0){let e=t.data.product.media.edges.map(e=>({src:e.node.preview.image?e.node.preview.image.originalSrc:null}));Re.Media=e}let We=t.data.product;Re.ShopifyAcces=We.Accessories;let Ee=We.Accessories.map(t=>({productDescription:t.description,productSKU:t.productSku?t.productSku:t.variants.edges[0].node.sku?t.variants.edges[0].node.sku:"",productSalePrice:parseInt(t.price),productType:e.type,productTitle:t.title,checked:!0===t.isActive,productImages:t.imageUrl,id:t.id,Quantity:t.inventoryQuantity,Freeplan:!!t.Freeplan&&t.Freeplan}));if(null!==t.data.product.ProductHeight){if(null!==t.data.product.ProductHeight.value&&""!==t.data.product.ProductHeight.value){Re.ProductHeight=JSON.parse(t.data.product.ProductHeight.value),Re.ProductHeightValue=JSON.parse(t.data.product.ProductHeight.value);let e=Re.ProductHeight.match(/[^0-9.]/g),i=e?e.join(""):"";i&&(Re.unit.heightunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ProductHeight=null,Re.ProductHeightValue=null;if(null!==t.data.product.ProductWidth){if(null!==t.data.product.ProductWidth.value&&""!==t.data.product.ProductWidth.value){var Me,Be;Re.ProductWidth=JSON.parse(t.data.product.ProductWidth.value),Re.Width=null===(Me=Re.ProductWidth)||void 0===Me?void 0:Me.ProductWidth,Re.WidthValue=null===(Be=Re.ProductWidth)||void 0===Be?void 0:Be.ProductWidth;let e=Re.Width.match(/[^0-9.]/g),i=e?e.join(""):"";
1i&&(Re.unit.widthunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ProductWidth={ProductWidth:null,ProductHeight:Re.ProductHeight},Re.Width=null,Re.WidthValue=null;if(null!==t.data.product.ProductWeight){if(null!==t.data.product.ProductWeight.value&&""!==t.data.product.ProductWeight.value){Re.ProductWeight=JSON.parse(t.data.product.ProductWeight.value),Re.ProductWeightValue=JSON.parse(t.data.product.ProductWeight.value);let e=Re.ProductWeight.match(/[^0-9.' ']/g),i=e?e.join(""):"";i&&(Re.unit.weightunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ProductWeight=null,Re.ProductWeightValue=null;if(null!==t.data.product.Depth){if(null!==t.data.product.Depth.value&&""!==t.data.product.Depth.value){Re.Depth=JSON.parse(t.data.product.Depth.value),Re.DepthValue=JSON.parse(t.data.product.Depth.value);let e=Re.Depth.match(/[^0-9.]/g),i=e?e.join(""):"";i&&(Re.unit.depthunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.Depth=null,Re.DepthValue=null;if(null!==t.data.product.ShippingHeight){if(null!==t.data.product.ShippingHeight.value&&""!==t.data.product.ShippingHeight.value){Re.ShippingHeight=JSON.parse(t.data.product.ShippingHeight.value);let e=Re.ShippingHeight.match(/[^0-9.]/g),i=e?e.join(""):"";i&&(Re.shippingunits.heightunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ShippingHeight=null;if(null!==t.data.product.ShippingWidth){if(null!==t.data.product.ShippingWidth.value&&""!==t.data.product.ShippingWidth.value){Re.ShippingWidth=JSON.parse(t.data.product.ShippingWidth.value);let e=Re.ShippingWidth.match(/[^0-9.]/g),i=e?e.join(""):"";i&&(Re.shippingunits.widthunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ShippingWidth=null;if(null!==t.data.product.ShippingWeight){if(null!==t.data.product.ShippingWeight.value&&""!==t.data.product.ShippingWeight.value){Re.ShippingWeight=JSON.parse(t.data.product.ShippingWeight.value);let e=Re.ShippingWeight.match(/[^0-9.' ']/g),i=e?e.join(""):"";i&&(Re.shippingunits.weightunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ShippingWeight=null;if(null!==t.data.product.ShippingDepth){if(null!==t.data.product.ShippingDepth.value&&""!==t.data.product.ShippingDepth.value){Re.ShippingDepth=JSON.parse(t.data.product.ShippingDepth.value);let e=Re.ShippingDepth.match(/[^0-9.]/g),i=e?e.join(""):"";i&&(Re.shippingunits.depthunit=null===i||void 0===i?void 0:i.replace(/\s/g,""))}}else Re.ShippingDepth=null;t.data.product.SpecialOrder&&(Re.SpecialOrder=t.data.product.SpecialOrder,delete Re.Quantity),null!==t.data.product.WaitingPeriodType&&(Re.WaitingPeriodType=t.data.product.WaitingPeriodType),null!==t.data.product.WaitingPeriod&&(Re.WaitingPeriod=t.data.product.WaitingPeriod);const qe=e.labels.length;let Oe=e.labels.slice(-qe);Re.categoryName1=Ta(Oe[0]),Re.SubName1=Ta(Oe[1]),Re.ch=Oe[2]?Ta(Oe[2]):"",Re.WarrantyNote=t.data.warrantyDescription?t.data.warrantyDescription:Re.WarrantyNote,Array.isArray(t.data.listingFeatures)?Re.listingFeatures=t.data.listingFeatures:Array.isArray(null===(_e=t.data.product)||void 0===_e?void 0:_e.listingFeatures)?Re.listingFeatures=t.data.product.listingFeatures:Re.listingFeatures=[],setTimeout(()=>{Re.Accessories1=Ee,Re.Accessories=We.tags,pe(!1),ie(Re),P(4)},1e3)}).catch(e=>{console.error(e)})}catch(t){console.error(t)}},Ta=e=>{if(""!=e)return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},_a=e=>{var i,a;pt(!0);let l={key:"Active"==e.status?"Paused":"Active",value:1==e.status,plateform:"web",UserType:(null===(i=JSON.parse(localStorage.getItem("userProfile")))||void 0===i||null===(a=i.user)||void 0===a?void 0:a.businessUserType)||1};e.status;o.A.httpPatch("shopify/VendorProduct/".concat(e.id),l).then(i=>{r.oR.success("Product "+("Active"==e.status?"paused":"activated")+" successfully!"),pt(!1),Ea(),null===t||void 0===t||t.Refreshdata()}).catch(e=>{pt(!1),r.oR.error(e.msg)}),o.A.httpPatch("defaultproductstatuspatch/".concat(e.id),l).then(e=>{}).catch(e=>{})},Fa=e=>{var i,a;pt(!0);let l={Id:e.id,Title:e.title,plateform:"web",UserType:(null===(i=JSON.parse(localStorage.getItem("userProfile")))||void 0===i||null===(a=i.user)||void 0===a?void 0:a.businessUserType)||1};o.A.httpPost("shopify/VendorDupliacteProduct",l).then(e=>{"success"==e.status&&r.oR.success("Product duplicated successfully"),"failed"==e.status&&r.oR.error("error creating product"),"unknown"==e.status&&r.oR.error("error creating product"),pt(!1),Ea(),null===t||void 0===t||t.Refreshdata()}).catch(e=>{pt(!1),r.oR.error(e.msg||"There is shopify server issue, Please try again later!")})},Ra=e=>{Oi(!1),pt(!0),me(!0),le(e),pt(!1)},Wa=async()=>{me(!1),Oi(!1),pt(!0);try{if(3===ht){const e=await o.A.httpPost("shopify/bulkdeletedrafts",{ids:ta?[]:Mi,selectAll:ta});(null===e||void 0===e?void 0:e.success)>0?r.oR.success("".concat(e.success," draft(s) deleted.")):r.oR.warn("Some drafts could not be removed.")}else{var e,i;const t=await o.A.httpPost("shopify/VendorProduct/bulk",{action:"delete",ids:ta?[]:Mi,selectAll:ta,plateform:"web",UserType:Ui()}),a=null!==(e=null===t||void 0===t?void 0:t.success)&&void 0!==e?e:0;a>0&&r.oR.success("".concat(a," listing(s) deleted.")),null!==t&&void 0!==t&&null!==(i=t.failed)&&void 0!==i&&i.length&&r.oR.warn("".concat(t.failed.length," could not be deleted."))}Bi([]),ia(!1),null===t||void 0===t||t.Refreshdata(),1==ht&&tt>1?it(1):2==ht&&nt>1?ot(1):3==ht&&Ht>1?Ut(1):4==ht&&zt>
11&&Qt(1),Ea(1,1)}catch(a){null!==a&&void 0!==a&&a.msg?r.oR.error(a.msg):null!==a&&void 0!==a&&a.message?r.oR.error(a.message):r.oR.error("Bulk delete failed.")}finally{pt(!1)}};(0,l.useEffect)(()=>{const e=localStorage.getItem("authenticated"),t=localStorage.getItem("quote"),a=new URLSearchParams(window.location.search).get("quote");a&&1==a&&t&&1==t&&Se(1);if(1==localStorage.getItem("checkuserbusiness")){JSON.parse(localStorage.getItem("userpermissions")).includes(2)||i("/business-seller-dashboard")}const l=JSON.parse(localStorage.getItem("userProfile"));l&&"seller"!=l.user.role&&i("/dashboard"),e?Ea():i("/signup")},[Ai,Be,Oe,He,Ee,tt,st,nt,jt,Gt,wt,Ht,zt]);const Ea=(e,t)=>{pe(!0);const i={category:Be,subcategory:Oe,brand:He,parent:Ee,page:e||tt,sort:st,page1:t||nt,offset1:rt,ord:jt,pricesort:Gt.pricefilter,productsort:Gt.Productsort,Date:Gt.Date,cat1:Gt.cat1,cat2:Gt.cat2,cat3:Gt.cat3,brandsort:Gt.brandsort,device_type:"web",quantity:Gt.Quantityfilter,query:wt,page2:Ht,page3:zt,expiredpricesort:Gt.expiredPricefilter,expiredproductsort:Gt.expiredProductsort,expiredDate:Gt.expiredDate,expiredcat1:Gt.expiredCat1,expiredcat2:Gt.expiredCat2,expiredcat3:Gt.expiredCat3,expiredbrandsort:Gt.expiredBrandsort,expiredquantity:Gt.expiredQuantityfilter,businessUserType:Ni};o.A.httpGet("shopify/VendorProduct",i).then(e=>{if(e.drafts&&(Ft(e.drafts.rows),Wt(e.drafts.count)),e.expiredAuctions&&(xi(e.expiredAuctions),fi(e.expiredAuctions.TotalProducts)),e.products){for(let t of e.products)"Active"===t.status&<(t.TotalProducts),"Paused"==t.status&&ct(t.TotalProducts);ne(e.products),e.productsCount>0?ka(e.productsCount):ka(e.drafts.count),pe(!1)}else ne([]),ka(0),pe(!1)}).catch(e=>{pe(!1)})},Ma=()=>{je(0)},Ba=async e=>{qe(null),Le(null),Te(null),Ie(null);const{value:t}=e.target;await Me(t),(e=>{let t={id:e};o.A.httpGet("GetParentsSubCategory",t).then(e=>{Ie([...e.subcategory])})})(t),it(1),Qt(1)};function qa(e){if(""!=e&&void 0!=e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}return e}(0,l.useEffect)(()=>{(()=>{const e=JSON.parse(localStorage.getItem("userProfile")),t={search:Re,userId:null===e||void 0===e?void 0:e.userDetail.userId};o.A.httpGet("GetAllProductsBrands",t).then(e=>{e&&e.brand&&ke([...e.brand])})})()},[Re]),(0,l.useEffect)(()=>{if(1==w){const e=new URLSearchParams(window.location.search).get("createlisting");if(e&&(1==e||"1"==e)){JSON.parse(localStorage.getItem("userProfile"));P(2)}I(2)}o.A.httpGet("parentscategory").then(e=>{Pe(e.parent),ee(e.parent)})},[]),(0,l.useCallback)(function(e){let t;return function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];const s=this;t&&clearTimeout(t),t=setTimeout(()=>{e.apply(s,a)},700)}}(function(e){const{value:t}=e.target;""===t&&(Ue(null),it(1)),We(t)}),[]);const Oa=()=>{i("/dashboard")},La=e=>{e.id&&window.open("".concat("https://homeshow.ai/","AllReviews/").concat(e.id))},Ha=e=>{let t=(0,a.A)({},e.otherData);t.draftId=e.id,ie(t),t.DefaultProduct&&F(t.DefaultProduct),re(null),P(4)},Ua=e=>{var t,i,a,l,s,n;const o=(null===e||void 0===e?void 0:e.otherData)||{},r=(null===o||void 0===o?void 0:o.productData)||{},d=(null===o||void 0===o?void 0:o.originalProduct)||{},c=(null===d||void 0===d?void 0:d.originalProduct)||{},u=String((null===e||void 0===e?void 0:e.title)||"").trim(),p=String((null===o||void 0===o?void 0:o.mainCategoryName)||(null===o||void 0===o?void 0:o.categoryName)||(null===r||void 0===r?void 0:r.mainCategoryName)||(null===r||void 0===r?void 0:r.categoryName)||(null===d||void 0===d?void 0:d.mainCategoryName)||(null===d||void 0===d?void 0:d.categoryName)||"").trim(),h=String((null===o||void 0===o?void 0:o.subCategoryName)||(null===o||void 0===o?void 0:o.categoryName1)||(null===r||void 0===r?void 0:r.subCategoryName)||(null===r||void 0===r?void 0:r.categoryName1)||(null===d||void 0===d?void 0:d.subCategoryName)||(null===d||void 0===d?void 0:d.categoryName1)||"").trim(),m=String((null===o||void 0===o?void 0:o.productBrandName)||(null===r||void 0===r?void 0:r.productBrandName)||(null===d||void 0===d?void 0:d.productBrandName)||(null===o||void 0===o?void 0:o.productBrandCode)||(null===r||void 0===r?void 0:r.productBrandCode)||(null===d||void 0===d?void 0:d.productBrandCode)||(null===o||void 0===o?void 0:o.brandsss)||(null===r||void 0===r?void 0:r.brandsss)||(null===d||void 0===d?void 0:d.brandsss)||(null===o||void 0===o?void 0:o.brandCode)||(null===r||void 0===r?void 0:r.brandCode)||(null===d||void 0===d?void 0:d.brandCode)||"").trim(),g=String((null===o||void 0===o?void 0:o.parentId)||
1(null===o||void 0===o?void 0:o.parent)||(null===o||void 0===o?void 0:o.parentcategory)||(null===r||void 0===r?void 0:r.parentId)||(null===r||void 0===r?void 0:r.parent)||(null===r||void 0===r?void 0:r.parentcategory)||(null===d||void 0===d?void 0:d.parentId)||(null===d||void 0===d?void 0:d.parent)||(null===d||void 0===d?void 0:d.parentcategory)||(null===c||void 0===c?void 0:c.parentId)||(null===c||void 0===c?void 0:c.parentcategory)||"").trim(),v=String((null===o||void 0===o?void 0:o.categoryId)||(null===o||void 0===o?void 0:o.category)||(null===o||void 0===o?void 0:o.cat1)||(null===o||void 0===o?void 0:o.mainCategoryId)||(null===r||void 0===r?void 0:r.categoryId)||(null===r||void 0===r?void 0:r.category)||(null===r||void 0===r?void 0:r.cat1)||(null===r||void 0===r?void 0:r.mainCategoryId)||(null===d||void 0===d?void 0:d.categoryId)||(null===d||void 0===d?void 0:d.category)||(null===d||void 0===d?void 0:d.cat1)||(null===d||void 0===d?void 0:d.mainCategoryId)||"").trim(),x=String((null===o||void 0===o?void 0:o.subCategoryId3)||(null===o||void 0===o?void 0:o.subCategoryId)||(null===o||void 0===o?void 0:o.subcategory)||(null===o||void 0===o?void 0:o.cat2)||(null===r||void 0===r?void 0:r.subCategoryId3)||(null===r||void 0===r?void 0:r.subCategoryId)||(null===r||void 0===r?void 0:r.subcategory)||(null===r||void 0===r?void 0:r.cat2)||(null===d||void 0===d?void 0:d.subCategoryId3)||(null===d||void 0===d?void 0:d.subCategoryId)||(null===d||void 0===d?void 0:d.subcategory)||(null===d||void 0===d?void 0:d.cat2)||"").trim(),y=String((null===e||void 0===e?void 0:e.productSource)||(null===r||void 0===r?void 0:r.productSource)||(null===d||void 0===d?void 0:d.productSource)||"").trim(),f=1==(null===o||void 0===o||null===(t=o.AuctionStates)||void 0===t?void 0:t.sellingformat)?"auction":"fixed",b=Number(null!==(i=null!==(a=null!==(l=null!==(s=null!==(n=null===o||void 0===o?void 0:o.Price)&&void 0!==n?n:null===r||void 0===r?void 0:r.Price)&&void 0!==s?s:null===o||void 0===o?void 0:o.ProductPrice)&&void 0!==l?l:null===r||void 0===r?void 0:r.ProductPrice)&&void 0!==a?a:null===d||void 0===d?void 0:d.ProductPrice)&&void 0!==i?i:0),j=String((null===o||void 0===o?void 0:o.productBrandCode)||(null===r||void 0===r?void 0:r.productBrandCode)||(null===d||void 0===d?void 0:d.productBrandCode)||(null===o||void 0===o?void 0:o.brandCode)||(null===r||void 0===r?void 0:r.brandCode)||(null===d||void 0===d?void 0:d.brandCode)||"").trim();return{title:u,mainCategoryName:p,subCategoryName:h,brand:m,brandCode:j,parentId:g,categoryId:v,subCategoryId:x,source:y,listingType:f,draftPrice:b,parentNameCandidates:[p,String((null===o||void 0===o?void 0:o.parentName)||(null===r||void 0===r?void 0:r.parentName)||(null===d||void 0===d?void 0:d.parentName)||"")].filter(Boolean),categoryNameCandidates:[String((null===o||void 0===o?void 0:o.categoryName)||(null===r||void 0===r?void 0:r.categoryName)||(null===d||void 0===d?void 0:d.categoryName)||""),p].filter(Boolean),subCategoryNameCandidates:[String((null===o||void 0===o?void 0:o.categoryName1)||(null===r||void 0===r?void 0:r.categoryName1)||(null===d||void 0===d?void 0:d.categoryName1)||""),h].filter(Boolean),brandNameCandidates:[m,j,String((null===o||void 0===o?void 0:o.productBrandName)||(null===r||void 0===r?void 0:r.productBrandName)||(null===d||void 0===d?void 0:d.productBrandName)||""),String((null===o||void 0===o?void 0:o.productBrandCode)||(null===r||void 0===r?void 0:r.productBrandCode)||(null===d||void 0===d?void 0:d.productBrandCode)||""),String((null===o||void 0===o?void 0:o.brandCodeDescription)||(null===r||void 0===r?void 0:r.brandCodeDescription)||(null===d||void 0===d?void 0:d.brandCodeDescription)||"")].filter(Boolean)}},za=(0,l.useMemo)(()=>!!(wt||jt||Ee||Be||Oe||He),[wt,jt,Ee,Be,Oe,He]),Qa=(0,l.useMemo)(()=>{let e=Array.isArray(_t)?[..._t]:[];const t=String(wt||"").trim().toLowerCase(),i=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return!0;const l=String(e).trim(),s=l.toLowerCase();if(String(t||"").trim()===l)return!0;const n=(i||[]).map(e=>
1String(e||"").trim().toLowerCase()).filter(Boolean);if(n.includes(s))return!0;if(n.some(e=>e.includes(s)||s.includes(e)))return!0;const o=(a||[]).find(e=>String(null===e||void 0===e?void 0:e.value)===l),r=String((null===o||void 0===o?void 0:o.label)||"").trim().toLowerCase();return!!r&&(!!n.includes(r)||n.some(e=>e.includes(r)||r.includes(e)))};if(e=e.filter(e=>{const a=Ua(e),l=!t||[a.title,a.mainCategoryName,a.subCategoryName,a.brand,a.source].filter(Boolean).join(" ").toLowerCase().includes(t),s=i(Ee,a.parentId,a.parentNameCandidates,null===Ae||void 0===Ae?void 0:Ae.map(e=>({value:e.id,label:e.categoryName}))),n=i(Be,a.categoryId,[...a.categoryNameCandidates,...a.subCategoryNameCandidates],null===we||void 0===we?void 0:we.map(e=>({value:e.id,label:e.categoryName}))),o=i(Oe,a.subCategoryId,a.subCategoryNameCandidates,null===De||void 0===De?void 0:De.map(e=>({value:e.id,label:e.categoryName}))),r=i(He,a.brandCode||a.brand,a.brandNameCandidates,null===Ce||void 0===Ce?void 0:Ce.map(e=>({value:e.brandCode,label:e.brandCodeDescription})));return l&&s&&n&&o&&r}),jt){const t=e=>new Date((null===e||void 0===e?void 0:e.createdAt)||0).getTime(),i=e=>String((null===e||void 0===e?void 0:e.title)||"").toLowerCase();e.sort((e,a)=>{const l=Ua(e),s=Ua(a);switch(jt){case"title_asc":return i(e).localeCompare(i(a));case"title_desc":return i(a).localeCompare(i(e));case"new":return t(a)-t(e);case"old":return t(e)-t(a);case"price_asc":return(l.draftPrice||0)-(s.draftPrice||0);case"price_desc":return(s.draftPrice||0)-(l.draftPrice||0);case"Auctions":return"auction"===l.listingType?-1:1;case"Fixed":return"fixed"===l.listingType?-1:1;default:return 0}})}return e},[_t,wt,Ee,Be,Oe,He,jt,Ae,we,De,Ce]),Ja=()=>{if(1!==Mi.length)return null;const e=Mi[0];if(1===ht||2===ht){for(const t of se)if(null!==t&&void 0!==t&&t.products){const i=t.products.find(t=>t.id===e);if(i)return{kind:"vendor",product:i}}}else if(3===ht){const t=(Qa||[]).find(t=>t.id===e);if(t)return{kind:"draft",draft:t}}else if(4===ht&&null!==vi&&void 0!==vi&&vi.products){const t=vi.products.find(t=>t.id===e);if(t)return{kind:"vendor",product:t}}return null},Va=e=>{Ei(e),Ri(!0)},Ga=()=>{Ri(!1),Ei(null)},Ya=(0,l.useMemo)(()=>{var e,t,i,a,l;return 1===ht?(null===(e=se.find(e=>"Active"===e.status))||void 0===e||null===(t=e.products)||void 0===t?void 0:t.length)||0:2===ht?(null===(i=se.find(e=>"Paused"===e.status))||void 0===i||null===(a=i.products)||void 0===a?void 0:a.length)||0:3===ht?(null===Qa||void 0===Qa?void 0:Qa.length)||0:4===ht&&(null===vi||void 0===vi||null===(l=vi.products)||void 0===l?void 0:l.length)||0},[ht,se,Qa,vi]),Za=(0,l.useMemo)(()=>{switch(ht){case 1:return at;case 2:return dt;case 3:return za?Qa.length:Rt;case 4:return yi;default:return 0}},[ht,at,dt,Rt,yi,za,Qa.length]),$a=Za||Ya,Ka=ta||Mi.length>0,Xa=(0,l.useMemo)(()=>{if(qi){const e=ta?Za:Mi.length,t=3===ht?"draft":"listed product",i=1===(ta?Za:Mi.length)?"":"s";return ta?"You are about to delete all ".concat(Za," ").concat(t).concat(i,". This cannot be undone."):"You are about to delete ".concat(e," ").concat(t).concat(i,". This cannot be undone.")}return"This listed product will be removed from your account. This cannot be undone."},[ht,qi,ta,Mi.length,Za]),el=()=>{Bi([]),ia(!1)},tl=[{key:"add",label:"Add New Listing",icon:O.OiG,primary:!0,onClick:e=>{var i,a;e.preventDefault(),e.stopPropagation();const l={1:t.IndividualUsage.ActiveListings,2:t.BusinessPlanUsage.ActiveListings}[t.userType],s=parseInt((null===l||void 0===l?void 0:l.auto)||0)+parseInt((null===l||void 0===l?void 0:l.vendor)||0)||0,n=1===t.userType?null===t||void 0===t||null===(i=t.IndividualUsage)||void 0===i?void 0:i.ProductListingsLimit:null===t||void 0===t||null===(a=t.BusinessPlanUsage)||void 0===a?void 0:a.ProductListingsLimit;if("Unlimited"!==n&&"unlimited"!==n&&s>=parseInt(n))return void r.oR.error("You have reached the maximum listing limit for your current plan. Please upgrade your plan to add more listings.");JSON.parse(localStorage.getItem("userProfile"));P(2)}},{key:"integrations",label:"Integrations",icon:B.Pk,primary:!0,onClick:()=>{pa()}},{key:"import",label:"Import/Export",icon:B.rQ,primary:!0,onClick:()=>{i("/importexport-listing")}}],il=(0,l.useMemo)(()=>[{id:1,label:"Active",count:at||0},{id:2,label:"Paused",count:dt||0},{id:3,label:"Drafts",count:Rt||0},{id:4,label:"Expired",count:yi||0}],[at,dt,Rt,yi]),al=(0,l.useMemo)(()=>[{id:"brands",placeholder:"All Brands",options:Ce.map(e=>({value:e.brandCode,label:e.brandCodeDescription})),value:He||"",onChange:e=>{Ue(e||null),it(1)},searchable:!0},{id:"types",placeholder:"All Types",options:[],options:(Ae||[]).map(e=>({value:e.id,label:e.categoryName})),value:Ee||"",searchable:!1,onChange:e=>{Ba({target:{value:e}})}},{id:"categories",placeholder:"All Categories",options:(we||[]).map(e=>({value:e.id,label:e.categoryName})),value:Be||"",onChange:e=>{(e=>{Le(null),Te(null);const{value:t}=e.target,i={id:t};o.A.httpGet("getSecondchild",i).then(e=>{e.child&&Te(e.child)}),qe(t),it(1)})({target:{value:e}})},searchable:!1},{id:"subcategories",placeholder:"All Sub Categories",options:(De||[]).map(e=>({value:e.id,label:e.categoryName})),value:Oe||"",onChange:e=>{(e=>{const{value:t}=e.target;Le(t),it(1)})({target:{value:e}})},searchable:!0}],[Ce,He,Ae,Ee,we,De,Be]),ll=(0,l.useMemo)(()=>{let e=!1;return e=He||Oe||Be||Ee||wt||jt,e},[He,Oe,Be,Ee,wt,jt]),sl=(0,l.useMemo)(()=>{let e=[{label:"Title A-Z",value:"title_asc"},{label:"Title Z-A",value:"title_desc"},{label:"Price: Low to High",value:"price_asc"},{label:"Price: High to Low",value:"price_desc"},{label:"Newest",value:"new"},{label:"Oldest",value:"old"},{label:"Auctions",value:"Auctions"},{label:"Fixed",value:"Fixed"}];return 4===ht&&(e=[{label:"Title A-Z",value:"title_asc"},{label:"Title Z-A",value:"title_desc"},{label:"Newest",value:"new"},{label:"Oldest",value:"old"}]),e},[ht]),nl=ue||ut&&!he;return(0,T.jsxs)("div",{className:"".concat($e," main-listingclsinnn main-listingclsinnnnewinn "),"data-ths-ui-theme":ve.Darkmode?"dark":"light",children:[(0,T.jsx)(V.p8,{show:nl,fixed:!0,title:ue?"Loading listings":"Processing",description:ue?"Fetching your product listings.":"Updating your listings\u2026"}),(0,T.jsx)("section",{className:"dashboard-section ".concat($e),children:(0,T.jsx)("div",{className:"container my-listing-section-1 cstmproductlistinnn-clsss",children:"Products"!=Kt?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(N.A,{HandleToggle:e=>{const{value:t}=e.target;Xt(t)},GotoDashboard:Oa,data:Kt})}):(0,T.jsx)(T.Fragment,{children:1==be?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(d.A,{back:Ma,backAddCsvListing:Ma,showLoader:e=>{pe(1==e)}})}):(0,T.jsxs)(T.Fragment,{children:[1==y&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"main-content price-filter cutome-filter-bx ".concat($e),children:[(0,T.jsx)(q.n,{onClick:Oa,darkMode:ve.Darkmode,text:"Dashboard",showIcon:!0,className:$e},"dash-link"),(0,T.jsx)(M.dr,{Plateform:"live",listingActions:tl,statusTabs:il,handleStatusTabChange:mt,activeStatusId:ht,handleSearchChange:ga,query:wt,filterDropdowns:al,SearchRef:Tt,showFilterDropdown:Ci,setShowFilterDropdown:ki,Darkbg:Ke,textdark:Ze,SubscriptionUsage:t,DarkTheme:ve.Darkmode,ShowReset:ll,handleSortChange:e=>{Nt(""==e?null:e),Yt(e=>(0,a.A)({},Object.fromEntries(Object.keys(e).map(e=>[e,null]))))},sortValue:jt,sortOptions:sl,ResetFilters:()=>{It(""),Ue(null),Le(null),Me(null),qe(null),Nt(null),it(1),ot(1),Ut(1),Qt(1)}},"listing-header"),"individual"!=Hi&&(0,T.jsxs)("div",{className:"listings-profile-switch",children:[(0,T.jsx)("button",{type:"button",className:"listings-profile-switch-btn ".concat(1===Ni?"active":""),onClick:()=>ba(1),children:"Personal"}),(0,T.jsx)("button",{type:"button",className:"listings-profile-switch-btn ".concat(2===Ni?"active":""),onClick:()=>ba(2),children:"Business"})]})]}),Ka&&(0,T.jsxs)("div",{className:"listing-action-bar-inline ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("div",{className:"action-bar-left",children:(0,T.jsx)("div",{className:"action-bar-info",children:(0,T.jsxs)("div",{className:"action-bar-text",children:[(0,T.jsx)("span",{className:"action-bar-label",children:ta?"All ".concat($a," listings selected"):"".concat(1===Mi.length?"1 item":"".concat(Mi.length," items")," selected")}),(0,T.jsx)("div",{className:"action-bar-selection-controls",children:ta?(0,T.jsx)("button",{type:"button",className:"action-btn action-btn--select-all is-active",onClick:el,children:"Clear all listings selection"}):(0,T.jsxs)("button",{type:"button",className:"action-btn action-btn--select-all",onClick:()=>{Bi((()=>{let e=[];return 1===ht||2===ht?se.forEach(t=>{t.products&&t.products.length>
10&&t.products.forEach(i=>{(1===ht&&"Active"===t.status||2===ht&&"Paused"===t.status)&&e.push(i.id)})}):3===ht?(Qa||[]).forEach(t=>e.push(t.id)):4===ht&&vi&&vi.products&&vi.products.forEach(t=>e.push(t.id)),e})()),ia(!0)},children:["Select all ",$a," listings in database"]})})]})})}),(0,T.jsxs)("div",{className:"action-bar-buttons",role:"toolbar","aria-label":"Bulk listing actions",children:[!ta&&1===Mi.length&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("button",{type:"button",className:"action-btn",onClick:()=>{var e;const t=Ja();t?("draft"===t.kind?Ha(t.draft):1===(null===(e=t.product)||void 0===e?void 0:e.sellingformat)?(ui(t.product.id),si(!0)):Da(t.product),Bi([])):r.oR.error("Could not open this listing.")},title:"Edit this listing",children:[(0,T.jsx)(D.SG1,{}),(0,T.jsx)("span",{className:"action-btn-text",children:"Edit"})]}),(1===ht||2===ht||4===ht)&&(0,T.jsxs)("button",{type:"button",className:"action-btn",onClick:()=>{const e=Ja();e&&"draft"!==e.kind?(Fa(e.product),Bi([])):r.oR.error("Select a published listing to duplicate.")},title:"Duplicate this listing",children:[(0,T.jsx)(D.nxz,{}),(0,T.jsx)("span",{className:"action-btn-text",children:"Duplicate"})]})]}),!ta&&(1===ht||2===ht||3===ht||4===ht)&&(0,T.jsxs)("button",{type:"button",className:"action-btn",onClick:()=>{if(0===Mi.length)return;if(Mi.length>1)return void r.oR.info("Select a single listing to get a share link.");const e=Ja();e&&"draft"!==e.kind?Sa(e.product):r.oR.error("Select a single published listing to share.")},title:"Get share link (single selection)",children:[(0,T.jsx)(D.Pum,{}),(0,T.jsx)("span",{className:"action-btn-text",children:"Share"})]}),(1===ht||2===ht)&&(0,T.jsxs)(T.Fragment,{children:[1===ht&&(0,T.jsxs)("button",{type:"button",className:"action-btn",onClick:()=>aa("pause"),children:[(0,T.jsx)(D.GHw,{}),(0,T.jsxs)("span",{className:"action-btn-text",children:["Pause ",ta?"all (".concat(Za,")"):Mi.length>1?"all":""]})]}),2===ht&&(0,T.jsxs)("button",{type:"button",className:"action-btn",onClick:()=>aa("activate"),children:[(0,T.jsx)(D.aze,{}),(0,T.jsxs)("span",{className:"action-btn-text",children:["Activate ",ta?"all (".concat(Za,")"):Mi.length>1?"all":""]})]})]}),(ta||Mi.length>1)&&(1===ht||2===ht)&&(0,T.jsxs)("button",{type:"button",className:"action-btn action-btn--ghost",onClick:()=>{Ea(1,1),r.oR.success("Listings refreshed")},title:"Reload data from server",children:[(0,T.jsx)(D.jTZ,{}),(0,T.jsx)("span",{className:"action-btn-text",children:"Refresh"})]}),(0,T.jsxs)("button",{type:"button",className:"action-btn action-btn--danger",onClick:()=>{(ta||0!==Mi.length)&&(Oi(!0),me(!0))},children:[(0,T.jsx)(D.IXo,{}),(0,T.jsx)("span",{className:"action-btn-text",children:"Delete"})]}),(0,T.jsx)("button",{type:"button",className:"action-btn action-btn--icon-only cancel",onClick:el,title:"Clear selection",children:(0,T.jsx)(D.yGN,{})})]})]}),(0,T.jsxs)("div",{id:"tabs-content",className:"custom-cls-productlisting",children:[(0,T.jsxs)("div",{className:"lasting-tables-form inclsssstab-insectnnn",id:"tab1",style:1==ht?{display:"block"}:{display:"none"},children:[(0,T.jsx)("div",{className:"main-content price-filter",children:(0,T.jsx)("section",{className:"".concat(ve.Darkmode?"darksecondry myprofile-info-section":"myprofile-info-section"),children:(0,T.jsx)("div",{className:"myprofile-info-box customclssproductlisting",children:(0,T.jsx)("div",{className:"myprofile-info-option-detail-box listing-act",children:(0,T.jsx)("div",{className:"tabling tabling-listing",children:(0,T.jsx)("div",{className:"table-wrapper ",style:{minHeight:"170px"},children:(0,T.jsxs)("table",{children:[(0,T.jsx)("thead",{style:{position:"relative",zIndex:"1"},children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.length>0&&se.some(e=>"Active"===e.status&&e.products.length>0)&&Mi.length===se.reduce((e,t)=>
1"Active"===t.status?e+t.products.length:e,0),onChange:e=>{e.target.checked||ia(!1),zi(e)}}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Productsort",null==Gt.Productsort||"DESC"==Gt.Productsort?"ASC":"DESC")},children:["Product",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Productsort?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Productsort?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("pricefilter",null==Gt.pricefilter||"PriceDsc"==Gt.pricefilter?"PriceAsc":"PriceDsc")},children:["Price",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.pricefilter?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"PriceAsc"==Gt.pricefilter?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Listing Type"}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Quantityfilter",null==Gt.Quantityfilter?"ASC":"ASC"==Gt.Quantityfilter?"DESC":"ASC")},children:["Quantity",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Quantityfilter?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Quantityfilter?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("brandsort",null==Gt.brandsort||"DESC"==Gt.brandsort?"ASC":"DESC")},children:["Brand",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.brandsort?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.brandsort?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("cat1",null==Gt.cat1||"DESC"==Gt.cat1?"ASC":"DESC")},children:["Product Type",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.cat1?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.cat1?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("cat2",null==Gt.cat2||"DESC"==Gt.cat2?"ASC":"DESC")},children:["Category",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.cat2?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.cat2?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Date",null==Gt.Date||"DESC"==Gt.Date?"ASC":"DESC")},children:["Date",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Date?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Date?(0,T.jsx)("img",{style:{rotate:"180deg",width:"12px"},src:Z}):(0,T.jsx)("img",{style:{width:"12px"},src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Source"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Action"})]})}),(0,T.jsx)("tbody",{children:se.map((e,t)=>(0,T.jsx)(T.Fragment,{children:"Active"==e.status?(0,T.jsx)(T.Fragment,{children:e.products.length>0?(0,T.jsx)(T.Fragment,{children:e.products.map((e,t)=>{var l,s,n,d,c;let u=null!==(null===e||void 0===e?void 0:e.Images)?null===e||void 0===e?void 0:e.Images:null;return null!==e&&void 0!==e&&e.mainImage&&(u=e.mainImage),null!==e&&void 0!==e&&e.title&&(e.title=(0,j.Ef)(null===e||void 0===e?void 0:e.title)),(0,T.jsxs)("tr",{className:ta||Mi.includes(e.id)?"selected-row":"",children:[(0,T.jsx)("td",{style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.includes(e.id),onChange:()=>Qi(e.id)}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsx)("td",{className:"relative quick-edit-cell",children:(0,T.jsxs)("div",{className:"d-flex align-start text-start listings-productss",children:[(0,T.jsx)("div",{className:"img-sect cusomimgsection cursor-pointer",onClick:()=>{window.open((0,j.G1)("".concat("https://homeshow.ai/","productinfo/"),e.title,e.id))},children:(0,T.jsx)(T.Fragment,{children:null!==e&&void 0!==e&&e.AllImages&&(null===e||void 0===e?void 0:e.AllImages.length)>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.AllImages[0].path?e.AllImages[0].path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image",style:{width:"98px",height:"87px"}}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:1==e.AllImages[0].manufacturerImage?G:Y,title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image"})]}):u?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==u?u:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",title:"Seller",style:{width:"98px",height:"87px"}}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]}):e.Media.length>0?e.Media.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.node.preview.image?e.node.preview.image.originalSrc:$,onError:e=>{e.target.src=$},className:"",style:{width:"98px",height:"87px"},alt:"stars_img",title:"Seller"}
1,t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]})}):(null===e||void 0===e||null===(l=e.defaultprodImg)||void 0===l?void 0:l.length)>0?e.defaultprodImg.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.path?e.path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Manufacture"},t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:G,title:"Stock image"})]})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("img",{src:$,className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Stock image"})})})}),la===e.id&&"title"===na?(0,T.jsxs)("div",{className:"quick-edit-form quick-edit-form--title",onClick:e=>e.stopPropagation(),children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"text",placeholder:"Title",value:ra.title,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{title:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{type:"button",className:"quick-edit-save",onClick:e=>{e.stopPropagation(),Gi()},disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{type:"button",className:"quick-edit-cancel",onClick:e=>{e.stopPropagation(),Vi()},children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",style:{alignItems:"flex-start",flex:1,minWidth:0},children:[(0,T.jsxs)("span",{"data-testid":"product-title",style:{wordWrap:"break-word",flex:1,minWidth:0,cursor:"pointer"},className:"".concat(et," ac-text"),title:e.title,onClick:()=>{window.open((0,j.G1)("".concat("https://homeshow.ai/","productinfo/"),e.title,e.id))},children:[(null===e||void 0===e||null===(s=e.title)||void 0===s?void 0:s.length)>40?(null===e||void 0===e||null===(n=e.title)||void 0===n?void 0:n.substring(0,40))+"...":null===e||void 0===e?void 0:e.title,(0,T.jsxs)("span",{className:"d-flex align-center para",children:[(0,T.jsx)(S.A,{margin:"0px",Rating:Array.isArray(null===e||void 0===e?void 0:e.Rating)&&e.Rating.length>0&&null!=(null===(d=e.Rating[0])||void 0===d?void 0:d.avgrating)?Number(e.Rating[0].avgrating).toFixed(1):0}),(0,T.jsxs)("span",{style:{width:"35px"},children:[" (",Array.isArray(null===e||void 0===e?void 0:e.Rating)&&e.Rating.length>0&&null!=(null===(c=e.Rating[0])||void 0===c?void 0:c.avgrating)?Number(e.Rating[0].avgrating).toFixed(1):0,") "]})]}),"sku: ",(0,T.jsx)("p",{"data-testid":"product-sku",className:"p-sku ".concat(Ze),children:e.homeShowId||"N/A"})]}),(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",style:{marginTop:2},onClick:t=>{t.stopPropagation(),Ji(e,"title")},title:"Quick edit title"})]})]})}),(0,T.jsx)("td",{className:"price-msrp quick-edit-cell",children:1!=(null===e||void 0===e?void 0:e.sellingformat)&&la===e.id&&"price"===na?(0,T.jsxs)("div",{className:"quick-edit-form",children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"number",min:"0",placeholder:"Price",value:ra.price,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{price:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{className:"quick-edit-save",onClick:Gi,disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{className:"quick-edit-cancel",onClick:Vi,children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",children:[(0,T.jsxs)("a",{href:"","data-testid":"product-price",onClick:e=>{e.preventDefault()},className:"cursor-auto",children:["$",parseInt(1==e.is_auction?e.buyitnowprice?e.buyitnowprice:e.startingbid:e.ProductPrice)]}),1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",onClick:()=>Ji(e,"price"),title:"Quick edit price"})]})}),(0,T.jsx)("td",{className:"".concat(et," auctin-mainclsss"),children:1==(null===e||void 0===e?void 0:e.sellingformat)?(0,T.jsx)("p",{"data-testid":"product-selling-format",className:"auctionin-claaasss",children:"Auction"}):(0,T.jsx)("p",{"data-testid":"product-selling-format",className:"fixedinn-claaasss",children:"Fixed"})}),(0,T.jsx)("td",{className:"".concat(et," quick-edit-cell"),"data-testid":"product-quantity",children:1!=(null===e||void 0===e?void 0:e.sellingformat)&&la===e.id&&"quantity"===na?(0,T.jsxs)("div",{className:"quick-edit-form",children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"number",min:"0",placeholder:"Qty",value:ra.quantity,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{quantity:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{className:"quick-edit-save",onClick:Gi,disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{className:"quick-edit-cancel",onClick:Vi,children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",children:[e.Quantity,1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",onClick:()=>Ji(e,"quantity"),title:"Quick edit quantity"})]})}),(0,T.jsx)("td",{className:"".concat(et),title:e.brandsss?e.brandsss:"","data-testid":"product-brand",children:(0,T.jsx)("div",{className:"showlisting-brands-div-1",children:e.brandsss?e.brandsss.length>10?qa(e.brandsss.substring(0,10))+"...":qa(e.brandsss):(0,T.jsx)("p",{style:{fontSize:"14px",color:Ze?"#fff":"#000"},children:"NA"})})}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[0]?e.labels[0]:"","data-testid":"product-label-0",children:void 0!==e.labels[0]?qa(e.labels[0]):""}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[1]?e.labels[1]:"","data-testid":"product-label-1",children:void 0!==e.labels[1]?e.labels[1].length>10?qa(e.labels[1].substring(0,10))+"...":qa(e.labels[1]):(0,T.jsx)("p",{style:{textAlign:"center"},children:"-"})}),(0,T.jsx)("td",{className:"".concat(et),"data-testid":"product-created-at",children:f()(e.createdAt).format("MM-DD-YYYY")}
1),(0,T.jsx)("td",{className:"".concat(et),children:e.productSource?(0,T.jsx)("span",{style:{display:"inline-block",padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",textTransform:"capitalize",background:"linear-gradient(135deg, #0083e2 0%, #0066b3 100%)",color:"white",boxShadow:"0 2px 4px rgba(0, 131, 226, 0.2)",width:"auto"},title:e.productSource,"data-testid":"product-source",children:e.productSource.substring(0,1).toUpperCase()}):(0,T.jsx)("span",{style:{fontSize:"14px",color:Ze?"#999":"#666"},children:"-"})}),(0,T.jsx)("td",{className:"position-relative canchange",children:(0,T.jsxs)(g.A,{children:[(0,T.jsxs)(g.A.Toggle,{variant:"light",className:"listing-action-toggle listing-action-toggle--icon",id:"dropdown-basic","data-testid":"product-actions-toggle","aria-label":"Actions",children:[(0,T.jsx)(D.ZZB,{size:18,"aria-hidden":!0}),(0,T.jsx)("span",{className:"visually-hidden","data-testid":"product-actions",children:"Actions"})]}),(0,T.jsxs)(g.A.Menu,{renderOnMount:!0,popperConfig:{strategy:"fixed",modifiers:[{name:"preventOverflow",options:{boundary:"viewport"}}]},children:[1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsxs)(T.Fragment,{children:[755!=e.Defaultprod.parentcategory&&(0,T.jsx)(g.A.Item,{"data-testid":"accessories-item",onClick:()=>{i("/accessories-listing/"+e.id)},children:"Accessories"}),(0,T.jsx)(g.A.Item,{"data-testid":"duplicate-item",onClick:()=>Fa(e),children:"Duplicate"}),(0,T.jsx)(g.A.Item,{"data-testid":"pause-item",onClick:()=>_a(e),children:"Pause"}),(0,T.jsx)(g.A.Item,{"data-testid":"delete-item",onClick:()=>Ra(e),children:"Delete"}),1==e.checkBoost?(0,T.jsx)(g.A.Item,{"data-testid":"edit-boost-item",onClick:()=>(e=>{let t=(0,j.G1)("/boost-product/",e.title,e.id);i("".concat(t))})(e),children:"Edit Boost"}):"",(0,T.jsx)(g.A.Item,{"data-testid":"boost-item",onClick:()=>(e=>{const t=e.Quantity;if(1==e.checkBoost){pt(!0);let t={productId:e.id,type:"product"};o.A.httpGet("UnBoostVendorProduct",t).then(e=>{e.status&&r.oR.success("Product unboosted successfully"),pt(!1),Ea()}).catch(e=>{pt(!1)})}else{if(t<1)return void r.oR.error("Product out of stock can not boost.");let a=(0,j.G1)("/boost-product/",e.title,e.id);i("".concat(a))}})(e),children:1==(null===e||void 0===e?void 0:e.checkBoost)?"Unboost":"Boost"})]}),(0,T.jsx)(g.A.Item,{"data-testid":"share-item",onClick:()=>Sa(e),children:"Share"}),(0,T.jsx)(g.A.Item,{"data-testid":"reviews-item",onClick:()=>La(e),children:"Reviews"}),1==(null===e||void 0===e?void 0:e.sellingformat)?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(g.A.Item,{"data-testid":"edit-item",onClick:()=>{ui(e.id),si(!0)},children:"Edit"}),(0,T.jsx)(g.A.Item,{"data-testid":"delete-item",onClick:()=>Ra(e),children:"Delete"})]}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(g.A.Item,{"data-testid":"edit-item",onClick:()=>Da(e),children:"Edit"})}),"individual"!==Hi&&(1==Ni?(0,T.jsx)(g.A.Item,{"data-testid":"move-to-business-item",onClick:()=>ja(e,2),children:"Move to business"}):(0,T.jsx)(g.A.Item,{"data-testid":"move-to-personal-item",onClick:()=>ja(e,1),children:"Move to personal"}))]})]})})]},t)})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("tr",{className:"Changes-no-requestss position-absolute",children:(0,T.jsx)("div",{className:"My-no-requestss ".concat(Ze),children:"No active products"})})})}):""}))})]})})})})})})}),(0,T.jsx)(v.A,{Addseparator:!0,currentpage:tt,limit:10,Maxpagerange:6,Minpagerange:3,TotalProducts:at,onChange:e=>{it(e),Dt.current&&Dt.current.scrollIntoView({behavior:"smooth"})},prevload:null,nextload:null,showbtn:!1})]}),(0,T.jsxs)("div",{className:"lasting-tables-form inclsssstab-insectnnn",id:"tab2",style:2==ht?{display:"block"}:{display:"none"},children:[(0,T.jsx)("div",{className:"main-content price-filter",children:(0,T.jsx)("section",{className:"".concat(ve.Darkmode?"darksecondry myprofile-info-section":"myprofile-info-section"),children:(0,T.jsx)("div",{className:"myprofile-info-box",children:(0,T.jsx)("div",{className:"myprofile-info-option-detail-box listing-act",children:(0,T.jsx)("div",{className:"tabling tabling-listing",children:(0,T.jsx)("div",{className:"table-wrapper ",style:{minHeight:"170px"},children:(0,T.jsxs)("table",{children:[(0,T.jsx)("thead",{style:{position:"relative",zIndex:"1"},children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.length>0&&se.some(e=>"Paused"===e.status&&e.products.length>0)&&Mi.length===se.reduce((e,t)=>
1"Paused"===t.status?e+t.products.length:e,0),onChange:e=>{e.target.checked||ia(!1),zi(e)}}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Productsort",null==Gt.Productsort||"DESC"==Gt.Productsort?"ASC":"DESC")},children:["Product",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Productsort?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Productsort?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("pricefilter",null==Gt.pricefilter||"PriceDsc"==Gt.pricefilter?"PriceAsc":"PriceDsc")},children:["Price",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.pricefilter?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"PriceDsc"==Gt.pricefilter?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Listing Type"}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Quantityfilter",null==Gt.Quantityfilter||"DESC"==Gt.Quantityfilter?"ASC":"DESC")},children:["Quantity",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Quantityfilter?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Quantityfilter?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("brandsort",null==Gt.brandsort||"DESC"==Gt.brandsort?"ASC":"DESC")},children:["Brand",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.brandsort?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.brandsort?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("cat1",null==Gt.cat1||"DESC"==Gt.cat1?"ASC":"DESC")},children:["Product Type",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.cat1?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.cat1?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("cat2",null==Gt.cat2||"DESC"==Gt.cat2?"ASC":"DESC")},children:["Category",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.cat2?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.cat2?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>{ma("Date",null==Gt.Date||"DESC"==Gt.Date?"ASC":"DESC")},children:["Date",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt.Date?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt.Date?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Source"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Action"})]})}),(0,T.jsx)("tbody",{children:se.map((e,t)=>"Paused"==e.status?(0,T.jsx)(T.Fragment,{children:e.products.length>0?(0,T.jsx)(T.Fragment,{children:e.products.map((e,t)=>{var i,l;e.title=(0,j.Ef)(e.title);let s=null!==(null===e||void 0===e?void 0:e.Images)?null===e||void 0===e?void 0:e.Images:null;return e.mainImage&&(s=e.mainImage),(0,T.jsxs)("tr",{className:ta||Mi.includes(e.id)?"selected-row":"",children:[(0,T.jsx)("td",{style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.includes(e.id),onChange:()=>Qi(e.id)}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsx)("td",{className:"relative quick-edit-cell",children:(0,T.jsxs)("div",{className:"d-flex align-start text-start listings-productss",children:[(0,T.jsx)("div",{className:"img-sect cusomimgsection cursor-pointer",onClick:()=>{window.open((0,j.G1)("".concat("https://homeshow.ai/","productinfo/"),e.title,e.id))},children:e.AllImages&&e.AllImages.length>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.AllImages[0].path?e.AllImages[0].path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image",style:{width:"98px",height:"87px"}}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:1==e.AllImages[0].manufacturerImage?G:Y,title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image"})]}):null!==s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:s||$,onError:e=>{e.target.src=$},className:"",title:"Seller",style:{width:"98px",height:"87px"},alt:"stars_img"}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]}):e.Media.length>0?e.Media.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.node.preview.image?e.node.preview.image.originalSrc:$,onError:e=>{e.target.src=$},className:"",style:{width:"98px",height:"87px"},alt:"stars_img",title:"Seller"}
1,t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]})}):e.defaultprodImg.length>0?e.defaultprodImg.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.path?e.path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Manufacture"},t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:G,title:"Stock image"})]})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("img",{src:$,className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Stock image"})})}),la===e.id&&"title"===na?(0,T.jsxs)("div",{className:"quick-edit-form quick-edit-form--title",onClick:e=>e.stopPropagation(),children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"text",placeholder:"Title",value:ra.title,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{title:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{type:"button",className:"quick-edit-save",onClick:e=>{e.stopPropagation(),Gi()},disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{type:"button",className:"quick-edit-cancel",onClick:e=>{e.stopPropagation(),Vi()},children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",style:{alignItems:"flex-start",flex:1,minWidth:0},children:[(0,T.jsxs)("span",{"data-testid":"product-title",style:{wordWrap:"break-word",flex:1,minWidth:0,cursor:"pointer"},className:"ac-text ".concat(et),title:e.title,onClick:()=>{window.open((0,j.G1)("".concat("https://homeshow.ai/","productinfo/"),e.title,e.id))},children:[(null===e||void 0===e||null===(i=e.title)||void 0===i?void 0:i.length)>40?(null===e||void 0===e||null===(l=e.title)||void 0===l?void 0:l.substring(0,40))+"...":null===e||void 0===e?void 0:e.title,(0,T.jsxs)("span",{className:"d-flex align-center para",children:[(0,T.jsx)(S.A,{margin:"0px",Rating:e.Rating.length>0&&null!==e.Rating[0].avgrating?e.Rating[0].avgrating.toFixed(1):0}),(0,T.jsxs)("span",{style:{width:"35px"},children:[" (",e.Rating.length>0&&null!==e.Rating[0].avgrating?e.Rating[0].avgrating.toFixed(1):0,") "]})]}),"sku: ",(0,T.jsx)("p",{className:"p-sku ".concat(Ze),children:e.homeShowId||"N/A"})]}),(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",style:{marginTop:2},onClick:t=>{t.stopPropagation(),Ji(e,"title")},title:"Quick edit title"})]})]})}),(0,T.jsx)("td",{className:"price-msrp quick-edit-cell",children:1!=(null===e||void 0===e?void 0:e.sellingformat)&&la===e.id&&"price"===na?(0,T.jsxs)("div",{className:"quick-edit-form",children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"number",min:"0",placeholder:"Price",value:ra.price,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{price:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{className:"quick-edit-save",onClick:Gi,disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{className:"quick-edit-cancel",onClick:Vi,children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",children:[(0,T.jsxs)("a",{href:"",onClick:e=>{e.preventDefault()},className:"cursor-auto",children:["$",parseInt(e.ProductPrice)]}),1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",onClick:()=>Ji(e,"price"),title:"Quick edit price"})]})}),(0,T.jsx)("td",{className:"".concat(et," auctin-mainclsss"),children:1==(null===e||void 0===e?void 0:e.sellingformat)?(0,T.jsx)("p",{className:"auctionin-claaasss",children:"Auction"}):(0,T.jsx)("p",{className:"fixedinn-claaasss",children:"Fixed"})}),(0,T.jsx)("td",{className:"".concat(et," quick-edit-cell"),children:1!=(null===e||void 0===e?void 0:e.sellingformat)&&la===e.id&&"quantity"===na?(0,T.jsxs)("div",{className:"quick-edit-form",children:[(0,T.jsx)("input",{className:"quick-edit-input",type:"number",min:"0",placeholder:"Qty",value:ra.quantity,onChange:e=>da(t=>(0,a.A)((0,a.A)({},t),{},{quantity:e.target.value})),autoFocus:!0}),(0,T.jsxs)("div",{className:"quick-edit-action-btns",children:[(0,T.jsx)("button",{className:"quick-edit-save",onClick:Gi,disabled:ca,children:ca?"...":"Save"}),(0,T.jsx)("button",{className:"quick-edit-cancel",onClick:Vi,children:"\u2715"})]})]}):(0,T.jsxs)("div",{className:"quick-edit-display",children:[e.Quantity,1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsx)(D.SG1,{className:"quick-edit-pencil",onClick:()=>Ji(e,"quantity"),title:"Quick edit quantity"})]})}),(0,T.jsx)("td",{className:"".concat(et),title:e.brandsss?e.brandsss:"",children:(0,T.jsx)("div",{className:"showlisting-brands-div-1",children:e.brandsss?e.brandsss.length>10?qa(e.brandsss.substring(0,10))+"...":qa(e.brandsss):(0,T.jsx)("p",{children:"-"})})}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[0]?e.labels[0]:"",children:void 0!==e.labels[0]?qa(e.labels[0]):""}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[1]?e.labels[1]:"",children:void 0!==e.labels[1]?e.labels[1].length>10?qa(e.labels[1].substring(0,10))+"...":qa(e.labels[1]):(0,T.jsx)("p",{style:{textAlign:"center"},children:"-"})}),(0,T.jsx)("td",{className:"".concat(et),children:f()(e.createdAt).format("MM-DD-YYYY")}
1),(0,T.jsx)("td",{className:"".concat(et),children:e.productSource?(0,T.jsx)("span",{style:{display:"inline-block",padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",textTransform:"capitalize",background:"linear-gradient(135deg, #0083e2 0%, #0066b3 100%)",color:"white",boxShadow:"0 2px 4px rgba(0, 131, 226, 0.2)"},title:e.productSource,children:e.productSource.substring(0,1).toUpperCase()}):(0,T.jsx)("span",{style:{fontSize:"14px",color:Ze?"#999":"#666"},children:"-"})}),(0,T.jsx)("td",{className:"canchange",children:(0,T.jsxs)(g.A,{children:[(0,T.jsxs)(g.A.Toggle,{variant:"light",className:"listing-action-toggle listing-action-toggle--icon",id:"dropdown-basic","aria-label":"Actions",children:[(0,T.jsx)(D.ZZB,{size:18,"aria-hidden":!0}),(0,T.jsx)("span",{className:"visually-hidden",children:"Actions"})]}),(0,T.jsxs)(g.A.Menu,{renderOnMount:!0,popperConfig:{strategy:"fixed",modifiers:[{name:"preventOverflow",options:{boundary:"viewport"}}]},children:[1!=(null===e||void 0===e?void 0:e.sellingformat)&&(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(g.A.Item,{onClick:()=>_a(e),children:"Active"})}),(0,T.jsx)(g.A.Item,{onClick:()=>Sa(e),children:"Share"}),(0,T.jsx)(g.A.Item,{onClick:()=>La(e),children:"Reviews"}),(0,T.jsx)(g.A.Item,{onClick:()=>Ra(e),children:"Delete"}),(0,T.jsx)(g.A.Item,{"data-testid":"edit-item",onClick:()=>Da(e),children:"Edit"})]})]})})]},t)})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("tr",{className:"Changes-no-requestss position-absolute",children:(0,T.jsx)("div",{className:"My-no-requestss ".concat(Ze),children:"No paused products"})})})}):"")})]})})})})})})}),(0,T.jsx)(v.A,{Addseparator:!0,currentpage:nt,limit:10,Maxpagerange:5,Minpagerange:2,TotalProducts:dt,onChange:e=>{ot(e),Dt.current&&Dt.current.scrollIntoView({behavior:"smooth"})},prevload:null,nextload:null,showbtn:!1})]}),(0,T.jsxs)("div",{className:"lasting-tables-form ",id:"tab3",style:3==ht?{display:"block"}:{display:"none"},children:[(0,T.jsx)("div",{className:"main-content price-filter",children:(0,T.jsx)("section",{className:"".concat(ve.Darkmode?"darksecondry myprofile-info-section":"myprofile-info-section"),children:(0,T.jsx)("div",{className:"myprofile-info-box",children:(0,T.jsx)("div",{className:"myprofile-info-option-detail-box listing-act",children:(0,T.jsx)("div",{className:"tabling tabling-listing",children:(0,T.jsx)("div",{className:"table-wrapper ",style:{minHeight:"170px"},children:(0,T.jsxs)("table",{children:[(0,T.jsx)("thead",{style:{position:"relative",zIndex:"1"},children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.length>0&&Qa&&Mi.length===Qa.length,onChange:zi}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Product"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Listing Type"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Source"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Main Category"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Sub Category"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Brand"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Required Fields"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},children:"Draft Created"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Action"})]})}),(0,T.jsx)("tbody",{children:Qa&&Qa.length>0?(0,T.jsxs)(T.Fragment,{children:[" ",Qa.map(e=>{var t,i,a,l,s,n,o,r,d,c;return(0,T.jsxs)("tr",{className:"drafts-wrapper ".concat(ta||Mi.includes(e.id)?"selected-row":""),children:[(0,T.jsx)("td",{style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.includes(e.id),onChange:()=>Qi(e.id)}),(0,T.jsx)("span",{className:"checkmark"})]})})}),((t,i,a,l,s,n,o,r,d,c,u,p)=>{let h=null;var m,g;if(null!==(t=e.otherData)&&void 0!==t&&t.productImages&&e.otherData.productImages.length>0)h=(null===(m=e.otherData.productImages[0])||void 0===m?void 0:m.path)||(null===(g=e.otherData.productImages[0])||void 0===g?void 0:g.url);else if(null!==(i=e.otherData)&&void 0!==i&&null!==(a=i.productData)&&void 0!==a&&a.AllImages&&Array.isArray(e.otherData.productData.AllImages)&&e.otherData.productData.AllImages.length>0){var v,x;h=(null===(v=e.otherData.productData.AllImages[0])||void 0===v?void 0:v.path)||(null===(x=e.otherData.productData.AllImages[0])||void 0===x?void 0:x.url)}else if(null!==(l=e.otherData)&&void 0!==l&&null!==(s=l.originalProduct)&&void 0!==s&&null!==(n=s.originalProduct)&&void 0!==n&&n.media&&Array.isArray(e.otherData.originalProduct.originalProduct.media)&&e.otherData.originalProduct.originalProduct.media.length>0){var y;h=null===(y=e.otherData.originalProduct.originalProduct.media[0])||void 0===y?void 0:y.url}else null!==(o=e.otherData)&&void 0!==o&&null!==(r=o.originalProduct)&&void 0!==r&&r.ProductImage&&(h=e.otherData.originalProduct.ProductImage);return h?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("td",{className:"".concat(et," drafts-name-img-td-1"),children:(0,T.jsxs)("div",{className:" product-wrap d-flex align-center drafts-name-img-1",children:[(0,T.jsx)("div",{className:"img-sect cusomimgsection drafts-image-1",children:(0,T.jsx)("img",{src:h,onError:e=>{e.target.src=$}}
1)}),(0,T.jsx)("span",{style:{wordWrap:"break-word"},className:"ac-text ".concat(et),title:e.title,children:(null===e||void 0===e||null===(d=e.title)||void 0===d?void 0:d.length)>50?(null===e||void 0===e||null===(c=e.title)||void 0===c?void 0:c.substring(0,50))+"...":null===e||void 0===e?void 0:e.title})]})})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("td",{className:"".concat(et," drafts-name-img-td-1"),children:(0,T.jsxs)("div",{className:" product-wrap d-flex align-center drafts-name-img-1",children:[(0,T.jsx)("div",{className:"img-sect cusomimgsection drafts-image-1",children:(0,T.jsx)("img",{src:$})}),(0,T.jsx)("span",{style:{wordWrap:"break-word"},className:"ac-text ".concat(et),title:e.title,children:(null===e||void 0===e||null===(u=e.title)||void 0===u?void 0:u.length)>50?(null===e||void 0===e||null===(p=e.title)||void 0===p?void 0:p.substring(0,50))+"...":null===e||void 0===e?void 0:e.title})]})})})})(),(0,T.jsx)("td",{className:"".concat(et," auctin-mainclsss"),children:1==(null===e||void 0===e||null===(t=e.otherData)||void 0===t||null===(i=t.AuctionStates)||void 0===i?void 0:i.sellingformat)?(0,T.jsx)("p",{className:"auctionin-claaasss",children:"Auction"}):(0,T.jsx)("p",{className:"fixedinn-claaasss",children:"Fixed"})}),(0,T.jsx)("td",{className:"".concat(et),children:((t,i,a,l)=>{const s=(null===e||void 0===e?void 0:e.productSource)||(null===e||void 0===e||null===(t=e.otherData)||void 0===t||null===(i=t.productData)||void 0===i?void 0:i.productSource)||(null===e||void 0===e||null===(a=e.otherData)||void 0===a||null===(l=a.originalProduct)||void 0===l?void 0:l.productSource)||null;return s?(0,T.jsx)("span",{style:{display:"inline-block",padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",textTransform:"capitalize",background:"linear-gradient(135deg, #0083e2 0%, #0066b3 100%)",color:"white",boxShadow:"0 2px 4px rgba(0, 131, 226, 0.2)"},children:s}):(0,T.jsx)("span",{style:{fontSize:"14px",color:Ze?"#999":"#666"},children:"-"})})()}),(0,T.jsx)("td",{className:"".concat(et," "),children:(0,T.jsx)("div",{className:"drafts-category-1 ",children:(0,T.jsx)("p",{className:Ze,children:(null===(a=e.otherData)||void 0===a?void 0:a.mainCategoryName)||(null===(l=e.otherData)||void 0===l?void 0:l.categoryName)||"-"})})}),(0,T.jsx)("td",{className:"".concat(et," "),children:(0,T.jsx)("div",{className:"drafts-category-1 ",children:(0,T.jsx)("p",{className:Ze,children:(null===(s=e.otherData)||void 0===s?void 0:s.subCategoryName)||(null===(n=e.otherData)||void 0===n?void 0:n.categoryName1)||"-"})})}),(0,T.jsx)("td",{className:"".concat(et," "),title:(null===(o=e.otherData)||void 0===o?void 0:o.productBrandName)||(null===(r=e.otherData)||void 0===r?void 0:r.productBrandCode)||"",children:(0,T.jsx)("div",{className:"drafts-category-1 ",children:(0,T.jsx)("p",{className:Ze,children:(null===(d=e.otherData)||void 0===d?void 0:d.productBrandName)||(null===(c=e.otherData)||void 0===c?void 0:c.productBrandCode)||"-"})})}),(0,T.jsx)("td",{className:"".concat(et),children:(()=>{const t=H(e),{displayFields:i,remainingCount:a}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return 0===e.length?{displayFields:[],remainingCount:0}:e.length<=t?{displayFields:e,remainingCount:0}:{displayFields:e.slice(0,t),remainingCount:e.length-t}}(t,2);return 0===t.length?(0,T.jsx)("span",{className:"no-required-fields",children:"\u2713 All fields complete"}):(0,T.jsx)("div",{className:"required-fields-cell",children:(0,T.jsxs)("div",{className:"required-fields-wrapper",children:[i.map((t,i)=>(0,T.jsx)("span",{className:"required-field-tag",onClick:()=>a>0&&Va(e),style:{cursor:a>0?"pointer":"default"},children:t},i)),a>0&&(0,T.jsxs)("button",{className:"required-fields-more",onClick:()=>Va(e),title:"".concat(a," more field").concat(a>1?"s":""),children:["+",a]})]})})})()}),(0,T.jsx)("td",{className:"".concat(et," "),children:(0,T.jsx)("div",{className:"drafts-category-1 ",children:(0,T.jsx)("p",{className:Ze,children:f()(e.createdAt).format("MM-DD-YYYY")})})}),(0,T.jsx)("td",{className:"position-relative canchange",children:(0,T.jsxs)(g.A,{children:[(0,T.jsxs)(g.A.Toggle,{variant:"light",className:"listing-action-toggle listing-action-toggle--icon",id:"dropdown-basic","aria-label":"Actions",children:[(0,T.jsx)(D.ZZB,{size:18,"aria-hidden":!0}),(0,T.jsx)("span",{className:"visually-hidden",children:"Actions"})]}),(0,T.jsxs)(g.A.Menu,{renderOnMount:!0,popperConfig:{strategy:"fixed",modifiers:[{name:"preventOverflow",options:{boundary:"viewport"}}]},children:[(0,T.jsx)(g.A.Item,{onClick:()=>{Ha(e)},children:"Continue Listing"}),(0,T.jsx)(g.A.Item,{onClick:()=>{qt(e.id),Mt(!0)},children:"Delete"})]})]})})]})})]}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("tr",{className:"Changes-no-requestss position-absolute",children:(0,T.jsx)("div",{className:"My-no-requestss ".concat(Ze),children:"No drafted products"})})})})]})})})})})})}),(0,T.jsx)(v.A,{Addseparator:!0,currentpage:Ht,limit:10,Maxpagerange:6,Minpagerange:3,TotalProducts:za?Qa.length:Rt,onChange:e=>{Ut(e),Dt.current&&Dt.current.scrollIntoView({behavior:"smooth"})}
1,prevload:null,nextload:null,showbtn:!1})]}),(0,T.jsxs)("div",{className:"lasting-tables-form inclsssstab-insectnnn",id:"tab4",style:4==ht?{display:"block"}:{display:"none"},children:[(0,T.jsx)("div",{className:"main-content price-filter",children:(0,T.jsx)("section",{className:"".concat(ve.Darkmode?"darksecondry myprofile-info-section":"myprofile-info-section"),children:(0,T.jsx)("div",{className:"myprofile-info-box",children:(0,T.jsx)("div",{className:"myprofile-info-option-detail-box listing-act",children:(0,T.jsx)("div",{className:"tabling tabling-listing",children:(0,T.jsx)("div",{className:"table-wrapper ",style:{minHeight:"170px"},children:(0,T.jsxs)("table",{children:[(0,T.jsx)("thead",{style:{position:"relative",zIndex:"1"},children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.length>0&&vi&&vi.products&&Mi.length===vi.products.length,onChange:zi}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredProductsort":"Productsort",null==Gt[4==ht?"expiredProductsort":"Productsort"]||"DESC"==Gt[4==ht?"expiredProductsort":"Productsort"]?"ASC":"DESC"),children:["Product",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredProductsort":"Productsort"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredProductsort":"Productsort"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredPricefilter":"pricefilter",null==Gt[4==ht?"expiredPricefilter":"pricefilter"]||"PriceDsc"==Gt[4==ht?"expiredPricefilter":"pricefilter"]?"PriceAsc":"PriceDsc"),children:["Price",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredPricefilter":"pricefilter"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"PriceAsc"==Gt[4==ht?"expiredPricefilter":"pricefilter"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Listing Type"}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredQuantityfilter":"Quantityfilter",null==Gt[4==ht?"expiredQuantityfilter":"Quantityfilter"]?"ASC":"ASC"==Gt[4==ht?"expiredQuantityfilter":"Quantityfilter"]?"DESC":"ASC"),children:["Quantity",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredQuantityfilter":"Quantityfilter"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredQuantityfilter":"Quantityfilter"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredBrandsort":"brandsort",null==Gt[4==ht?"expiredBrandsort":"brandsort"]||"DESC"==Gt[4==ht?"expiredBrandsort":"brandsort"]?"ASC":"DESC"),children:["Brand",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredBrandsort":"brandsort"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredBrandsort":"brandsort"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredCat1":"cat1",null==Gt[4==ht?"expiredCat1":"cat1"]||"DESC"==Gt[4==ht?"expiredCat1":"cat1"]?"ASC":"DESC"),children:["Product Type",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredCat1":"cat1"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredCat1":"cat1"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredCat2":"cat2",null==Gt[4==ht?"expiredCat2":"cat2"]||"DESC"==Gt[4==ht?"expiredCat2":"cat2"]?"ASC":"DESC"),children:["Category",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredCat2":"cat2"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredCat2":"cat2"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsxs)("th",{className:"".concat(Xe," ").concat(Ze),style:{cursor:"pointer"},onClick:()=>ma(4==ht?"expiredDate":"Date",null==Gt[4==ht?"expiredDate":"Date"]||"DESC"==Gt[4==ht?"expiredDate":"Date"]?"ASC":"DESC"),children:["Ended Date",(0,T.jsx)("span",{className:"padding-left5",children:null==Gt[4==ht?"expiredDate":"Date"]?(0,T.jsx)("img",{src:K,style:{width:"17px"}}):"ASC"==Gt[4==ht?"expiredDate":"Date"]?(0,T.jsx)("img",{style:{rotate:"180deg"},src:Z}):(0,T.jsx)("img",{src:Z})})]}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Final Bid"}),(0,T.jsx)("th",{className:"".concat(Xe," ").concat(Ze),children:"Action"})]})}),(0,T.jsx)("tbody",{children:vi&&vi.products&&vi.products.length>0?vi.products.map((e,t)=>{var i,a,l;let s=null!==(null===e||void 0===e?void 0:e.Images)?null===e||void 0===e?void 0:e.Images:null;return null!==e&&void 0!==e&&e.mainImage&&(s=e.mainImage),null!==e&&void 0!==e&&e.title&&(e.title=(0,j.Ef)(null===e||void 0===e?void 0:e.title)),(0,T.jsxs)("tr",{className:ta||Mi.includes(e.id)?"selected-row":"",children:[(0,T.jsx)("td",{style:{width:"50px"},children:(0,T.jsx)("div",{className:"custom-checkbox-wrapper",children:(0,T.jsxs)("label",{className:"custom-checkbox ".concat(ve.Darkmode?"dark-mode":""),children:[(0,T.jsx)("input",{type:"checkbox",checked:ta||Mi.includes(e.id),onChange:()=>Qi(e.id)}),(0,T.jsx)("span",{className:"checkmark"})]})})}),(0,T.jsx)("td",{className:"relative",children:(0,T.jsxs)("div",{className:"d-flex align-start cursor-pointer text-start listings-productss",onClick:()=>{window.open((0,j.G1)("".concat("https://homeshow.ai/","productinfo/"),e.title,e.id))},children:[(0,T.jsx)("div",{className:"img-sect cusomimgsection",children:null!==e&&void 0!==e&&e.AllImages&&(null===e||void 0===e?void 0:e.AllImages.length)>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.AllImages[0].path?e.AllImages[0].path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image",style:{width:"98px",height:"87px"}}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:1==e.AllImages[0].manufacturerImage?G:Y,title:1==e.AllImages[0].manufacturerImage?"Stock image":"Seller image"})]}):s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==s?s:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",title:"Seller",style:{width:"98px",height:"87px"}}),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]}):e.Media.length>0?e.Media.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.node.preview.image?e.node.preview.image.originalSrc:$,onError:e=>{e.target.src=$},className:"",style:{width:"98px",height:"87px"},alt:"stars_img",title:"Seller"}
1,t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:Y,title:"Seller image"})]})}):(null===e||void 0===e||null===(i=e.defaultprodImg)||void 0===i?void 0:i.length)>0?e.defaultprodImg.map((e,t)=>{if(0==t)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("img",{src:null!==e.path?e.path:$,onError:e=>{e.target.src=$},className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Manufacture"},t),(0,T.jsx)("img",{className:"sliderinnerimgtag",src:G,title:"Stock image"})]})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("img",{src:$,className:"",alt:"stars_img",style:{width:"98px",height:"87px"},title:"Stock image"})})}),(0,T.jsxs)("span",{style:{wordWrap:"break-word"},className:"".concat(et," ac-text"),title:e.title,children:[(null===e||void 0===e||null===(a=e.title)||void 0===a?void 0:a.length)>40?(null===e||void 0===e||null===(l=e.title)||void 0===l?void 0:l.substring(0,40))+"...":null===e||void 0===e?void 0:e.title,(0,T.jsxs)("span",{className:"d-flex align-center para",children:[(0,T.jsx)(S.A,{margin:"0px",Rating:e.Rating.length>0&&null!==e.Rating[0].avgrating?e.Rating[0].avgrating.toFixed(1):0}),(0,T.jsxs)("span",{style:{width:"35px"},children:[" (",e.Rating.length>0&&null!==e.Rating[0].avgrating?e.Rating[0].avgrating.toFixed(1):0,") "]})]}),"sku: ",(0,T.jsx)("p",{className:"p-sku ".concat(Ze),children:e.homeShowId||"N/A"})]})]})}),(0,T.jsx)("td",{className:"price-msrp",children:(0,T.jsxs)("a",{href:"",onClick:e=>{e.preventDefault()},className:"cursor-auto",children:["$",parseInt(1==e.is_auction?e.buyitnowprice?e.buyitnowprice:e.startingbid:e.ProductPrice)]})}),(0,T.jsx)("td",{className:"".concat(et," auctin-mainclsss"),children:1==(null===e||void 0===e?void 0:e.sellingformat)?(0,T.jsx)("p",{className:"auctionin-claaasss",children:"Auction"}):(0,T.jsx)("p",{className:"fixedinn-claaasss",children:"Fixed"})}),(0,T.jsx)("td",{className:"".concat(et),children:e.Quantity}),(0,T.jsx)("td",{className:"".concat(et),title:e.brandsss?e.brandsss:"",children:(0,T.jsx)("div",{className:"showlisting-brands-div-1",children:e.brandsss?e.brandsss.length>10?qa(e.brandsss.substring(0,10))+"...":qa(e.brandsss):(0,T.jsx)("p",{children:"-"})})}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[0]?e.labels[0]:"",children:void 0!==e.labels[0]?qa(e.labels[0]):""}),(0,T.jsx)("td",{className:"".concat(et),title:void 0!==e.labels[1]?e.labels[1]:"",children:void 0!==e.labels[1]?e.labels[1].length>10?qa(e.labels[1].substring(0,10))+"...":qa(e.labels[1]):(0,T.jsx)("p",{style:{textAlign:"center"},children:"-"})}),(0,T.jsx)("td",{className:"".concat(et),children:e.auction_end_date?f()(e.auction_end_date).format("MM-DD-YYYY"):"N/A"}),(0,T.jsx)("td",{className:"".concat(et),children:e.max_bid?"$".concat(e.max_bid):"No bids"}),(0,T.jsx)("td",{className:"position-relative canchange",children:(0,T.jsxs)(g.A,{children:[(0,T.jsxs)(g.A.Toggle,{variant:"light",className:"listing-action-toggle listing-action-toggle--icon",id:"dropdown-basic","aria-label":"Actions",children:[(0,T.jsx)(D.ZZB,{size:18,"aria-hidden":!0}),(0,T.jsx)("span",{className:"visually-hidden",children:"Actions"})]}),(0,T.jsxs)(g.A.Menu,{renderOnMount:!0,popperConfig:{strategy:"fixed",modifiers:[{name:"preventOverflow",options:{boundary:"viewport"}}]},children:[(1==(null===e||void 0===e?void 0:e.sellingformat)||1==(null===e||void 0===e?void 0:e.is_auction)||1==(null===e||void 0===e?void 0:e.isAuction))&&1!=(null===e||void 0===e?void 0:e.is_sold)&&"sold"!==(null===e||void 0===e?void 0:e.auction_status)&&(0,T.jsx)(g.A.Item,{"data-testid":"relist-item",onClick:()=>(e=>{di(e),oi(!0)})(e),className:"text-primary fw-semibold",children:"Relist Auction"}),(0,T.jsx)(g.A.Item,{onClick:()=>Sa(e),children:"Share"}),(0,T.jsx)(g.A.Item,{onClick:()=>La(e),children:"Reviews"}),(0,T.jsx)(g.A.Item,{onClick:()=>{Ra(e)},children:"Delete"})]})]})})]},t)}):(0,T.jsx)("tr",{className:"Changes-no-requestss position-absolute",children:(0,T.jsx)("td",{colSpan:"10",children:(0,T.jsx)("div",{className:"My-no-requestss ".concat(Ze),children:"No expired auctions"})})})})]})})})})})})}),(0,T.jsx)(v.A,{Addseparator:!0,currentpage:zt||1,limit:10,Maxpagerange:6,Minpagerange:3,TotalProducts:(null===vi||void 0===vi?void 0:vi.TotalProducts)||0,onChange:e=>{Qt(e),Dt.current&&Dt.current.scrollIntoView({behavior:"smooth"})}
1,prevload:null,nextload:null,showbtn:!1})]})]})]}),2==y&&(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("div",{"data-ths-ui-theme":ve.Darkmode?"dark":"light",children:(0,T.jsx)(V.Rd,{className:"ths-ui-scope container dashboard-next-shell ml-catpick-dashboard-shell",topbar:(0,T.jsxs)("div",{className:"dashboard-next-mobile-topbar",children:[(0,T.jsx)(V.$n,{variant:"secondary",size:"sm",icon:(0,T.jsx)("i",{className:"fas fa-bars"}),onClick:()=>fe(!0),children:"Menu"}),(0,T.jsx)("strong",{children:"Add Product Listing"})]}),sidebar:(0,T.jsx)(Q.A,{roleInfo:xe,unreadCount:0,themeContext:ve,onNavigate:()=>fe(!1)}),sidebarOpen:ye,onSidebarClose:()=>fe(!1),children:(0,T.jsxs)("div",{className:"main-content ml-catpick-page ".concat(ve.Darkmode?"ml-catpick-page--dark":""),children:[(0,T.jsxs)("div",{className:"ml-catpick-topbar",children:[(0,T.jsxs)("button",{type:"button",className:"ml-back-btn ".concat(Ze),onClick:e=>(e=>{e.preventDefault(),P(e=>e-1),ya()})(e),children:[(0,T.jsx)(D.kRp,{size:18}),(0,T.jsx)("span",{children:"Back"})]}),(0,T.jsxs)("nav",{className:"ml-breadcrumb",children:[(0,T.jsx)("span",{children:"Home"}),(0,T.jsx)("span",{className:"ml-breadcrumb-sep",children:"/"}),(0,T.jsx)("span",{children:"Sell"}),(0,T.jsx)("span",{className:"ml-breadcrumb-sep",children:"/"}),(0,T.jsx)("span",{className:"ml-breadcrumb-current",children:"Select category"})]})]}),(0,T.jsxs)("div",{className:"ml-catpick-content",children:[(0,T.jsxs)("div",{className:"ml-catpick-header",children:[(0,T.jsx)("h2",{className:"ml-catpick-title ".concat(Ze),children:"Select a listing category"}),(0,T.jsx)("p",{className:"ml-catpick-subtitle",children:"Choose the product family that best matches the item you are preparing to sell."})]}),(0,T.jsx)("div",{className:"ml-catpick-grid",children:X.length>0&&[...X.filter(e=>!(0===e.parentId&&"AUTOS"===e.categoryName&&!0===e.categoryStatus)),...X.filter(e=>0===e.parentId&&"AUTOS"===e.categoryName&&!0===e.categoryStatus)].map((e,t)=>{const a=0===e.parentId&&"AUTOS"===e.categoryName&&!0===e.categoryStatus;if((0!==e.parentId||null!=e.categoryType||!0!==e.categoryStatus||"AUTOS"===e.categoryName)&&!a)return null;const l=a?"".concat("https://homeshow.ai","/new-images/autos-listing.png"):(e=>{if(!e)return"";const t=String(e);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:")?t:"".concat("https://homeshow.ai","/new-images/category/new/").concat(t)})(e.categoryImage),s=e.categoryName.charAt(0).toUpperCase()+e.categoryName.slice(1).toLowerCase();return(0,T.jsxs)("button",{type:"button",className:"ml-catpick-card ".concat(ve.Darkmode?"ml-catpick-card--dark":""),onClick:()=>{return a?(e=>{let t={Type:e.categorySlug,firstcategory:e.id,parantId:e.id,childId:e.childId,Type1:e.categorySlug,categoryName:e.categoryName,parantId1:e.id,childId1:e.childId};i("/autolistings",{state:{obj:t,FromListing:!0,step:3}})})(e):(t=e,te.Type=t.categorySlug,te.firstcategory=t.id,te.parantId=t.id,te.childId=t.childId,te.Type1=t.categorySlug,te.categoryName=t.categoryName,te.parantId1=t.id,te.childId1=t.childId,(0,j.J3)(),Aa(),void re(null));var t},"data-testid":"listing_category_".concat(e.categoryName.toLowerCase()),children:[(0,T.jsx)("div",{className:"ml-catpick-img",children:(0,T.jsx)("img",{src:l,alt:e.categoryName})}),(0,T.jsxs)("div",{className:"ml-catpick-footer",children:[(0,T.jsx)("span",{className:"ml-catpick-name",children:s}),(0,T.jsx)(D.dyV,{size:16,className:"ml-catpick-arrow"})]})]},t)})})]})]})})})}),[3,4,5,6].includes(y)&&(0,T.jsx)(W.A,{Textwhite:Ze,steps:["Select item","listing Detail","Accesories","Shipping"],currentStep:y,edit:oe,productData:te,changeStep:P,changetrack:mi}),3===y&&(0,T.jsx)("div",{className:"main-content max-w-100",children:(0,T.jsx)(c.A,{nextStep:Aa,values:te,Product:e=>{F(e)},handleFormData:Ia,prevStep:wa,setformd:ie,parentval:va,changeval:e=>{xa((0,a.A)({},e))},ResetFields:ya,ChangeReset:()=>{F({}),re(null)},InventoryData:Je,listCamData:Ge,setListCamData:Ye,handleTrack:gi})}),4===y&&(0,T.jsx)(u.A,{handleTrack:gi,ProcessSaving:Ot,SaveDraftData:Na,nextStep:Aa,nextClothingStep:()=>{P(y+2)},SendData:_,values:te,handleFormData:Ia,prevStep:wa,EditProduct:oe,newArra:Pa,step:y,Changedto:P,changeford:ie,Handletoast:e=>{e&&r.oR.error(e)},InventoryData:Je,listCamData:Ge,setListCamData:Ye,backToDraftTab:()=>{P(1),mt(3),window.scroll(0,400)}}),5===y&&(0,T.jsx)(h.A,{ProcessSaving:Ot,SaveDraftData:Na,nextStep:Aa,SendData:_,values:te,handleFormData:Ia,prevStep:wa,EditProduct:oe,step:y,Changedto:P}),6===y&&(0,T.jsx)(p.A,{ProcessSaving:Ot,SaveDraftData:Na,nextStep:Aa,newArra:Pa,SendData:_,values:te,handleFormData:Ia,prevStep:wa,prevClothingStep:()=>{P(y-2)},EditProduct:oe,step:y,Changedto:P,listCamData:Ge,setListCamData:Ye,onProductCreated:(e,t)=>{Di(e),_i(t)}}),7===y&&(0,T.jsx)(m.A,{Newar:Pa,addnewlist:()=>{window.scroll(0,0),ie({}),P(2)},boostproduct:()=>{let e=(0,j.G1)("/boost-product/",te.Title,te.productIdNew);i("".concat(e))},EditProduct:oe,values:te,productId:Ii,productTitle:Ti})]})})})}),de&&(0,T.jsx)(x.A,{isOpen:de,Title:"Share Listing",onClose:()=>ce(!1),itemTitle:kt,Image:Zt,darkMode:ve.Darkmode,itemUrl:"".concat("https://homeshow.ai/").concat((0,j.G1)("productinfo/",kt,St))}),(0,T.jsx)(V.uo,{show:he,onHide:()=>{me(!1),Vt(!1),le({}),Oi(!1)},title:"Are you sure?",description:Xa,confirmLabel:"Delete",cancelLabel:"Close",onConfirm:()=>{qi?Wa():(pt(!0),o.A.deleteMetod("shopify/VendorProduct",ae.id).then(e=>{var i,a,l;"success"==(null===(i=e.data)||void 0===i?void 0:i.status)&&(r.oR.success((0,T.jsx)("div",{"data-testid":"product_deleted_success",children:"Product deleted successfully!"})),null===t||void 0===t||t.Refreshdata()),"failed"==(null===(a=e.data)||void 0===a?void 0:a.status)&&r.oR.error("some error occured"),"unknown"==(null===(l=e.data)||void 0===l?void 0:l.status)&&r.oR.error("some error occured"),me(!1),Vt(!1),le({}),1==ht&&tt>1?it(1):2==ht&&nt>1?ot(1):Ea(1,1),pt(!1)}).catch(e=>{r.oR.error("There is shopify server issue, Please try again later!"),pt(!1)}))}
1,loading:ut,tone:"danger",theme:ve.Darkmode?"dark":"light",confirmButtonProps:{"data-testid":"confirm-delete-modal"},cancelButtonProps:{"data-testid":"close-delete-modal"}}),(0,T.jsx)(C.A,{close:()=>{Mt(!1),qt(null)},confirmDelete:()=>{(e=>{try{o.A.httpPost("shopify/deletedraft",{id:e}).then(t=>{if(t.id){r.oR.success(t.msg);const i=_t.filter(t=>t.id!==e);Ft(i),Mt(!1),qt(null),Wt(e=>e-1),Ht>1?Ut(1):Ea()}}).catch(e=>{})}catch(t){}})(Bt)},dark:$e,textdark:Ze,show:Et}),(0,T.jsx)(b.A,{dark:$e,textdark:Ze,show:ei,close:()=>{ti(!1)},redirect:()=>{window.location.href=window.location.origin+"/listings"},message:ii}),li&&(0,T.jsx)(k.A,{show:li,HanldeCloseModal:()=>{si(!1)},id:ci,getData:Ea}),Jt&&(0,T.jsx)(A.A,{show:Jt,HanldeCloseModal:()=>{Vt(!1)},id:ci,DeleteData:Ra,deleteProducttt:pi}),(0,T.jsx)(R,{show:ni,onClose:()=>oi(!1),product:ri,onSuccess:Ea}),(0,T.jsx)(L,{show:Fi,onHide:Ga,requiredFields:Wi?H(Wi):[],onEdit:()=>{Wi&&(Ha(Wi),Ga())},darkMode:ve.Darkmode}),(0,T.jsx)(U.A,{show:Yi,onHide:()=>Zi(!1),type:$i,onSwitch:async()=>{await ba(2),Zi(!1),i("/listings")},darkMode:ve.Darkmode}),Xi&&(0,T.jsx)("div",{className:"reportmodel bulk-confirm-modal",style:{display:"block"},children:(0,T.jsxs)("div",{className:"report-item-model-content bulk-confirm-content ".concat(ve.Darkmode?"darkbackground":""),children:[(0,T.jsx)("div",{className:"bulk-confirm-icon-wrap",children:Xi.quotaError?(0,T.jsx)("div",{className:"bulk-confirm-icon bulk-confirm-icon--quota",children:(0,T.jsx)(D.yGN,{})}):"pause"===Xi.action?(0,T.jsx)("div",{className:"bulk-confirm-icon bulk-confirm-icon--pause",children:(0,T.jsx)(D.GHw,{})}):(0,T.jsx)("div",{className:"bulk-confirm-icon bulk-confirm-icon--activate",children:(0,T.jsx)(D.aze,{})})}),(0,T.jsx)("h4",{className:"bulk-confirm-title ".concat(ve.Darkmode?"text-white":""),children:Xi.quotaError?"Listing Limit Reached":"pause"===Xi.action?"Pause Listings?":"Activate Listings?"}),(0,T.jsx)("p",{className:"bulk-confirm-desc ".concat(ve.Darkmode?"text-white":""),children:Xi.quotaError?Xi.quotaError:(0,T.jsxs)(T.Fragment,{children:["You're about to ",(0,T.jsx)("strong",{children:"pause"===Xi.action?"pause":"activate"})," ",ta?"all ".concat(Za," listings"):1===Mi.length?"1 listing":"".concat(Mi.length," listings"),".","pause"===Xi.action?" Paused listings won't be visible to buyers until reactivated.":" Activated listings will immediately become visible to buyers."]})}),(0,T.jsx)("div",{className:"bulk-confirm-meta",children:(0,T.jsxs)("span",{className:"bulk-confirm-badge",children:[ta?"All ".concat(Za," listings"):"".concat(Mi.length," ").concat(1===Mi.length?"listing":"listings")," selected"]})}),(0,T.jsxs)("div",{className:"bulk-confirm-actions",children:[(0,T.jsx)("button",{type:"button",className:"bulk-confirm-btn bulk-confirm-btn--cancel",onClick:()=>ea(null),children:Xi.quotaError?"Close":"Cancel"}),!Xi.quotaError&&(0,T.jsx)("button",{type:"button",className:"bulk-confirm-btn ".concat("pause"===Xi.action?"bulk-confirm-btn--pause":"bulk-confirm-btn--activate"),onClick:()=>{ea(null),(async e=>{if(ta||0!==Mi.length){pt(!0);try{var i,a;const l=await o.A.httpPost("shopify/VendorProduct/bulk",{action:e,ids:ta?[]:Mi,selectAll:ta,plateform:"web",UserType:Ni}),s=null!==(i=null===l||void 0===l?void 0:l.success)&&void 0!==i?i:0;if(s>0){const t="pause"===e?"paused":"activate"===e?"activated":"updated";r.oR.success("".concat(s," listing(s) ").concat(t," successfully."))}null!==l&&void 0!==l&&null!==(a=l.failed)&&void 0!==a&&a.length&&r.oR.warn("".concat(l.failed.length," listing(s) could not be ").concat(e,"d.")),Bi([]),ia(!1),Ea(1,1),null===t||void 0===t||t.Refreshdata()}catch(l){const t=(null===l||void 0===l?void 0:l.msg)||(null===l||void 0===l?void 0:l.message);"quota_exceeded"===(null===l||void 0===l?void 0:l.status)?ea({action:e,quotaError:t}):t?r.oR.error(t):r.oR.error("Something went wrong.")}finally{pt(!1)}}})(Xi.action)},children:"pause"===Xi.action?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(D.GHw,{style:{marginRight:6}}),"Yes, Pause"]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(D.aze,{style:{marginRight:6}}),"Yes, Activate"]})})]})]})})]})}},60748(e,t,i){i.d(t,{A:()=>c});i(9950);var a=i(3919),l=i(16339),s=i(72835),n=i(44414);const o={color:"#0083E2",fontWeight:700,cursor:"pointer",textDecoration:"underline"},r={NO_BUSINESS:{badge:{label:"Business Required",color:"#0083E2",bg:"rgba(0,131,226,0.1)"},icon:l.qYx,iconColor:"#0083E2",iconBg:"rgba(0,131,226,0.08)",ringColor:"rgba(0,131,226,0.18)",title:"Integrations Restricted",primaryLabel:"Set Up Business Account",primaryHref:s.QH,primaryColor:"#0083E2"},SWITCH_BUSINESS:{badge:{label:"Profile Switch Needed",color:"#7C3AED",bg:"rgba(124,58,237,0.1)"},icon:l.F5$,iconColor:"#7C3AED",iconBg:"rgba(124,58,237,0.08)",ringColor:"rgba(124,58,237,0.18)",title:"Integrations Restricted",primaryLabel:"Switch to Business Profile",primaryHref:null,primaryColor:"#7C3AED"},NO_API:{badge:{label:"API Limit Reached",color:"#DC2626",bg:"rgba(220,38,38,0.1)"},icon:l.eHT,iconColor:"#DC2626",iconBg:"rgba(220,38,38,0.08)",ringColor:"rgba(220,38,38,0.18)",title:"API Limit Reached",primaryLabel:"Contact Us",primaryHref:s.LY,primaryColor:"#DC2626"}};function d(e){let{type:t,onHereClick:i}=e;const a=(0,n.jsx)("span",{role:"link",tabIndex:0,style:o,onClick:i,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())},children:"HERE"}),l=(0,n.jsx)("span",{role:"link",tabIndex:0,style:o,onClick:i,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())},children:"CONTACT US"});return"NO_BUSINESS"===t?(0,n.jsxs)(n.Fragment,{children:["Integrations module is restricted to business users only. Click ",a," to set up a business account."]}):"SWITCH_BUSINESS"===t?(0,n.jsxs)(n.Fragment,{children:["Integrations module is restricted to business users only. Click ",a," to switch on business profile."]}):"NO_API"===t?(0,n.jsxs)(n.Fragment,{children:["Available amount of API calls has been used. Upgrade your premium plan or ",l," to increase the limit."]}):null}const c=e=>{let{show:t,onHide:i,type:s,onSwitch:o,darkMode:c}=e;const u=r[s];if(!u)return null;const p=u.icon,h=!!c,m=h?"#1e2230":"#ffffff",g=h?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.07)",v=h?"#f1f5f9":"#0f172a",x=h?"#94a3b8":"#475569",y=h?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",f=()=>{u.primaryHref?window.location.href=u.primaryHref:"SWITCH_BUSINESS"===s&&o&&o()};return(0,n.jsxs)(a.A,{show:t,onHide:i,centered:!0,backdrop:"static",size:"md",dialogClassName:"irm-dialog",children:[(0,n.jsx)(a.A.Header,{style:{background:m,border:"none",padding:"18px 24px 0",borderRadius:"16px 16px 0 0"},children:(0,n.jsxs)("div",{className:"d-flex align-items-center justify-content-between w-100",children:[(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px",borderRadius:999,background:u.badge.bg,color:u.badge.color,fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase"},children:[(0,n.jsx)(l.FrA,{size:11}),u.badge.label]}),(0,n.jsx)("button",{onClick:i,style:{background:"none",border:"none",cursor:"pointer",color:x,display:"flex",alignItems:"center",padding:4},"aria-label":"Close",children:(0,n.jsx)(l.yGN,{size:20})})]})}),(0,n.jsxs)(a.A.Body,{style:{background:m,padding:"28px 32px",borderRadius:"0 0 16px 16px"},children:[(0,n.jsx)("div",{className:"d-flex justify-content-center mb-4",children:(0,n.jsx)("div",{style:{width:88,height:88,borderRadius:"50%",background:u.ringColor,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("div",{style:{width:64,height:64,borderRadius:"50%",background:u.iconBg,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(p,{size:28,color:u.iconColor})})})}),(0,n.jsx)("h4",{className:"text-center fw-bold mb-2",style:{color:v,fontSize:"1.25rem",lineHeight:1.3},children:u.title}),(0,n.jsx)("p",{className:"text-center mb-4",style:{color:x,fontSize:"0.9rem",lineHeight:1.65},children:(0,n.jsx)(d,{type:s,onHereClick:()=>{f()}})}),(0,n.jsx)("hr",{style:{border:"none",borderTop:"1px solid ".concat(g),margin:"0 0 20px"}}),(0,n.jsxs)("div",{className:"d-flex flex-column gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:f,style:{width:"100%",padding:"12px 20px",borderRadius:9,border:"none",background:"linear-gradient(135deg, ".concat(u.primaryColor,", ").concat(u.primaryColor,"cc)"),color:"#fff",fontWeight:700,fontSize:"0.92rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,boxShadow:"0 4px 14px ".concat(u.primaryColor,"40"),transition:"opacity 0.15s"},onMouseEnter:e=>{e.currentTarget.style.opacity=.88},onMouseLeave:e=>{e.currentTarget.style.opacity=1},children:[u.primaryLabel,(0,n.jsx)(l.dyV,{size:15})]}),(0,n.jsx)("button",{type:"button",onClick:i,style:{width:"100%",padding:"10px 20px",borderRadius:9,border:"1px solid ".concat(g),background:"transparent",color:x,fontWeight:600,fontSize:"0.88rem",cursor:"pointer",transition:"background 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background=y},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:"Maybe Later"})]})]}),(0,n.jsx)("style",{children:"\n .irm-dialog .modal
1-content {\n border-radius: 16px !important;\n border: 1px solid ".concat(g," !important;\n overflow: hidden;\n box-shadow: 0 24px 60px rgba(0,0,0,0.18) !important;\n }\n ")})]})}},42741(e,t,i){i.d(t,{A:()=>r});var a=i(9950),l=i(7285),s=i(28429),n=i(16339),o=i(44414);const r=e=>{var t;let{Type:i,RemainingCredits:r}=e;const d=(0,l.Rs)(),[c,u]=(0,a.useState)(!0),[p,h]=(0,a.useState)(!1),m=(0,s.Zp)();let g=null===(t=Number(r||0))||void 0===t?void 0:t.toFixed(2);(0,a.useEffect)(()=>{if(!d.loading){const s=JSON.parse(localStorage.getItem("userProfile"));if(s){var e;let n=null===s||void 0===s||null===(e=s.user)||void 0===e?void 0:e.businessUserType;if(n&&1==n){var t,i;const e=null===d||void 0===d||null===(t=d.subscription)||void 0===t||null===(i=t.individual)||void 0===i?void 0:i.plan;e&&e.freeplan&&1==e.freeplan&&h(!0)}if(n&&2==n){var a,l;const e=null===d||void 0===d||null===(a=d.subscription)||void 0===a||null===(l=a.business)||void 0===l?void 0:l.plan;e&&e.freeplan&&1==e.freeplan&&h(!0)}}}},[d.loading]);if(!c)return null;if(g>10)return null;const v="Boost"==i||"BoostService"===i||"AutoBoost"===i,x="Listcam"==i||"ListcamInventory"==i,y=v?"Boost credits":"AI search credits",f=v?"boosting":"AI listing",b=1==p?"Upgrade Plan":"Purchase Add-ons",j=1==p?(0,o.jsx)(n.ARf,{"aria-hidden":"true"}):(0,o.jsx)(n.lZI,{"aria-hidden":"true"});return(0,o.jsxs)("div",{className:"animate Addon-credit-ribbon Addon-credit-ribbon--premium",id:"creditRibbon",children:[(0,o.jsxs)("div",{className:"Addon-ribbon-content",children:[(0,o.jsx)("span",{className:"Addon-ribbon-icon",children:(0,o.jsx)(n.FrA,{"aria-hidden":"true"})}),(0,o.jsxs)("span",{className:"Addon-ribbon-copy",children:[(0,o.jsx)("span",{className:"Addon-ribbon-kicker",children:"Credits running low"}),v&&(0,o.jsxs)("span",{className:"Addon-ribbon-text",children:["You have ",g>0?g:0," Boost credits remaining",1==p?" on the Free Plan":"",". ",1==p?"Upgrade your plan":"Purchase add-ons"," to keep boosting your listings."]}),x&&(0,o.jsxs)("span",{className:"Addon-ribbon-text",children:["You have ",g>0?g:0," AI search credits remaining",1==p?" on the Free Plan":"",". ",1==p?"Upgrade your plan":"Purchase add-ons"," to keep using AI listing feature."]})]}),(0,o.jsxs)("span",{className:"Addon-ribbon-balance",children:[(0,o.jsx)("strong",{children:g>0?g:0}),(0,o.jsx)("small",{children:y})]})]}),(0,o.jsxs)("div",{className:"Addon-ribbon-actions",children:[(0,o.jsxs)("button",{onClick:1==p?()=>{m("/subscription-plans")}:()=>{m("/subscriptions/addons?type=".concat(i))},className:"Addon-btn Addon-btn-primary",id:"purchaseBtn",children:[j,b,(0,o.jsx)(n.dyV,{"aria-hidden":"true"})]}),(0,o.jsx)("button",{className:"Addon-btn Addon-btn-secondary",onClick:()=>{u(!1)},id:"dismissBtn",children:"Later"}),(0,o.jsx)("button",{className:"Addon-btn-close",onClick:()=>{u(!1)},id:"closeBtn","aria-label":"Dismiss ".concat(f," credit warning"),children:(0,o.jsx)(n.yGN,{"aria-hidden":"true"})})]})]})}},72835(e,t,i){i.d(t,{DD:()=>r,LY:()=>s,QH:()=>l});var a=i(74421);const l="/services/provider/profile",s="/contactus",n=e=>"string"===typeof e&&""!==e.trim();function o(e){var t,i;const l=Number((null===e||void 0===e||null===(t=e.user)||void 0===t?void 0:t.businessTypeUser)||0),s=2===Number(null===e||void 0===e||null===(i=e.user)||void 0===i?void 0:i.businessUserType)?2:1;return(0,a.mG)(l)&&function(e){if(!e||"object"!==typeof e)return!1;if(n(e.companyName)||n(e.business_name))return!0;try{const t="string"===typeof e.serviceBusinessData?JSON.parse(e.serviceBusinessData):e.serviceBusinessData;return n(null===t||void 0===t?void 0:t.business_name)}catch(t){return!1}}(null===e||void 0===e?void 0:e.businessUserDetails)?2!==s?{allowed:!1,restrictionType:"SWITCH_BUSINESS"}:{allowed:!0,restrictionType:null}:{allowed:!1,restrictionType:"NO_BUSINESS"}}function r(e,t){const i=o(e);return i.allowed?function(e){const t=null===e||void 0===e?void 0:e.APILimit,i=null===e||void 0===e?void 0:e.APILimitUsage;return"Unlimited"!==t&&"unlimited"!==t&&parseInt(t,10)>0&&parseInt(i,10)>=parseInt(t,10)?{allowed:!1,restrictionType:"NO_API"}:{allowed:!0,restrictionType:null}}(t):i}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.