1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6060],{20745:(e,t,r)=>{Promise.resolve().then(r.bind(r,49089))},49089:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>T});var s=r(95155),a=r(12115),l=r(37882),i=r(38434),o=r(90549),n=r(51914),d=r(68822),c=r(92451),x=r(91958),m=r(55243),p=r(33210),h=r(94514),u=r(67635),g=r(22164),y=r(37618),b=r(52530),f=r(88632),j=r(44254),N=r(92972),w=r(47834),v=r(17243),k=r(68459);let P=["general","bedding","nutrition","grooming","toys","health","accessories","training"],A=["electronics","audio-headphones","smart-home","home-kitchen","beauty-personal-care","sports-outdoors","office-supplies","gaming","fashion","books","general"],S=["any","dog","cat","bird","fish","rabbit","hamster","reptile"],C={title:"",description:"",affiliateLink:"",imageUrl:"",price:"",category:"general",petType:"any",productType:"pet",isActive:!0};function T(){let e,{data:t,status:r}=(0,l.useSession)(),[k,T]=(0,a.useState)(!0),[L,E]=(0,a.useState)(!1),[z,$]=(0,a.useState)([]),[F,O]=(0,a.useState)(!0),[_,I]=(0,a.useState)(""),[R,H]=(0,a.useState)(""),[B,D]=(0,a.useState)(!1),[q,W]=(0,a.useState)(""),[Y,M]=(0,a.useState)(!1),[G,J]=(0,a.useState)(!1),[K,V]=(0,a.useState)("pet"),[X,Q]=(0,a.useState)(!1),[Z,ee]=(0,a.useState)(null),[et,er]=(0,a.useState)({...C}),[es,ea]=(0,a.useState)(!1),[el,ei]=(0,a.useState)(null),[eo,en]=(0,a.useState)(null),[ed,ec]=(0,a.useState)(!1),ex=_?`https://aipetz.ai/shop/${_}`:"";(0,a.useEffect)(()=>{"loading"===r||t&&em()},[t,r]);let em=async()=>{try{let e=await fetch("/api/user/tier"),t=await e.json();E(!0===t.isPaidUser)}catch{E(!1)}finally{T(!1)}};(0,a.useEffect)(()=>{L&&ep()},[L]);let ep=async()=>{O(!0);try{let e=await fetch("/api/shop/products"),t=await e.json();t.success&&($(t.products),I(t.username||""),W(t.username||""),H(t.shopBio||""))}catch{i.Ay.error("Failed to load your shop")}finally{O(!1)}},eh=async(e,t)=>{await navigator.clipboard.writeText(e),en(t),setTimeout(()=>en(null),2e3)},eu=async e=>{let t=e.target.files?.[0];if(t){ec(!0);try{let e=new FormData;e.append("file",t),e.append("type","product");let r=await fetch("/api/upload",{method:"POST",body:e}),s=await r.json();s.fileUrl?er(e=>({...e,imageUrl:s.fileUrl})):s.url&&er(e=>({...e,imageUrl:s.url}))}catch{i.Ay.error("Image upload failed")}finally{ec(!1)}}},eg=()=>{ee(null),er({...C,productType:K}),Q(!0)},ey=async()=>{if(!et.title.trim())return void i.Ay.error("Product title is required");if(!et.affiliateLink.trim())return void i.Ay.error("Affiliate link is required");ea(!0);try{let e=await fetch("/api/shop/products",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({productId:Z?.id,...et,productType:et.productType||"pet"})}),t=await e.json();if(!t.success)throw Error(t.error);i.Ay.success(Z?"Product updated!":"Product added to your shop!"),t.username&&!_&&I(t.username),Q(!1),ep()}catch(e){i.Ay.error(e instanceof Error?e.message:"Failed to save product")}finally{ea(!1)}},eb=async e=>{ei(e);try{let t=await fetch(`/api/shop/products?productId=${e}`,{method:"DELETE"}),r=await t.json();if(!r.success)throw Error(r.error);$(t=>t.filter(t=>t.id!==e)),i.Ay.success("Product removed")}catch{i.Ay.error("Failed to delete product")}finally{ei(null)}},ef=async()=>{J(!0);try{let e=await fetch("/api/shop/profile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopBio:R,shopUsername:q})}),t=await e.json();if(!t.success)throw Error(t.error);I(t.username||_),W(t.username||_),D(!1),M(!1),i.Ay.success("Shop profile saved!")}catch(e){i.Ay.error(e instanceof Error?e.message:"Failed to save profile")}finally{J(!1)}};return"loading"===r||k?(0,s.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-10 h-10 border-4 border-orange-500 border-t-transparent rounded-full animate-spin"})}):t?L?(0,s.jsxs)("div",{className:"min-h-screen bg-background text-textPrimary",children:[(0,s.jsx)("div",{className:"border-b border-gray-200 bg-white/90 backdrop-blur-sm sticky top-0 z-10 shadow-sm",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-4 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-xl bg-gradient-to-br from-green-500 to-teal-500",children:(0,s.jsx)(o.A,{className:"w-5 h-5 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold text-textPrimary",children:"My Pet Shop"}),(0,s.jsx)("p",{className:"text-xs text-textSecondary",children:"Your public affiliate storefront"})]})]}),(0,s.jsxs)("button",{onClick:eg,className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-gradient-to-r from-green-500 to-teal-500 text-white text-sm font-medium hover:opacity-90 transition-opacity",children:[(0,s.jsx)(n.A,{className:"w-4 h-4"}),"Add Product"]})]})}),(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8 space-y-8",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-amber-50 border border-amber-200 rounded-2xl",children:[(0,s.jsx)(d.A,{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-amber-700 font-semibold text-sm mb-1",children:"Submit your shop URL to Amazon Associates"}),(0,s.jsx)("p",{className:"text-amber-600 text-xs leading-relaxed",children:"When Amazon asks for your website URL during signup, use your unique shop link below. It's a real public webpage showing all your affiliate products â exactly what they need."})]})]}),(0,s.jsxs)("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm p-6",children:[(0,s.jsxs)("h2",{className:"text-textPrimary font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"w-5 h-5 text-green-500"}),"Your Public Shop URL"]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-xs text-textSecondary mb-1.5",children:"Shop handle (appears in your URL)"}),Y?(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-0 flex-1 bg-white border border-gray-300 rounded-xl overflow-hidden",children:[(0,s.jsx)("span",{className:"px-3 py-2.5 text-gray-400 text-sm bg-gray-50 border-r border-gray-200 whitespace-nowrap",children:"aipetz.ai/sh
1op/"}),(0,s.jsx)("input",{type:"text",value:q,onChange:e=>W(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),className:"flex-1 bg-transparent px-3 py-2.5 text-textPrimary text-sm focus:outline-none",placeholder:"your-name",maxLength:30})]}),(0,s.jsx)("button",{onClick:ef,disabled:G,className:"px-4 py-2 rounded-xl bg-green-500 text-white text-sm font-medium disabled:opacity-50",children:G?(0,s.jsx)(x.A,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(m.A,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:()=>{M(!1),W(_)},className:"px-3 py-2 rounded-xl bg-gray-100 text-textPrimary text-sm",children:(0,s.jsx)(p.A,{className:"w-4 h-4"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1 bg-green-50 border border-green-200 rounded-xl px-4 py-2.5",children:[(0,s.jsx)(c.A,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-green-700 text-sm font-mono flex-1 truncate",children:ex||"Set your shop name â"})]}),ex&&(0,s.jsx)("button",{onClick:()=>eh(ex,"publicUrl"),className:"p-2.5 rounded-xl bg-white border border-gray-200 text-gray-400 hover:text-textPrimary transition-colors",children:"publicUrl"===eo?(0,s.jsx)(h.A,{className:"w-4 h-4 text-green-500"}):(0,s.jsx)(u.A,{className:"w-4 h-4"})}),ex&&(0,s.jsx)("a",{href:ex,target:"_blank",rel:"noopener noreferrer",className:"p-2.5 rounded-xl bg-white border border-gray-200 text-gray-400 hover:text-textPrimary transition-colors",children:(0,s.jsx)(g.A,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:()=>M(!0),className:"p-2.5 rounded-xl bg-white border border-gray-200 text-gray-400 hover:text-textPrimary transition-colors",children:(0,s.jsx)(y.A,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-textSecondary mb-1.5",children:"Shop bio (shown on your public page)"}),B?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("textarea",{value:R,onChange:e=>H(e.target.value),rows:3,maxLength:300,placeholder:"Tell visitors about you and your pets â what you recommend and why you love these products...",className:"w-full bg-white border border-gray-300 rounded-xl px-4 py-3 text-textPrimary placeholder-gray-400 text-sm resize-none focus:outline-none focus:border-green-400 transition-colors"}),(0,s.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,s.jsx)("button",{onClick:()=>D(!1),className:"px-3 py-1.5 rounded-lg bg-gray-100 text-textPrimary text-xs",children:"Cancel"}),(0,s.jsx)("button",{onClick:ef,disabled:G,className:"px-4 py-1.5 rounded-lg bg-green-500 text-white text-xs font-medium disabled:opacity-50",children:G?"Saving...":"Save Bio"})]})]}):(0,s.jsx)("div",{onClick:()=>D(!0),className:"cursor-pointer min-h-[44px] bg-orange-50/60 border border-dashed border-gray-300 hover:border-green-400 rounded-xl px-4 py-3 text-sm transition-colors",children:R?(0,s.jsx)("p",{className:"text-textPrimary",children:R}):(0,s.jsx)("p",{className:"text-gray-400",children:"Click to add a shop bio..."})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h2",{className:"text-textPrimary font-bold flex items-center gap-2",children:[(0,s.jsx)(b.A,{className:"w-5 h-5 text-teal-500"}),"Your Products",(0,s.jsxs)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:["(",z.length,"/50)"]})]}),(0,s.jsx)("button",{onClick:ep,className:"p-2 rounded-xl text-textSecondary hover:text-textPrimary hover:bg-orange-50 transition-colors",children:(0,s.jsx)(x.A,{className:"w-4 h-4"})})]}),(0,s.jsxs)("div",{className:"flex gap-2 mb-5 p-1 bg-gray-100 rounded-2xl w-fit",children:[(0,s.jsxs)("button",{onClick:()=>V("pet"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-medium transition-all ${"pet"===K?"bg-white text-textPrimary shadow-sm":"text-textSecondary hover:text-textPrimary"}`,children:[(0,s.jsx)(f.A,{className:"w-4 h-4"})," Pet Products"]}),(0,s.jsxs)("button",{onClick:()=>V("general"),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-medium transition-all ${"general"===K?"bg-white text-textPrimary shadow-sm":"text-textSecondary hover:text-textPrimary"}`,children:[(0,s.jsx)(j.A,{className:"w-4 h-4"})," All Products"]})]}),"general"===K&&(0,s.jsxs)("div",{className:"flex items-start gap-2 p-3 mb-4 bg-blue-50 border border-blue-200 rounded-xl",children:[(0,s.jsx)(N.A,{className:"w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5"}),(0,s.jsxs)("p",{className:"text-blue-700 text-xs leading-relaxed",children:[(0,s.jsx)("strong",{children:"High-commission Amazon categories:"})," Electronics (1â4%), Headphones & Audio (3%), Smart Home (3%), Beauty (6%), Kitchen (4.5%), Sports (3%), Books (4.5%), Games (2%). Add any product â your pet can review it in Interview Mode wearing the right outfit!"]})]}),F?(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[void 0,void 0,void 0].map((e,t)=>(0,s.jsx)("div",{className:"bg-gray-100 rounded-2xl h-48 animate-pulse"},t))}):0===(e=z.filter(e=>(e.productType||"pet")===K)).length?(0,s.jsxs)("div",{className:"text-center py-16 bg-orange-50/60 rounded-2xl border border-dashed border-gray-200",children:["pet"===K?(0,s.jsx)(f.A,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}):(0,s.jsx)(j.A,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),(0,s.jsx)("h3",{className:"text-textPrimary font-bold mb-2",children:"pet"===K?"No pet products yet":"No general products yet"}),(0,s.jsx)("p",{className:"text-textSecondary text-sm mb-6",children:"pet"===K?"Add your first Amazon affiliate pet product to get started.":"Add electronics, headphones, home goods and more â let your pet review them!"}),(0,s.jsxs)("button",{onClick:eg,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-gradient-to-r from-green-500 to-teal-500 text-white text-sm font-semibold hover:opacity-90 transition-opacity",children:[(0,s.jsx)(n.A,{className:"w-4 h-4"})," Add Your First Product"]})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>(0,s.jsx)(U,{product:e,deleting:el===e.id,copiedField:eo,onEdit:()=>
1{ee(e),er({title:e.title,description:e.description,affiliateLink:e.affiliateLink,imageUrl:e.imageUrl||"",price:e.price||"",category:e.category,petType:e.petType,productType:e.productType||"pet",isActive:e.isActive}),Q(!0)},onDelete:()=>eb(e.id),onCopy:eh},e.id))})]})]}),X&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-white border border-gray-200 rounded-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto shadow-xl",children:[(0,s.jsxs)("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"text-textPrimary font-bold",children:Z?"Edit Product":"Add Product"}),(0,s.jsx)("button",{onClick:()=>Q(!1),className:"p-1.5 rounded-lg text-gray-400 hover:text-textPrimary transition-colors",children:(0,s.jsx)(p.A,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-textPrimary mb-2",children:"Product Type"}),(0,s.jsxs)("div",{className:"flex gap-2 p-1 bg-gray-100 rounded-xl w-fit",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>er(e=>({...e,productType:"pet",category:"general",petType:"any"})),className:`flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition-all ${"pet"===et.productType?"bg-white text-textPrimary shadow-sm":"text-textSecondary"}`,children:[(0,s.jsx)(f.A,{className:"w-3.5 h-3.5"})," Pet Product"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>er(e=>({...e,productType:"general",category:"electronics",petType:"any"})),className:`flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition-all ${"general"===et.productType?"bg-white text-textPrimary shadow-sm":"text-textSecondary"}`,children:[(0,s.jsx)(j.A,{className:"w-3.5 h-3.5"})," General Product"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:["Product Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:et.title,onChange:e=>er(t=>({...t,title:e.target.value})),placeholder:"pet"===et.productType?"e.g. PetSafe Orthopedic Dog Bed":"e.g. Sony WH-1000XM5 Noise Cancelling Headphones",className:"w-full bg-white border border-gray-300 rounded-xl px-4 py-3 text-textPrimary placeholder-gray-400 text-sm focus:outline-none focus:border-green-400 transition-colors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:"Description"}),(0,s.jsx)("textarea",{value:et.description,onChange:e=>er(t=>({...t,description:e.target.value})),placeholder:"What makes this product great for pets? Why do you recommend it?",rows:3,className:"w-full bg-white border border-gray-300 rounded-xl px-4 py-3 text-textPrimary placeholder-gray-400 text-sm focus:outline-none focus:border-green-400 transition-colors resize-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(w.A,{className:"w-3.5 h-3.5 text-green-500"})," Amazon Affiliate Link ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]})}),(0,s.jsx)("input",{type:"url",value:et.affiliateLink,onChange:e=>er(t=>({...t,affiliateLink:e.target.value})),placeholder:"https://amzn.to/your-link",className:"w-full bg-white border border-gray-300 rounded-xl px-4 py-3 text-textPrimary placeholder-gray-400 text-sm font-mono focus:outline-none focus:border-green-400 transition-colors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:["Price ",(0,s.jsx)("span",{className:"text-gray-400 text-xs",children:"(optional)"})]}),(0,s.jsx)("input",{type:"text",value:et.price,onChange:e=>er(t=>({...t,price:e.target.value})),placeholder:"e.g. $29.99",className:"w-full bg-white border border-gray-300 rounded-xl px-4 py-3 text-textPrimary placeholder-gray-400 text-sm focus:outline-none focus:border-green-400 transition-colors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:["Product Image ",(0,s.jsx)("span",{className:"text-gray-400 text-xs",children:"(optional)"})]}),et.imageUrl?(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-white border border-gray-200 rounded-xl",children:[(0,s.jsx)("img",{src:et.imageUrl,alt:"Product",className:"w-14 h-14 roun
1ded-lg object-cover flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-textPrimary text-sm",children:"Image uploaded"}),(0,s.jsx)("button",{onClick:()=>er(e=>({...e,imageUrl:""})),className:"text-gray-400 text-xs hover:text-red-500 transition-colors",children:"Remove"})]})]}):(0,s.jsxs)("label",{className:"flex items-center gap-3 p-4 bg-orange-50/60 border-2 border-dashed border-gray-300 rounded-xl cursor-pointer hover:border-green-400 transition-colors",children:[ed?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.A,{className:"w-5 h-5 text-green-500 animate-spin"}),(0,s.jsx)("span",{className:"text-gray-500 text-sm",children:"Uploading..."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{className:"w-5 h-5 text-gray-400"}),(0,s.jsx)("span",{className:"text-gray-500 text-sm",children:"Upload product photo"})]}),(0,s.jsx)("input",{type:"file",accept:"image/*",onChange:eu,className:"hidden",disabled:ed})]}),(0,s.jsx)("p",{className:"text-gray-400 text-xs mt-1.5",children:"Or paste a URL instead:"}),(0,s.jsx)("input",{type:"url",value:et.imageUrl,onChange:e=>er(t=>({...t,imageUrl:e.target.value})),placeholder:"https://... (product image URL)",className:"mt-1.5 w-full bg-white border border-gray-300 rounded-xl px-4 py-2.5 text-textPrimary placeholder-gray-400 text-xs font-mono focus:outline-none focus:border-green-400 transition-colors"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:"Category"}),(0,s.jsx)("select",{value:et.category,onChange:e=>er(t=>({...t,category:e.target.value})),className:"w-full bg-white border border-gray-300 rounded-xl px-3 py-3 text-textPrimary text-sm focus:outline-none focus:border-green-400 transition-colors",children:("general"===et.productType?A:P).map(e=>(0,s.jsx)("option",{value:e,children:e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e))})]}),"pet"===et.productType&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-textPrimary mb-1.5",children:"Pet Type"}),(0,s.jsx)("select",{value:et.petType,onChange:e=>er(t=>({...t,petType:e.target.value})),className:"w-full bg-white border border-gray-300 rounded-xl px-3 py-3 text-textPrimary text-sm focus:outline-none focus:border-green-400 transition-colors",children:S.map(e=>(0,s.jsx)("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:()=>er(e=>({...e,isActive:!e.isActive})),className:`relative w-11 h-6 rounded-full transition-colors ${et.isActive?"bg-green-500":"bg-gray-300"}`,children:(0,s.jsx)("span",{className:`absolute top-0.5 w-5 h-5 bg-white rounded-full shadow transition-all ${et.isActive?"left-5":"left-0.5"}`})}),(0,s.jsx)("span",{className:"text-textPrimary text-sm",children:"Visible on my public shop"})]}),(0,s.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,s.jsx)("button",{onClick:()=>Q(!1),className:"flex-1 py-3 rounded-xl bg-gray-100 text-textPrimary text-sm font-medium hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,s.jsx)("button",{onClick:ey,disabled:es,className:"flex-1 py-3 rounded-xl bg-gradient-to-r from-green-500 to-teal-500 text-white text-sm font-semibold hover:opacity-90 disabled:opacity-50 transition-opacity",children:es?"Saving...":Z?"Update Product":"Add to Shop"})]})]})]})})]}):(0,s.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center px-4",children:(0,s.jsxs)("div",{className:"max-w-md text-center",children:[(0,s.jsx)(o.A,{className:"w-16 h-16 text-orange-400 mx-auto mb-4"}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-textPrimary mb-3",children:"Pet Shop requires Popular+ plan"}),(0,s.jsx)("p",{className:"text-textSecondary mb-6",children:"Upgrade to create your own pet affiliate storefront and submit it to Amazon Associates."}),(0,s.jsx)("a",{href:"/upgrade",className:"inline-flex items-center gap-2 px-6 py-3 rounded-xl bg-gradient-to-r from-orange-500 to-pink-500 text-white font-semibold hover:opacity-90 transition-opacity",children:"Upgrade Now"})]})}):null}function U({product:e,deleting:t,copiedField:r,onEdit:a,onDelete:l,onCopy:i}){let n={bedding:"bg-blue-500/20 text-blue-400",nutrition:"bg-green-500/20 text-green-400",grooming:"bg-purple-500/20 text-purple-400",toys:"bg-yellow-500/20 text-yellow-400",health:"bg-red-500/20 text-red-400",accessories:"bg-pink-500/20 text-pink-400",training:"bg-orange-500/20 text-orange-400",general:"bg-gray-500/20 text-gray-400"};return(0,s.jsxs)("div",{className:`bg-white rounded-2xl border shadow-sm overflow-hidden transition-all ${e.
1isActive?"border-gray-200":"border-gray-100 opacity-60"}`,children:[e.imageUrl?(0,s.jsx)("img",{src:e.imageUrl,alt:e.title,className:"w-full h-40 object-cover"}):(0,s.jsx)("div",{className:"w-full h-40 bg-orange-50 flex items-center justify-center",children:(0,s.jsx)(o.A,{className:"w-10 h-10 text-gray-300"})}),(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,s.jsx)("h3",{className:"text-textPrimary font-semibold text-sm leading-snug flex-1",children:e.title}),!e.isActive&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-gray-100 text-gray-400 flex-shrink-0",children:"Hidden"})]}),(0,s.jsxs)("div",{className:"flex gap-1.5 mb-3 flex-wrap",children:[(0,s.jsx)("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-medium ${n[e.category]||n.general}`,children:e.category}),"any"!==e.petType&&(0,s.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-teal-500/20 text-teal-600 font-medium",children:e.petType}),e.price&&(0,s.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-amber-500/20 text-amber-600 font-medium",children:e.price})]}),e.description&&(0,s.jsx)("p",{className:"text-gray-400 text-xs mb-3 line-clamp-2",children:e.description}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-3",children:[(0,s.jsx)("code",{className:"flex-1 text-gray-400 text-[10px] truncate bg-orange-50 rounded px-2 py-1",children:e.affiliateLink}),(0,s.jsx)("button",{onClick:()=>i(e.affiliateLink,`link-${e.id}`),className:"p-1.5 rounded-lg bg-gray-100 text-gray-400 hover:text-green-600 transition-colors flex-shrink-0",children:r===`link-${e.id}`?(0,s.jsx)(h.A,{className:"w-3 h-3 text-green-500"}):(0,s.jsx)(u.A,{className:"w-3 h-3"})}),(0,s.jsx)("a",{href:e.affiliateLink,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-lg bg-gray-100 text-gray-400 hover:text-textPrimary transition-colors flex-shrink-0",children:(0,s.jsx)(g.A,{className:"w-3 h-3"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:a,className:"flex-1 flex items-center justify-center gap-1.5 py-1.5 rounded-lg bg-gray-100 text-textSecondary text-xs hover:bg-gray-200 transition-colors",children:[(0,s.jsx)(y.A,{className:"w-3 h-3"})," Edit"]}),(0,s.jsx)("button",{onClick:l,disabled:t,className:"flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-lg bg-gray-100 text-gray-400 hover:text-red-500 text-xs disabled:opacity-50 transition-colors",children:t?(0,s.jsx)(x.A,{className:"w-3 h-3 animate-spin"}):(0,s.jsx)(k.A,{className:"w-3 h-3"})})]})]})]})}}},e=>{e.O(0,[4121,6593,2076,7358],()=>e(e.s=20745)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.