'+S+"");const fe=ne?z(S):S;if(Yi===si)try{R=new y().parseFromString(fe,bi)}catch{}if(!R||!R.documentElement){R=Ce.createDocument(Yi,"template",null);try{R.documentElement.innerHTML=Qt?pe:fe}catch{}}const ge=R.body||R.documentElement;return S&&se&&ge.insertBefore(r.createTextNode(se),ge.childNodes[0]||null),Yi===si?W.call(R,Et?"html":"body")[0]:Et?R.documentElement:ge},Ie=function(S){const R=Q?Q(S):S.ownerDocument;return E.call(R||S,S,b.SHOW_ELEMENT|b.SHOW_COMMENT|b.SHOW_TEXT|b.SHOW_PROCESSING_INSTRUCTION|b.SHOW_CDATA_SECTION,null)},ui=function(S){return S=tr(S,le," "),S=tr(S,oe," "),S=tr(S,Me," "),S},yt=function(S){var R;S.normalize();const se=Q?Q(S):S.ownerDocument,fe=E.call(se||S,S,b.SHOW_TEXT|b.SHOW_COMMENT|b.SHOW_CDATA_SECTION|b.SHOW_PROCESSING_INSTRUCTION,null);let ge=fe.nextNode();for(;ge;)ge.data=ui(ge.data),ge=fe.nextNode();const De=(R=S.querySelectorAll)===null||R===void 0?void 0:R.call(S,"template");De&&la(De,st=>{Rs(st.content)&&yt(st.content)})},an=function(S){const R=Z?Z(S):null;return typeof R!="string"||xt(R)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==H(S)||typeof S.removeAttribute!="function"||typeof S.removeAttributeNode!="function"||typeof S.getAttributeNode!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==M(S)||S.childNodes!==T(S)},Rs=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return M(S)===zi.documentFragment}catch{return!1}},ws=function(S){if(!M||typeof S!="object"||S===null)return!1;try{return typeof M(S)=="number"}catch{return!1}};function Ki(re,S,R){re.length!==0&&la(re,se=>{se.call(a,S,R,rs)})}const yi=function(S,R){return!!(ze&&S.hasChildNodes()&&!ws(S.firstElementChild)&&fi(Bb,S.textContent)&&fi(Bb,S.innerHTML)||ze&&S.namespaceURI===si&&rA[R]&&(ws(S.firstElementChild)||typeof S.textContent=="string"&&fi(oA[R],S.textContent))||S.nodeType===zi.processingInstruction||ze&&S.nodeType===zi.comment&&fi(Tb,S.data))},ln=function(S,R){if(S instanceof RegExp)return fi(S,R);if(S instanceof Function){for(var se=arguments.length,fe=new Array(se>2?se-2:0),ge=2;ge=0;--st){const ft=S===se?D(ge[st],!0):ge[st];fe.insertBefore(ft,F(S))}}}return $t(S),!0},xa=function(S,R,se,fe){return S.length===0?R:R===se||R===fe?Fi(R):R},Ms=function(S,R){return S===R||U(S)!==null?!1:(ls&&g(S),!0)},cl=function(S,R){if(Ki(J.beforeSanitizeElements,S,null),Ms(S,R))return!0;if(an(S))return $t(S),!0;const se=xt(ce(S));if(Le=xa(J.uponSanitizeElement,Le,et,Ts),Ki(J.uponSanitizeElement,S,{tagName:se,allowedTags:Le}),Ms(S,R))return!0;if(yi(S,se))return $t(S),!0;if(gi[se]||!(_.tagCheck instanceof Function&&_.tagCheck(se))&&!Le[se]){const ge=vr(S,se,R);return ge===!1&&Ki(J.afterSanitizeElements,S,null),ge}if(ee(S)===zi.element&&!ma(S)||(se==="noscript"||se==="noembed"||se==="noframes")&&fi(aA,S.innerHTML))return $t(S),!0;if(mt&&S.nodeType===zi.text){const ge=ui(S.textContent);S.textContent!==ge&&(er(a.removed,{element:S.cloneNode()}),S.textContent=ge)}return Ki(J.afterSanitizeElements,S,null),!1},ul=function(S,R,se){if(as[R]||K(R,S)||tt&&(R==="id"||R==="name")&&(se in r||se in Os))return!1;const fe=He[R]||_.attributeCheck instanceof Function&&_.attributeCheck(R,S);return Xe&&fi(de,R)||xe&&fi(Ke,R)?!0:fe?zn[R]||fi(ci,tr(se,Ee,""))||(R==="src"||R==="xlink:href"||R==="href")&&S!=="script"&&wb(se,"data:")===0&&Ci[S]||ht&&!fi(Oe,tr(se,Ee,""))?!0:!se:jr(S)&&ln(Vt.tagNameCheck,S)&&ln(Vt.attributeNameCheck,R,S)||R==="is"&&Vt.allowCustomizedBuiltInElements&&ln(Vt.tagNameCheck,se)},rn=Ze({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),jr=function(S){return!rn[ar(S)]&&fi(wt,S)},wr=function(S,R,se,fe){if(ne&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!se)switch(v.getAttributeType(S,R)){case"TrustedHTML":return z(fe);case"TrustedScriptURL":return ae(fe)}return fe},Er=function(S,R,se,fe){try{return se?S.setAttributeNS(se,R,fe):S.setAttribute(R,fe),an(S)?($t(S),!1):!0}catch{return Gi(R,S),!1}},pa=function(S){Ki(J.beforeSanitizeAttributes,S,null);const R=S.attributes;if(!R||an(S))return;He=xa(J.uponSanitizeAttribute,He,ns,ks);const se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0};let fe=R.length;const ge=xt(S.nodeName);for(;fe--;){const De=R[fe],st=De.name,ft=De.namespaceURI,Ht=De.value,vt=xt(st),Un=Ht;let Bt=st==="value"?Un:P4(Un),us=!1;if(se.attrName=vt,se.attrValue=Bt,se.keepAttr=!0,se.forceKeepAttr=void 0,Ki(J.uponSanitizeAttribute,S,se),Bt=se.attrValue,da&&(vt==="id"||vt==="name")&&wb(Bt,Hn)!==0&&(Gi(st,S,De),Bt=Hn+Bt,us=!0),ze&&fi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Bt)){Gi(st,S,De);continue}if(vt==="attributename"&&jb(Bt,"href")){Gi(st,S,De);continue}if(!se.forceKeepAttr){if(!se.keepAttr){Gi(st,S,De);continue}if(!ct&&fi(lA,Bt)){Gi(st,S,De);continue}if(mt&&(Bt=ui(Bt)),!ul(ge,vt,Bt)){Gi(st,S,De);continue}Bt=wr(ge,vt,ft,Bt),Bt!==Un&&Er(S,st,ft,Bt)&&us&&vb(a.removed)}}Ki(J.afterSanitizeAttributes,S,null)},ga=function(S){let R=null;const se=Ie(S);for(Ki(J.beforeSanitizeShadowDOM,S,null);R=se.nextNode();)if(Ki(J.uponSanitizeShadowNode,R,null),cl(R,S),pa(R),Rs(R.content)&&ga(R.content),ee(R)===zi.element){const fe=q(R);Rs(fe)&&(dl(fe),ga(fe))}Ki(J.afterSanitizeShadowDOM,S,null)},dl=function(S){const R=[{node:S,shadow:null}];for(;R.length>0;){const se=R.pop();if(se.shadow){ga(se.shadow);continue}const fe=se.node,De=ee(fe)===zi.element,st=T(fe);if(st)for(let ft=st.length-1;ft>=0;--ft)R.push({node:st[ft],shadow:null});if(De){const ft=Z?Z(fe):null;if(typeof ft=="string"&&xt(ft)==="template"){const Ht=fe.content;Rs(Ht)&&R.push({node:Ht,shadow:null})}}if(De){const ft=q(fe);Rs(ft)&&R.push({node:null,shadow:ft},{node:ft,shadow:null})}}};return a.sanitize=function(re){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,se=null,fe=null,ge=null;if(Qt=!re,Qt&&(re="\x3C!-->"),typeof re!="string"&&!ws(re)&&(re=K4(re),typeof re!="string"))throw na("dirty is not a string, aborting");if(!a.isSupported)return re;Bs?(Le=Ts,He=ks):qi(S),(J.uponSanitizeElement.length>0||J.uponSanitizeAttribute.length>0)&&(Le=Fi(Le)),J.uponSanitizeAttribute.length>0&&(He=Fi(He)),a.removed=[];const De=ls&&typeof re!="string"&&ws(re);if(De){te(re);const Ht=ce(re);if(typeof Ht=="string"){const vt=xt(Ht);if(!Le[vt]||gi[vt])throw sn(re),na("root node is forbidden and cannot be sanitized in-place")}if(an(re))throw sn(re),na("root node is clobbered and cannot be sanitized in-place");try{dl(re)}catch(vt){throw sn(re),vt}}else if(ws(re))R=ue("\x3C!---->"),se=R.ownerDocument.importNode(re,!0),se.nodeType===zi.element&&se.nodeName==="BODY"||se.nodeName==="HTML"?R=se:R.appendChild(se),dl(R);else{if(!Te&&!mt&&!Et&&re.indexOf("<")===-1)return ne&&me?z(re):re;if(R=ue(re),!R)return Te?null:me?pe:""}R&&Li&&$t(R.firstChild);const st=De?re:R;try{const Ht=Ie(st);for(;fe=Ht.nextNode();)cl(fe,st),pa(fe),Rs(fe.content)&&ga(fe.content)}catch(Ht){throw De&&(sn(re),la(a.removed,vt=>{vt.element&&g(vt.element)})),Ht}if(De)return la(a.removed,Ht=>{Ht.element&&g(Ht.element)}),mt&&yt(re),re;if(Te){if(mt&&yt(R),bt)for(ge=A.call(R.ownerDocument);R.firstChild;)ge.appendChild(R.firstChild);else ge=R;return(He.shadowroot||He.shadowrootmode)&&(ge=V.call(o,ge,!0)),ge}let ft=Et?R.outerHTML:R.innerHTML;return Et&&Le["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&fi(sA,R.ownerDocument.doctype.name)&&(ft=" `+ft),mt&&(ft=ui(ft)),ne&&me?z(ft):ft},a.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qi(re),Bs=!0,Ts=Le,ks=He},a.clearConfig=function(){rs=null,Bs=!1,Ts=null,ks=null,ne=Se,pe=""},a.isValidAttribute=function(re,S,R){rs||qi({});const se=xt(re),fe=xt(S);return ul(se,fe,R)},a.addHook=function(re,S){typeof S=="function"&&Ai(J,re)&&er(J[re],S)},a.removeHook=function(re,S){if(Ai(J,re)){if(S!==void 0){const R=U4(J[re],S);return R===-1?void 0:L4(J[re],R,1)[0]}return vb(J[re])}},a.removeHooks=function(re){Ai(J,re)&&(J[re]=[])},a.removeAllHooks=function(){J=kb()},a}var xc=ky();function dA(){const{navigateTo:s}=Rt(),[a,r]=N.useState(null),[o,u]=N.useState(!0);return N.useEffect(()=>{document.title="Privacy Policy | PureStitch",window.scrollTo(0,0),hc("privacy-policy").then(h=>r(h)).catch(h=>console.warn("Failed to load policy:",h)).finally(()=>u(!1))},[]),i.jsx("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-5 md:px-10",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs text-[#5A4E55]",children:[i.jsx("button",{onClick:()=>s("home"),className:"hover:text-[#7B4B8E] transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-[#3AA89C] font-medium",children:"Privacy Policy"})]}),i.jsxs("div",{className:"border-b border-[#E8DDD0] pb-8 mb-10",children:[i.jsx("span",{className:"text-xs tracking-[0.25em] uppercase text-[#3AA89C] font-semibold block mb-2",children:"Legal & Trust"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229] mb-3",children:a?.title?.replace(" | PureStitch","")||"Privacy Policy"}),a?.updated_at&&i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Last Updated: ",i.jsx("span",{className:"font-semibold text-[#2A2229]",children:new Date(a.updated_at).toLocaleDateString("en-IN",{day:"numeric",month:"long",year:"numeric"})})]})]}),i.jsx("div",{className:"bg-white/90 rounded-3xl p-6 md:p-10 border border-[#E8DDD0] shadow-sm space-y-6 text-sm leading-relaxed text-[#5A4E55]",children:o?i.jsxs("div",{className:"space-y-4 py-8 animate-pulse",children:[i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-3/4"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-5/6"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-2/3"})]}):a?.content_html?i.jsx("div",{className:"prose max-w-none text-sm text-[#5A4E55] space-y-4 [&>h2]:font-serif [&>h2]:text-2xl [&>h2]:text-[#2A2229] [&>h3]:font-serif [&>h3]:text-xl [&>h3]:text-[#2A2229] [&>ul]:list-disc [&>ul]:pl-5 [&>ul]:space-y-1.5 [&>p]:leading-relaxed",dangerouslySetInnerHTML:{__html:xc.sanitize(a.content_html)}}):i.jsx("p",{children:"Policy content is currently being updated."})})]})})}function fA(){const{navigateTo:s}=Rt(),[a,r]=N.useState(null),[o,u]=N.useState(!0);return N.useEffect(()=>{document.title="Terms & Conditions | PureStitch",window.scrollTo(0,0),hc("terms-and-conditions").then(h=>r(h)).catch(h=>console.warn("Failed to load policy:",h)).finally(()=>u(!1))},[]),i.jsx("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-5 md:px-10",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs text-[#5A4E55]",children:[i.jsx("button",{onClick:()=>s("home"),className:"hover:text-[#7B4B8E] transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-[#3AA89C] font-medium",children:"Terms & Conditions"})]}),i.jsxs("div",{className:"border-b border-[#E8DDD0] pb-8 mb-10",children:[i.jsx("span",{className:"text-xs tracking-[0.25em] uppercase text-[#3AA89C] font-semibold block mb-2",children:"Legal Agreement"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229] mb-3",children:a?.title?.replace(" | PureStitch","")||"Terms & Conditions"}),a?.updated_at&&i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Last Updated: ",i.jsx("span",{className:"font-semibold text-[#2A2229]",children:new Date(a.updated_at).toLocaleDateString("en-IN",{day:"numeric",month:"long",year:"numeric"})})]})]}),i.jsx("div",{className:"bg-white/90 rounded-3xl p-6 md:p-10 border border-[#E8DDD0] shadow-sm space-y-6 text-sm leading-relaxed text-[#5A4E55]",children:o?i.jsxs("div",{className:"space-y-4 py-8 animate-pulse",children:[i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-3/4"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-5/6"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-2/3"})]}):a?.content_html?i.jsx("div",{className:"prose max-w-none text-sm text-[#5A4E55] space-y-4 [&>h2]:font-serif [&>h2]:text-2xl [&>h2]:text-[#2A2229] [&>h3]:font-serif [&>h3]:text-xl [&>h3]:text-[#2A2229] [&>ul]:list-disc [&>ul]:pl-5 [&>ul]:space-y-1.5 [&>p]:leading-relaxed",dangerouslySetInnerHTML:{__html:xc.sanitize(a.content_html)}}):i.jsx("p",{children:"Policy content is currently being updated."})})]})})}function hA(){const{navigateTo:s}=Rt(),[a,r]=N.useState(null),[o,u]=N.useState(!0);return N.useEffect(()=>{document.title="Shipping Policy | PureStitch",window.scrollTo(0,0),hc("shipping-policy").then(h=>r(h)).catch(h=>console.warn("Failed to load policy:",h)).finally(()=>u(!1))},[]),i.jsx("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-5 md:px-10",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs text-[#5A4E55]",children:[i.jsx("button",{onClick:()=>s("home"),className:"hover:text-[#7B4B8E] transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-[#3AA89C] font-medium",children:"Shipping Policy"})]}),i.jsxs("div",{className:"border-b border-[#E8DDD0] pb-8 mb-10",children:[i.jsx("span",{className:"text-xs tracking-[0.25em] uppercase text-[#3AA89C] font-semibold block mb-2",children:"Delivery & Logistics"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229] mb-3",children:a?.title?.replace(" | PureStitch","")||"Shipping Policy"}),a?.updated_at&&i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Last Updated: ",i.jsx("span",{className:"font-semibold text-[#2A2229]",children:new Date(a.updated_at).toLocaleDateString("en-IN",{day:"numeric",month:"long",year:"numeric"})})]})]}),i.jsx("div",{className:"bg-white/90 rounded-3xl p-6 md:p-10 border border-[#E8DDD0] shadow-sm space-y-6 text-sm leading-relaxed text-[#5A4E55]",children:o?i.jsxs("div",{className:"space-y-4 py-8 animate-pulse",children:[i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-3/4"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-5/6"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-2/3"})]}):a?.content_html?i.jsx("div",{className:"prose max-w-none text-sm text-[#5A4E55] space-y-4 [&>h2]:font-serif [&>h2]:text-2xl [&>h2]:text-[#2A2229] [&>h3]:font-serif [&>h3]:text-xl [&>h3]:text-[#2A2229] [&>ul]:list-disc [&>ul]:pl-5 [&>ul]:space-y-1.5 [&>p]:leading-relaxed",dangerouslySetInnerHTML:{__html:xc.sanitize(a.content_html)}}):i.jsx("p",{children:"Policy content is currently being updated."})})]})})}function mA(){const{navigateTo:s}=Rt(),[a,r]=N.useState(null),[o,u]=N.useState(!0);return N.useEffect(()=>{document.title="Return & Exchange Policy | PureStitch",window.scrollTo(0,0),hc("return-exchange-policy").then(h=>r(h)).catch(h=>console.warn("Failed to load policy:",h)).finally(()=>u(!1))},[]),i.jsx("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-5 md:px-10",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs text-[#5A4E55]",children:[i.jsx("button",{onClick:()=>s("home"),className:"hover:text-[#7B4B8E] transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-[#3AA89C] font-medium",children:"Return & Exchange Policy"})]}),i.jsxs("div",{className:"border-b border-[#E8DDD0] pb-8 mb-10",children:[i.jsx("span",{className:"text-xs tracking-[0.25em] uppercase text-[#3AA89C] font-semibold block mb-2",children:"Customer Care & Guarantees"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229] mb-3",children:a?.title?.replace(" | PureStitch","")||"Return & Exchange Policy"}),a?.updated_at&&i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Last Updated: ",i.jsx("span",{className:"font-semibold text-[#2A2229]",children:new Date(a.updated_at).toLocaleDateString("en-IN",{day:"numeric",month:"long",year:"numeric"})})]})]}),i.jsx("div",{className:"bg-white/90 rounded-3xl p-6 md:p-10 border border-[#E8DDD0] shadow-sm space-y-6 text-sm leading-relaxed text-[#5A4E55]",children:o?i.jsxs("div",{className:"space-y-4 py-8 animate-pulse",children:[i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-3/4"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-5/6"}),i.jsx("div",{className:"h-4 bg-[#E8DDD0]/50 rounded w-2/3"})]}):a?.content_html?i.jsx("div",{className:"prose max-w-none text-sm text-[#5A4E55] space-y-4 [&>h2]:font-serif [&>h2]:text-2xl [&>h2]:text-[#2A2229] [&>h3]:font-serif [&>h3]:text-xl [&>h3]:text-[#2A2229] [&>ul]:list-disc [&>ul]:pl-5 [&>ul]:space-y-1.5 [&>p]:leading-relaxed",dangerouslySetInnerHTML:{__html:xc.sanitize(a.content_html)}}):i.jsx("p",{children:"Policy content is currently being updated."})})]})})}function xA(){const{navigateTo:s}=Rt();N.useEffect(()=>{document.title="Contact Us | PureStitch",window.scrollTo(0,0)},[]);const[a,r]=N.useState({name:"",email:"",phone:"",orderNumber:"",subject:"Order Support",message:""}),[o,u]=N.useState({}),[h,f]=N.useState(!1),[p,b]=N.useState(!1),m=()=>{const v={};if(a.name.trim()||(v.name="Please enter your name."),a.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email.trim())||(v.email="Please enter a valid email address."):v.email="Please enter your email address.",a.phone.trim()){const w=a.phone.trim().replace(/[\s\-\(\)\+]/g,"");/^\d{7,15}$/.test(w)||(v.phone="Please enter a valid phone number (7-15 digits).")}return a.subject||(v.subject="Please select a subject."),a.message.trim()||(v.message="Please enter your message."),u(v),Object.keys(v).length===0},y=async v=>{if(v.preventDefault(),!!m())try{b(!0),await RN({name:a.name.trim(),email:a.email.trim(),phone:a.phone.trim()||void 0,orderNumber:a.orderNumber.trim()||void 0,message:`[${a.subject}] ${a.message.trim()}`}),f(!0)}catch(w){u(D=>({...D,message:w.message||"Failed to submit inquiry. Please try again."}))}finally{b(!1)}};return i.jsx("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-5 md:px-10",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2 text-xs text-[#5A4E55]",children:[i.jsx("button",{onClick:()=>s("home"),className:"hover:text-[#7B4B8E] transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-[#3AA89C] font-medium",children:"Contact Us"})]}),i.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-16 space-y-4",children:[i.jsx("span",{className:"text-xs tracking-[0.25em] uppercase text-[#3AA89C] font-semibold",children:"Customer Support & Assistance"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229]",children:"Get in Touch"}),i.jsx("p",{className:"text-sm text-[#5A4E55] leading-relaxed",children:"Have a question about your order, product, shipping, returns, or anything else? We're here to help."})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-12 items-start",children:[i.jsx("div",{className:"lg:col-span-5 space-y-6",children:i.jsxs("div",{className:"bg-white/90 rounded-3xl p-8 border border-[#E8DDD0] shadow-sm space-y-8",children:[i.jsx("h2",{className:"font-serif text-2xl text-[#2A2229] border-b border-[#E8DDD0]/60 pb-4",children:"Customer Support"}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#7B4B8E]/10 text-[#7B4B8E] flex items-center justify-center flex-shrink-0",children:i.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",children:[i.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"3"}),i.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[#3AA89C] block mb-1",children:"Email"}),i.jsx("a",{href:"mailto:[email protected]",className:"text-sm font-medium text-[#2A2229] hover:text-[#7B4B8E] transition-colors",children:"[[email protected]]"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#3AA89C]/10 text-[#3AA89C] flex items-center justify-center flex-shrink-0",children:i.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",children:i.jsx("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[#3AA89C] block mb-1",children:"Phone"}),i.jsx("a",{href:"tel:+91XXXXXXXXXX",className:"text-sm font-medium text-[#2A2229] hover:text-[#7B4B8E] transition-colors",children:"[+91 XXXXX XXXXX]"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#7B4B8E]/10 text-[#7B4B8E] flex items-center justify-center flex-shrink-0",children:i.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[#3AA89C] block mb-1",children:"Business Hours"}),i.jsx("p",{className:"text-sm text-[#2A2229]",children:"[Monday – Saturday, 10:00 AM – 6:00 PM]"})]})]}),i.jsxs("div",{className:"flex items-start gap-4 pt-2 border-t border-[#E8DDD0]/60",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#2A2229]/10 text-[#2A2229] flex items-center justify-center flex-shrink-0",children:i.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",children:[i.jsx("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),i.jsx("circle",{cx:"12",cy:"10",r:"3"})]})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[#3AA89C] block mb-1",children:"Address"}),i.jsx("p",{className:"text-sm font-bold text-[#2A2229]",children:"PureStitch"}),i.jsxs("p",{className:"text-xs text-[#5A4E55] leading-relaxed",children:["[Complete Business Address]",i.jsx("br",{}),"[City, State]",i.jsx("br",{}),"[PIN Code]",i.jsx("br",{}),"India"]})]})]})]})}),i.jsx("div",{className:"lg:col-span-7",children:i.jsx("div",{className:"bg-white/90 rounded-3xl p-8 md:p-10 border border-[#E8DDD0] shadow-sm",children:h?i.jsxs("div",{className:"text-center py-12 space-y-6",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-[#3AA89C]/20 text-[#3AA89C] flex items-center justify-center mx-auto text-2xl font-bold",children:"✓"}),i.jsx("h3",{className:"font-serif text-3xl text-[#2A2229]",children:"Message Sent!"}),i.jsx("p",{className:"text-sm text-[#5A4E55] max-w-md mx-auto leading-relaxed",children:"Thank you for reaching out to PureStitch. We have received your inquiry and our support team will respond to you within 24 business hours."}),i.jsx("button",{onClick:()=>{f(!1),r({name:"",email:"",phone:"",orderNumber:"",subject:"Order Support",message:""})},className:"px-8 py-3.5 bg-[#7B4B8E] text-white rounded-2xl text-xs font-semibold uppercase tracking-widest hover:bg-[#5E366F] transition-all shadow-md",children:"Send Another Message"})]}):i.jsxs("form",{onSubmit:y,className:"space-y-6",noValidate:!0,children:[i.jsx("h2",{className:"font-serif text-2xl text-[#2A2229] mb-4",children:"Send Us a Message"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:["Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",placeholder:"Your full name",value:a.name,onChange:v=>r({...a,name:v.target.value}),className:`w-full px-4 py-3 bg-[#FBF8F5] border ${o.name?"border-red-400":"border-[#E8DDD0]"} rounded-2xl text-xs focus:outline-none focus:border-[#7B4B8E] transition-colors`}),o.name&&i.jsx("p",{className:"text-[11px] text-red-500",children:o.name})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:["Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",placeholder:"[email protected]",value:a.email,onChange:v=>r({...a,email:v.target.value}),className:`w-full px-4 py-3 bg-[#FBF8F5] border ${o.email?"border-red-400":"border-[#E8DDD0]"} rounded-2xl text-xs focus:outline-none focus:border-[#7B4B8E] transition-colors`}),o.email&&i.jsx("p",{className:"text-[11px] text-red-500",children:o.email})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:"Phone Number"}),i.jsx("input",{type:"tel",placeholder:"+91 XXXXX XXXXX",value:a.phone,onChange:v=>r({...a,phone:v.target.value}),className:`w-full px-4 py-3 bg-[#FBF8F5] border ${o.phone?"border-red-400":"border-[#E8DDD0]"} rounded-2xl text-xs focus:outline-none focus:border-[#7B4B8E] transition-colors`}),o.phone&&i.jsx("p",{className:"text-[11px] text-red-500",children:o.phone})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:["Order Number ",i.jsx("span",{className:"text-[#5A4E55] font-normal lowercase",children:"(optional)"})]}),i.jsx("input",{type:"text",placeholder:"e.g. PS-84920",value:a.orderNumber,onChange:v=>r({...a,orderNumber:v.target.value}),className:"w-full px-4 py-3 bg-[#FBF8F5] border border-[#E8DDD0] rounded-2xl text-xs focus:outline-none focus:border-[#7B4B8E] transition-colors"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:["Subject ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsxs("select",{value:a.subject,onChange:v=>r({...a,subject:v.target.value}),className:`w-full px-4 py-3 bg-[#FBF8F5] border ${o.subject?"border-red-400":"border-[#E8DDD0]"} rounded-2xl text-xs text-[#2A2229] focus:outline-none focus:border-[#7B4B8E] transition-colors`,children:[i.jsx("option",{value:"Order Support",children:"Order Support"}),i.jsx("option",{value:"Shipping",children:"Shipping"}),i.jsx("option",{value:"Return / Exchange",children:"Return / Exchange"}),i.jsx("option",{value:"Product Question",children:"Product Question"}),i.jsx("option",{value:"Payment",children:"Payment"}),i.jsx("option",{value:"Other",children:"Other"})]}),o.subject&&i.jsx("p",{className:"text-[11px] text-red-500",children:o.subject})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-semibold text-[#2A2229] uppercase tracking-wider block",children:["Message ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("textarea",{rows:5,placeholder:"Write your query or message here...",value:a.message,onChange:v=>r({...a,message:v.target.value}),className:`w-full px-4 py-3 bg-[#FBF8F5] border ${o.message?"border-red-400":"border-[#E8DDD0]"} rounded-2xl text-xs text-[#2A2229] focus:outline-none focus:border-[#7B4B8E] transition-colors resize-none`}),o.message&&i.jsx("p",{className:"text-[11px] text-red-500",children:o.message})]}),i.jsx("button",{type:"submit",disabled:p,className:"w-full py-4 bg-[#7B4B8E] text-white rounded-2xl text-xs font-semibold uppercase tracking-widest hover:bg-[#5E366F] transition-all shadow-lg shadow-[#7B4B8E]/25 disabled:opacity-50",children:p?"Sending...":"Send Message"})]})})})]})]})})}function pA(){const{lastOrder:s,navigateTo:a,clearCart:r}=Rt(),[o,u]=N.useState(!1),[h,f]=N.useState(null);N.useEffect(()=>{document.title="Order Confirmed | PureStitch",window.scrollTo(0,0);try{const k=new URLSearchParams(window.location.search),F=window.location.hash.includes("?")?new URLSearchParams(window.location.hash.split("?")[1]):null,T=k.get("order_id")||k.get("orderId")||k.get("id")||F?.get("order_id")||F?.get("orderId");T&&f(T)}catch{}r()},[r]);const p=s||(()=>{try{const k=localStorage.getItem("purestitch_last_order")||sessionStorage.getItem("purestitch_last_order");return k?JSON.parse(k):null}catch{return null}})(),b=h||p?.orderId||`#PS${Math.floor(1e5+Math.random()*9e5)}`,m=p?.items||[],y=p?.subtotal||0,v=p?.grandTotal||y,w=p?.customer||{fullName:"Valued Customer",email:"[email protected]",phone:"+91 98765 43210",address:"Bandra West",city:"Mumbai",state:"Maharashtra",pincode:"400050"},D=(p?.paymentMethod||"Shiprocket Fastrr 1-Click").toUpperCase(),I=(()=>{const k=new Date,F=new Date(k);return F.setDate(k.getDate()+4),F.toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"short",year:"numeric"})})();return i.jsxs("div",{className:"pt-28 pb-24 bg-[#FBF8F5] min-h-screen text-[#2A2229]",children:[i.jsxs("div",{className:"max-w-4xl mx-auto px-5 md:px-10",children:[i.jsxs(ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.16,1,.3,1]},className:"text-center space-y-4 mb-12",children:[i.jsx(ve.div,{initial:{scale:0,rotate:-45},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:300,damping:18,delay:.1},className:"w-20 h-20 rounded-full bg-[#3AA89C]/15 text-[#3AA89C] flex items-center justify-center mx-auto text-3xl font-bold border border-[#3AA89C]/30 shadow-lg shadow-[#3AA89C]/20",children:"✓"}),i.jsx("span",{className:"text-xs uppercase tracking-[0.25em] text-[#3AA89C] font-semibold block",children:"Order Confirmed"}),i.jsx("h1",{className:"font-serif text-4xl md:text-5xl text-[#2A2229]",children:"Thank you for your order!"}),i.jsxs("p",{className:"text-sm text-[#5A4E55] max-w-md mx-auto leading-relaxed",children:["Your order ",i.jsx("strong",{className:"text-[#7B4B8E] font-serif text-base",children:b})," has been received and is now being handcrafted in our atelier."]})]}),i.jsxs("div",{className:"bg-white/90 rounded-3xl p-6 md:p-10 border border-[#E8DDD0] shadow-sm space-y-8",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 bg-[#FBF8F5] p-5 rounded-2xl border border-[#E8DDD0]/80 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#5A4E55] block mb-1",children:"Order Number:"}),i.jsx("span",{className:"font-serif font-bold text-sm text-[#7B4B8E]",children:b})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#5A4E55] block mb-1",children:"Payment Method:"}),i.jsx("span",{className:"font-semibold text-[#2A2229]",children:D})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#5A4E55] block mb-1",children:"Estimated Delivery:"}),i.jsx("span",{className:"font-semibold text-[#3AA89C]",children:I})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-2",children:[i.jsxs("div",{className:"space-y-2 border-b md:border-b-0 md:border-r border-[#E8DDD0]/60 pb-6 md:pb-0 md:pr-6",children:[i.jsx("h3",{className:"font-serif text-lg text-[#2A2229]",children:"Shipping Address"}),i.jsx("p",{className:"text-xs font-bold text-[#2A2229]",children:w.fullName}),i.jsxs("p",{className:"text-xs text-[#5A4E55] leading-relaxed",children:[w.address,w.apartment?`, ${w.apartment}`:"",i.jsx("br",{}),w.city,", ",w.state," – ",w.pincode,i.jsx("br",{}),"India"]}),i.jsxs("p",{className:"text-xs text-[#5A4E55] pt-1",children:[i.jsx("strong",{children:"Phone:"})," ",w.phone,i.jsx("br",{}),i.jsx("strong",{children:"Email:"})," ",w.email]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-serif text-lg text-[#2A2229]",children:"Delivery Method"}),i.jsx("p",{className:"text-xs font-semibold text-[#3AA89C]",children:"Standard Express Delivery"}),i.jsxs("p",{className:"text-xs text-[#5A4E55] leading-relaxed",children:["Discreet luxury packaging with tamper-evident seal.",i.jsx("br",{}),"Estimated transit time: 3 – 5 Business Days."]}),i.jsx("div",{className:"pt-2 text-[11px] text-[#5A4E55] bg-[#FBF8F5] p-3 rounded-xl border border-[#E8DDD0]",children:i.jsx("span",{children:"Tracking information will be available once your order has been shipped."})})]})]}),i.jsxs("div",{className:"space-y-4 pt-4 border-t border-[#E8DDD0]/60",children:[i.jsx("h3",{className:"font-serif text-xl text-[#2A2229]",children:"Order Summary"}),m.length>0?i.jsx("div",{className:"divide-y divide-[#E8DDD0]/50 border-t border-b border-[#E8DDD0]/50",children:m.map((k,F)=>i.jsxs("div",{className:"py-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("img",{src:k.product.image,alt:k.product.name,className:"w-14 h-16 object-cover rounded-xl bg-[#F7F3EE] border border-[#E8DDD0]/50"}),i.jsxs("div",{className:"text-xs",children:[i.jsx("h4",{className:"font-serif text-sm text-[#2A2229] font-medium",children:k.product.name}),i.jsxs("p",{className:"text-[#5A4E55]",children:["Size: ",i.jsx("span",{className:"font-semibold text-[#7B4B8E]",children:k.size})," • Qty: ",k.quantity]})]})]}),i.jsxs("span",{className:"font-serif text-sm font-bold text-[#2A2229]",children:["₹",k.product.price*k.quantity]})]},F))}):i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"1x PureStitch Collection Piece"}),i.jsxs("div",{className:"space-y-2 text-xs text-[#5A4E55] pt-2 max-w-xs ml-auto",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Subtotal"}),i.jsxs("span",{className:"font-semibold text-[#2A2229]",children:["₹",y>0?y:v]})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Express Shipping"}),i.jsx("span",{className:"text-[#3AA89C] font-semibold",children:"Complimentary Free"})]}),i.jsxs("div",{className:"flex justify-between text-base text-[#2A2229] border-t border-[#E8DDD0]/60 pt-3",children:[i.jsx("span",{className:"font-semibold",children:"Total Paid"}),i.jsxs("span",{className:"font-serif text-2xl font-bold text-[#7B4B8E]",children:["₹",v]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pt-6 border-t border-[#E8DDD0]/60",children:[i.jsxs("button",{onClick:()=>u(!0),className:"py-4 bg-[#7B4B8E] text-white rounded-2xl text-xs font-semibold uppercase tracking-widest hover:bg-[#5E366F] transition-all shadow-lg flex items-center justify-center gap-2",children:[i.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Track Order Status"]}),i.jsx("button",{onClick:()=>a("shop"),className:"py-4 bg-white border-2 border-[#E8DDD0] text-[#2A2229] hover:border-[#7B4B8E] hover:text-[#7B4B8E] rounded-2xl text-xs font-semibold uppercase tracking-widest transition-all text-center",children:"Continue Shopping"})]})]})]}),i.jsx(Jt,{children:o&&i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[i.jsx(ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),className:"fixed inset-0 bg-black/60 backdrop-blur-md"}),i.jsxs(ve.div,{initial:{opacity:0,scale:.95,y:15},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:15},className:"relative bg-white rounded-3xl p-6 md:p-8 max-w-md w-full shadow-2xl z-10 border border-[#E8DDD0] space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#E8DDD0] pb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Live Order Tracking"}),i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Order Reference: ",i.jsx("strong",{className:"text-[#7B4B8E]",children:b})]})]}),i.jsx("button",{onClick:()=>u(!1),className:"w-8 h-8 rounded-full border border-[#E8DDD0] flex items-center justify-center text-[#5A4E55] hover:text-[#7B4B8E]",children:"✕"})]}),i.jsxs("div",{className:"space-y-6 text-xs relative pl-6 border-l-2 border-[#E8DDD0]",children:[i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute -left-[31px] top-0.5 w-4 h-4 rounded-full bg-[#3AA89C] text-white flex items-center justify-center text-[10px] font-bold",children:"✓"}),i.jsx("p",{className:"font-bold text-[#2A2229]",children:"Order Placed & Confirmed"}),i.jsx("p",{className:"text-[#5A4E55]",children:"Payment verified and order allocated to atelier."})]}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute -left-[31px] top-0.5 w-4 h-4 rounded-full bg-[#7B4B8E] text-white flex items-center justify-center text-[10px] font-bold",children:"●"}),i.jsx("p",{className:"font-bold text-[#7B4B8E]",children:"Quality Inspection & Packaging"}),i.jsx("p",{className:"text-[#5A4E55]",children:"Hand-finishing and discreet luxury packaging in progress."})]}),i.jsxs("div",{className:"relative opacity-60",children:[i.jsx("span",{className:"absolute -left-[31px] top-0.5 w-4 h-4 rounded-full bg-[#E8DDD0] text-[#5A4E55] flex items-center justify-center text-[10px]",children:"3"}),i.jsx("p",{className:"font-bold text-[#2A2229]",children:"Handed to Logistics Partner"}),i.jsx("p",{className:"text-[#5A4E55]",children:"Tracking link will be dispatched via SMS & Email."})]}),i.jsxs("div",{className:"relative opacity-60",children:[i.jsx("span",{className:"absolute -left-[31px] top-0.5 w-4 h-4 rounded-full bg-[#E8DDD0] text-[#5A4E55] flex items-center justify-center text-[10px]",children:"4"}),i.jsx("p",{className:"font-bold text-[#2A2229]",children:"Out for Delivery"}),i.jsxs("p",{className:"text-[#5A4E55]",children:["Estimated by ",I,"."]})]})]}),i.jsx("div",{className:"bg-[#FBF8F5] p-4 rounded-2xl border border-[#E8DDD0] text-[11px] text-[#5A4E55]",children:"Tracking information will be available once your order has been shipped."}),i.jsx("button",{onClick:()=>u(!1),className:"w-full py-3 bg-[#7B4B8E] text-white rounded-2xl text-xs font-semibold uppercase tracking-widest hover:bg-[#5E366F] transition-all",children:"Close Tracking"})]})]})})]})}function gA(){const{navigateTo:s,showToast:a,categories:r,refreshCategories:o}=Rt(),[u,h]=N.useState(()=>typeof window<"u"&&!!localStorage.getItem("purestitch_admin_token")),[f,p]=N.useState("dashboard"),[b,m]=N.useState(!1),[y,v]=N.useState(""),[w,D]=N.useState(""),[I,k]=N.useState(!1),[F,T]=N.useState(()=>{try{const g=typeof window<"u"?localStorage.getItem("purestitch_admin_user"):null;return g?JSON.parse(g):null}catch{return null}}),[U,q]=N.useState(null),[H,M]=N.useState([]),[Z,Q]=N.useState([]),[ee,ce]=N.useState([]),[ne,pe]=N.useState([]),[Se,Be]=N.useState({}),[Ue,Ge]=N.useState(!1),[z,ae]=N.useState(!1),[he,je]=N.useState(!1),[Ce,E]=N.useState(!1),[A,W]=N.useState(null),[V,J]=N.useState(!1),[le,oe]=N.useState([]),[Me,de]=N.useState(!1),[Ke,Oe]=N.useState(!1),[Ee,wt]=N.useState(null),[ci,Le]=N.useState(!1),[et,He]=N.useState({name:"",slug:"",description:"",imageUrl:"",sortOrder:0}),[ns,Vt]=N.useState(!1),[gi,as]=N.useState(!1),[_,xe]=N.useState(!1),[Xe,ht]=N.useState(!1),[ct,mt]=N.useState(!1),[ze,Et]=N.useState(null),[Bs,Ts]=N.useState(!1),[ks,Li]=N.useState(!1),[Te,bt]=N.useState({badgeText:"PureStitch Atelier Edit",title:"",subtitle:"",imageUrl:"",ctaLabel:"Explore Collection",ctaLink:"#/shop",sortOrder:1,isActive:!0}),[me,tt]=N.useState({id:"",name:"",categoryId:1,price:499,wholesalePrice:299,inventory:100,stock:25,padding:"Non-Padded",fabric:"Cottonblend",cup:"B-Cup",seam:"Seamed",pattern:"SelfDesign",coverage:"Full",straps:"Regular",material:"Cottonblend",detachable:"No",sizeRange:"28-40",primaryImage:"",galleryUrls:"",description:"",isFeatured:!1,isBestseller:!1,sizes:["28","30","32","34","36","38","40"],colors:[{name:"Classic Nude",hex:"#D4B49A",image_url:""},{name:"Midnight Black",hex:"#2A2229",image_url:""},{name:"Soft Ivory",hex:"#F5F0E8",image_url:""}]}),[da,Hn]=N.useState(!1),[hi,ls]=N.useState(null),[Nt,qt]=N.useState({name:"",hex:"#7B4B8E",image_url:""}),[Zt,Ci]=N.useState({name:"",hex:"#7B4B8E",image_url:""}),fa=g=>{tt(K=>{const ue=K.sizes.includes(g)?K.sizes.filter(Ie=>Ie!==g):[...K.sizes,g];return{...K,sizes:ue}})},zn=()=>{if(!Nt.name.trim())return a("Enter a swatch color name");tt(g=>({...g,colors:[...g.colors,{name:Nt.name.trim(),hex:Nt.hex,image_url:Nt.image_url.trim()||void 0}]})),qt({name:"",hex:"#7B4B8E",image_url:""})},_s=g=>{tt(K=>({...K,colors:K.colors.filter((te,ue)=>ue!==g)}))},Pi=()=>{if(!Zt.name.trim())return a("Enter a swatch color name");W(g=>{if(!g)return g;const K=Array.isArray(g.colors)?g.colors:[];return{...g,colors:[...K,{name:Zt.name.trim(),hex:Zt.hex,image_url:Zt.image_url.trim()||void 0}]}}),Ci({name:"",hex:"#7B4B8E",image_url:""})},$s=g=>{W(K=>{if(!K)return K;const te=Array.isArray(K.colors)?K.colors:[];return{...K,colors:te.filter((ue,Ie)=>Ie!==g)}})},si=(g,K,te)=>{g==="new"?tt(ue=>{const Ie=[...ue.colors];return Ie[K]&&(Ie[K]={...Ie[K],image_url:te}),{...ue,colors:Ie}}):W(ue=>{if(!ue)return ue;const Ie=[...ue.colors||[]];return Ie[K]&&(Ie[K]={...Ie[K],image_url:te}),{...ue,colors:Ie}})},Yi=async(g,K,te)=>{const ue=g.target.files?.[0];if(ue)try{ls({target:K,index:te}),a("Uploading swatch image to Cloudinary...");const Ie=await sa(ue);Ie&&(si(K,te,Ie),a("Swatch image uploaded to Cloudinary!"))}catch(Ie){a(Ie.message||"Failed to upload swatch image")}finally{ls(null)}},[Qt,Vi]=N.useState({code:"",discountType:"percentage",discountValue:0,minOrderAmount:0,usageLimit:100}),ys=g=>{localStorage.removeItem("purestitch_admin_token"),localStorage.removeItem("purestitch_admin_user"),h(!1),T(null),a(typeof g=="string"?g:"Logged out successfully")};N.useEffect(()=>{const g=()=>{ys("Session expired. Please log in again.")};return window.addEventListener("purestitch_admin_unauthorized",g),localStorage.getItem("purestitch_admin_token")&&(Mt(),FN().then(te=>{if(te?.admin){T(te.admin);try{localStorage.setItem("purestitch_admin_user",JSON.stringify(te.admin))}catch{}}}).catch(te=>{(te?.message?.includes("Unauthorized")||te?.status===401)&&ys("Session expired. Please log in again.")})),()=>{window.removeEventListener("purestitch_admin_unauthorized",g)}},[]);const Mt=async()=>{Ge(!0);try{const[g,K,te,ue,Ie,ui,yt]=await Promise.allSettled([UN(),LN({limit:50}),WN({limit:50}),XN(),i4(),_N(),VN()]);g.status==="fulfilled"&&q(g.value),K.status==="fulfilled"&&M(K.value?.data||[]),te.status==="fulfilled"&&Q(te.value||[]),ue.status==="fulfilled"&&ce(ue.value||[]),Ie.status==="fulfilled"&&Be(Ie.value||{}),ui.status==="fulfilled"&&pe(ui.value||[]),yt.status==="fulfilled"&&oe(yt.value||[])}catch(g){console.error(g)}finally{Ge(!1)}},en=async g=>{g.preventDefault(),k(!0);try{const K=await zN(y,w);h(!0),T(K.admin),a("Welcome back, Atelier Admin!"),Mt()}catch(K){a(K.message||"Invalid login")}finally{k(!1)}},Ii=async g=>{const K=g.target.files?.[0];if(K){Hn(!0),a("Uploading to Cloudinary CDN...");try{const te=await sa(K);tt(ue=>({...ue,primaryImage:te})),a("Image uploaded to Cloudinary successfully!")}catch(te){a(te.message||"Failed to upload image")}finally{Hn(!1)}}},St=async g=>{if(g.preventDefault(),!me.name.trim())return a("Product Name is required");const K=me.id.trim()?me.id.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"-"):me.name.toLowerCase().trim().replace(/[^a-z0-9_-]/g,"-"),te=me.galleryUrls?me.galleryUrls.split(/[\n,]+/).map(yt=>yt.trim()).filter(Boolean):[],ue=typeof me.inventory=="number"&&!isNaN(me.inventory)?Math.max(0,me.inventory):100,Ie={};me.colors.forEach(yt=>{yt.name&&yt.image_url&&yt.image_url.trim()&&(Ie[yt.name.trim()]=yt.image_url.trim())});const ui={...me,id:K,price:Number(me.price)||0,wholesalePrice:Number(me.wholesalePrice)||Math.round(Number(me.price)*.5),inventory:ue,totalInventory:ue,stock:ue,gallery:te,colorImages:Ie,colors:me.colors.map(yt=>({name:yt.name,hex:yt.hex,image_url:yt.image_url&&yt.image_url.trim()?yt.image_url.trim():void 0}))};try{await PN(ui),a(`Product "${me.name}" created & synced to Shiprocket!`),ae(!1),Mt()}catch(yt){a(yt.message||"Failed to create product")}},_t=g=>{let K=[];if(Array.isArray(g.colors)&&g.colors.length>0)K=g.colors.map(te=>({name:te.name||te.color_name||"",hex:te.hex||te.color_hex||"#D4B49A",image_url:te.image_url||te.imageUrl||g.colorImages&&g.colorImages[te.name||te.color_name]||""}));else if(typeof g.colors=="string")try{const te=JSON.parse(g.colors);Array.isArray(te)&&(K=te.map(ue=>({name:ue.name||ue.color_name||"",hex:ue.hex||ue.color_hex||"#D4B49A",image_url:ue.image_url||ue.imageUrl||""})))}catch{}g.colorImages&&typeof g.colorImages=="object"&&Object.entries(g.colorImages).forEach(([te,ue])=>{const Ie=K.find(ui=>ui.name.toLowerCase().trim()===te.toLowerCase().trim());Ie?Ie.image_url||(Ie.image_url=String(ue)):K.push({name:te,hex:"#D4B49A",image_url:String(ue)})}),Array.isArray(g.images)&&g.images.forEach(te=>{if(te.color_name&&te.image_url){const ue=K.find(Ie=>Ie.name.toLowerCase().trim()===te.color_name.toLowerCase().trim());ue?ue.image_url||(ue.image_url=te.image_url):K.push({name:te.color_name,hex:"#D4B49A",image_url:te.image_url})}}),W({id:g.id,name:g.name||"",categoryId:g.category_id||r&&r[0]?.id||1,price:Number(g.price)||0,wholesalePrice:Number(g.wholesale_price)||Math.round(Number(g.price)*.5),inventory:g.total_inventory??g.stock_quantity??100,padding:g.padding||"Non-Padded",cup:g.cup||"B-Cup",fabric:g.fabric||"Cottonblend",seam:g.seam||"Seamed",pattern:g.pattern||"SelfDesign",coverage:g.coverage||"Full",straps:g.straps||"Regular",material:g.material||"Cottonblend",detachable:g.detachable||"No",sizeRange:g.size_range||"28-40",primaryImage:g.primary_image||"",galleryUrls:g.images?g.images.map(te=>te.image_url).filter(te=>te!==g.primary_image).join(` `):"",description:g.description||"",isFeatured:!!g.is_featured,isBestseller:!!g.is_bestseller,isActive:g.is_active!==void 0?!!g.is_active:!0,colors:K}),E(!0)},bi=async g=>{if(g.preventDefault(),!A||!A.id)return;if(!A.name.trim())return a("Product Name is required");const K=typeof A.inventory=="number"&&!isNaN(A.inventory)?Math.max(0,A.inventory):void 0,te={};Array.isArray(A.colors)&&A.colors.forEach(ue=>{ue.name&&ue.image_url&&ue.image_url.trim()&&(te[ue.name.trim()]=ue.image_url.trim())});try{await JN(A.id,{name:A.name,categoryId:Number(A.categoryId),price:Number(A.price),wholesalePrice:Number(A.wholesalePrice||Math.round(A.price*.5)),inventory:K,totalInventory:K,stock:K,padding:A.padding,cup:A.cup,fabric:A.fabric,seam:A.seam,pattern:A.pattern,coverage:A.coverage,straps:A.straps,material:A.material,detachable:A.detachable,sizeRange:A.sizeRange,primaryImage:A.primaryImage,description:A.description,isFeatured:!!A.isFeatured,isBestseller:!!A.isBestseller,isActive:!!A.isActive,colors:(A.colors||[]).map(ue=>({name:ue.name,hex:ue.hex,image_url:ue.image_url&&ue.image_url.trim()?ue.image_url.trim():void 0})),colorImages:te,gallery:A.galleryUrls?A.galleryUrls.split(/[\n,]+/).map(ue=>ue.trim()).filter(Boolean):void 0}),a(`Product "${A.name}" updated successfully!`),E(!1),W(null),Mt()}catch(ue){a(ue.message||"Failed to update product")}},Fn=async(g,K)=>{if(window.confirm(`Are you sure you want to permanently delete "${K}" (${g})? This will remove all variants, images, and inventory records.`))try{await YN(g,!0),a(`Product "${K}" permanently deleted.`),Mt()}catch(te){a(te.message||"Failed to delete product")}},ol=async g=>{const K=g.target.files?.[0];if(K)try{J(!0);const te=await sa(K);te&&(W(ue=>({...ue,primaryImage:te})),a("Primary image uploaded to Cloudinary!"))}catch(te){a(te.message||"Image upload failed")}finally{J(!1)}},xt=async g=>{const K=g.target.files?.[0];if(K)try{Vt(!0),a("Uploading category image to Cloudinary...");const te=await sa(K);te&&(He(ue=>({...ue,imageUrl:te})),a("Category image uploaded to Cloudinary!"))}catch(te){a(te.message||"Image upload failed")}finally{Vt(!1)}},rs=async g=>{const K=g.target.files?.[0];if(K)try{as(!0),a("Uploading category image to Cloudinary...");const te=await sa(K);te&&(wt(ue=>({...ue,imageUrl:te})),a("Category image uploaded to Cloudinary!"))}catch(te){a(te.message||"Image upload failed")}finally{as(!1)}},Os=async g=>{if(g.preventDefault(),!et.name.trim())return a("Category name is required");const K=(et.slug||et.name).toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!K)return a("A valid category slug is required");try{xe(!0),await qN({name:et.name.trim(),slug:K,description:et.description.trim(),imageUrl:et.imageUrl?.trim()||"",sortOrder:Number(et.sortOrder)||0}),a(`Category "${et.name}" created successfully!`),He({name:"",slug:"",description:"",imageUrl:"",sortOrder:0}),de(!1),o&&await o(),await Mt()}catch(te){a(te.message||"Failed to create category")}finally{xe(!1)}},tn=g=>{wt({id:g.id,name:g.name||"",slug:g.slug||"",description:g.description||"",imageUrl:g.image_url||g.image||"",sortOrder:g.sort_order??0,isActive:g.is_active!==void 0?!!g.is_active:!0}),Oe(!0)},qi=async g=>{if(g.preventDefault(),!(!Ee||!Ee.id)){if(!Ee.name.trim())return a("Category name is required");try{Le(!0),await GN(Ee.id,{name:Ee.name.trim(),slug:Ee.slug?.trim(),description:Ee.description?.trim(),imageUrl:Ee.imageUrl?.trim()||"",sortOrder:Number(Ee.sortOrder)||0,isActive:Ee.isActive}),a(`Category "${Ee.name}" updated successfully!`),Oe(!1),wt(null),o&&await o(),await Mt()}catch(K){a(K.message||"Failed to update category")}finally{Le(!1)}}},os=async(g,K,te)=>{if(te>0)return a(`Cannot delete "${K}" because it has ${te} product(s) assigned.`);if(window.confirm(`Are you sure you want to delete category "${K}" (#${g})?`))try{await KN(g),a(`Category "${K}" deleted successfully!`),o&&await o(),await Mt()}catch(ue){a(ue.message||"Failed to delete category")}},vs=async g=>{if(g.preventDefault(),!Te.title.trim())return a("Banner title is required");if(!Te.imageUrl.trim())return a("Banner image is required. Please upload a file to Cloudinary.");try{await $N({...Te,imageUrl:Te.imageUrl.trim()}),a(`Hero banner "${Te.title}" created successfully!`),ht(!1),bt({badgeText:"PureStitch Atelier Edit",title:"",subtitle:"",imageUrl:"",ctaLabel:"Explore Collection",ctaLink:"#/shop",sortOrder:ne.length+1,isActive:!0}),Mt()}catch(K){a(K.message||"Failed to create hero banner")}},js=g=>{Et({id:g.id,badgeText:g.badge_text||"",title:g.title||"",subtitle:g.subtitle||"",imageUrl:g.image_url||"",ctaLabel:g.cta_label||"Explore Collection",ctaLink:g.cta_link||"#/shop",sortOrder:g.sort_order??1,isActive:g.is_active!==void 0?!!g.is_active:!0}),mt(!0)},At=async g=>{if(g.preventDefault(),!(!ze||!ze.id)){if(!ze.title.trim())return a("Banner title is required");try{await e4(ze.id,ze),a(`Hero banner "${ze.title}" updated successfully!`),mt(!1),Et(null),Mt()}catch(K){a(K.message||"Failed to update banner")}}},ha=async(g,K)=>{if(window.confirm(`Are you sure you want to delete hero banner "${K}" (#${g})?`))try{await t4(g),a(`Hero banner "${K}" deleted successfully`),Mt()}catch(te){a(te.message||"Failed to delete banner")}},ma=async g=>{const K=g.target.files?.[0];if(K)try{Ts(!0);const te=await sa(K);te.data?.url&&(bt(ue=>({...ue,imageUrl:te.data.url})),a("Banner image uploaded to Cloudinary!"))}catch(te){a(te.message||"Image upload failed")}finally{Ts(!1)}},$t=async g=>{const K=g.target.files?.[0];if(K)try{Li(!0);const te=await sa(K);te.data?.url&&(Et(ue=>({...ue,imageUrl:te.data.url})),a("Banner image uploaded to Cloudinary!"))}catch(te){a(te.message||"Image upload failed")}finally{Li(!1)}},cs=async g=>{if(g.preventDefault(),!Qt.code)return a("Coupon code required");try{await ZN(Qt),a(`Coupon ${Qt.code} created!`),je(!1),Mt()}catch(K){a(K.message||"Coupon creation failed")}},sn=async g=>{try{await QN(g),a("Coupon deleted"),Mt()}catch(K){a(K.message||"Failed to delete coupon")}},Gi=async g=>{g.preventDefault();try{await s4(Se),a("Site settings & announcements updated live!")}catch(K){a(K.message||"Failed to save settings")}},nn=[{key:"dashboard",label:"Overview & KPIs",icon:i.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1"}),i.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1"}),i.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1"})]})},{key:"products",label:"Catalog & Cloudinary",badge:H.length,icon:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})})},{key:"categories",label:"Categories",badge:le.length||r.length,icon:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})},{key:"banners",label:"Hero Banners",badge:ne.length,icon:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})},{key:"orders",label:"Orders & Fastrr",badge:Z.length,icon:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"})})},{key:"coupons",label:"Coupons & Offers",badge:ee.length,icon:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"})})},{key:"settings",label:"Live Storefront CMS",icon:i.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),i.jsx("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}];return u?i.jsxs("div",{className:"min-h-screen bg-[#F8F7F4] text-[#2A2229] flex flex-col font-sans antialiased",children:[i.jsxs("div",{className:"lg:hidden bg-[#161217] text-white px-5 py-3.5 flex items-center justify-between border-b border-[#2C232B] sticky top-0 z-30 shadow-md",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-[#8E51A3] to-[#552766] flex items-center justify-center font-serif font-bold text-white text-sm",children:"P"}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-serif text-sm font-bold tracking-wide",children:"PURESTITCH"}),i.jsx("p",{className:"text-[9px] uppercase tracking-wider text-[#E8DDD0]/60",children:"Atelier Back-Office"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>s("home"),className:"px-2.5 py-1 rounded-lg border border-white/20 text-[11px] text-[#E8DDD0]",children:"Store ↗"}),i.jsx("button",{type:"button",onClick:()=>m(!b),className:"w-9 h-9 rounded-lg bg-white/10 flex items-center justify-center text-white text-base hover:bg-white/20 transition-colors",children:b?"✕":"☰"})]})]}),i.jsxs(Jt,{children:[b&&i.jsxs("div",{className:"lg:hidden fixed inset-0 z-50 flex",children:[i.jsx(ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>m(!1)}),i.jsxs(ve.aside,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:300},className:"relative w-72 max-w-[82vw] h-full bg-[#161217] text-white flex flex-col justify-between p-5 z-10 shadow-2xl",onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-white/10",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-[#7B4B8E] flex items-center justify-center font-serif font-bold text-white text-sm",children:"P"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-sm font-bold",children:"PureStitch"}),i.jsx("p",{className:"text-[9px] text-[#E8DDD0]/60",children:"Back-Office Menu"})]})]}),i.jsx("button",{onClick:()=>m(!1),className:"w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-xs",children:"✕"})]}),i.jsx("nav",{className:"space-y-1",children:nn.map(g=>{const K=f===g.key;return i.jsxs("button",{onClick:()=>{p(g.key),m(!1)},className:`w-full flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs font-medium transition-all ${K?"bg-[#7B4B8E] text-white font-semibold shadow-md":"text-[#E8DDD0]/80 hover:bg-white/5"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{children:g.icon}),i.jsx("span",{children:g.label})]}),g.badge!==void 0&&i.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] bg-white/15",children:g.badge})]},g.key)})})]}),i.jsxs("div",{className:"pt-4 border-t border-white/10 space-y-2",children:[i.jsx("button",{type:"button",onClick:()=>{m(!1),s("home")},className:"w-full py-2.5 bg-white/10 hover:bg-white/20 text-white rounded-xl text-xs font-semibold",children:"Visit Storefront ↗"}),i.jsx("button",{type:"button",onClick:ys,className:"w-full py-2.5 bg-rose-950/40 hover:bg-rose-900/60 text-rose-300 rounded-xl text-xs font-semibold",children:"Sign Out"})]})]})]}),Xe&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-2xl w-full p-6 md:p-8 max-h-[92vh] overflow-y-auto space-y-5 border border-[#E8DDD0] shadow-2xl",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-xl md:text-2xl font-semibold text-[#2A2229]",children:"Create Hero Banner"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Add visual promotional slides to the storefront hero section."})]}),i.jsx("button",{type:"button",onClick:()=>ht(!1),className:"w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-500 flex items-center justify-center text-sm font-bold",children:"✕"})]}),i.jsxs("form",{onSubmit:vs,className:"space-y-4 text-xs text-[#2A2229]",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Banner Title *"}),i.jsx("input",{type:"text",placeholder:"e.g. PureStitch Sustainable Outerwear",value:Te.title,onChange:g=>bt({...Te,title:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Badge Text"}),i.jsx("input",{type:"text",placeholder:"e.g. PureStitch Atelier Edit",value:Te.badgeText,onChange:g=>bt({...Te,badgeText:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Subtitle / Tagline"}),i.jsx("input",{type:"text",placeholder:"e.g. Hand-finished natural fibers tailored for delicate everyday luxury.",value:Te.subtitle,onChange:g=>bt({...Te,subtitle:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("label",{className:"block font-semibold text-[#7B4B8E]",children:"Banner Background Image (Cloudinary CDN) *"})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"Paste image URL (Cloudinary / Unsplash) or upload below",value:Te.imageUrl,onChange:g=>bt({...Te,imageUrl:g.target.value}),className:"flex-1 px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs font-mono focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold cursor-pointer shrink-0 flex items-center justify-center",children:[Bs?"Uploading...":"Upload File",i.jsx("input",{type:"file",accept:"image/*",onChange:ma,className:"hidden",disabled:Bs})]})]}),Te.imageUrl&&i.jsxs("div",{className:"relative h-32 w-full rounded-xl overflow-hidden border border-[#E8DDD0]",children:[i.jsx("img",{src:Te.imageUrl,alt:"Preview",className:"w-full h-full object-cover"}),i.jsx("span",{className:"absolute bottom-2 left-2 px-2 py-0.5 rounded bg-black/60 text-white text-[10px]",children:"Live Preview"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Button Label"}),i.jsx("input",{type:"text",placeholder:"e.g. Explore Catalog",value:Te.ctaLabel,onChange:g=>bt({...Te,ctaLabel:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Button Link"}),i.jsx("input",{type:"text",placeholder:"e.g. #/shop",value:Te.ctaLink,onChange:g=>bt({...Te,ctaLink:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-mono text-[11px] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Sort Order"}),i.jsx("input",{type:"number",value:Te.sortOrder,onChange:g=>bt({...Te,sortOrder:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsx("div",{className:"flex items-center gap-2 pt-1",children:i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer font-medium",children:[i.jsx("input",{type:"checkbox",checked:Te.isActive,onChange:g=>bt({...Te,isActive:g.target.checked}),className:"w-4 h-4 accent-[#7B4B8E] rounded"}),i.jsx("span",{children:"Active on Storefront Homepage"})]})}),i.jsxs("div",{className:"flex justify-end gap-3 pt-3 border-t border-[#E8DDD0]",children:[i.jsx("button",{type:"button",onClick:()=>ht(!1),className:"px-5 py-2.5 border border-[#E8DDD0] hover:bg-gray-50 rounded-xl font-semibold text-xs",children:"Cancel"}),i.jsx("button",{type:"submit",className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl font-semibold uppercase tracking-wider shadow-lg text-xs",children:"Create Hero Banner"})]})]})]})}),ct&&ze&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-2xl w-full p-6 md:p-8 max-h-[92vh] overflow-y-auto space-y-5 border border-[#E8DDD0] shadow-2xl",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"font-serif text-xl md:text-2xl font-semibold text-[#2A2229]",children:["Edit Hero Banner #",ze.id]}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Update slide imagery, titles, call-to-action buttons, or visibility."})]}),i.jsx("button",{type:"button",onClick:()=>{mt(!1),Et(null)},className:"w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-500 flex items-center justify-center text-sm font-bold",children:"✕"})]}),i.jsxs("form",{onSubmit:At,className:"space-y-4 text-xs text-[#2A2229]",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Banner Title *"}),i.jsx("input",{type:"text",value:ze.title,onChange:g=>Et({...ze,title:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Badge Text"}),i.jsx("input",{type:"text",value:ze.badgeText,onChange:g=>Et({...ze,badgeText:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Subtitle / Tagline"}),i.jsx("input",{type:"text",value:ze.subtitle,onChange:g=>Et({...ze,subtitle:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("label",{className:"block font-semibold text-[#7B4B8E]",children:"Banner Background Image *"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"Paste image URL (Cloudinary / Unsplash) or upload below",value:ze.imageUrl,onChange:g=>Et({...ze,imageUrl:g.target.value}),className:"flex-1 px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs font-mono focus:outline-none focus:border-[#7B4B8E]",required:!0}),i.jsxs("label",{className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold cursor-pointer shrink-0 flex items-center justify-center",children:[ks?"Uploading...":"Upload File",i.jsx("input",{type:"file",accept:"image/*",onChange:$t,className:"hidden",disabled:ks})]})]}),ze.imageUrl&&i.jsxs("div",{className:"relative h-32 w-full rounded-xl overflow-hidden border border-[#E8DDD0]",children:[i.jsx("img",{src:ze.imageUrl,alt:"Preview",className:"w-full h-full object-cover"}),i.jsx("span",{className:"absolute bottom-2 left-2 px-2 py-0.5 rounded bg-black/60 text-white text-[10px]",children:"Live Preview"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Button Label"}),i.jsx("input",{type:"text",value:ze.ctaLabel,onChange:g=>Et({...ze,ctaLabel:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Button Link"}),i.jsx("input",{type:"text",value:ze.ctaLink,onChange:g=>Et({...ze,ctaLink:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-mono text-[11px] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Sort Order"}),i.jsx("input",{type:"number",value:ze.sortOrder,onChange:g=>Et({...ze,sortOrder:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsx("div",{className:"flex items-center gap-2 pt-1",children:i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer font-medium",children:[i.jsx("input",{type:"checkbox",checked:ze.isActive,onChange:g=>Et({...ze,isActive:g.target.checked}),className:"w-4 h-4 accent-[#7B4B8E] rounded"}),i.jsx("span",{children:"Active on Storefront Homepage"})]})}),i.jsxs("div",{className:"flex justify-end gap-3 pt-3 border-t border-[#E8DDD0]",children:[i.jsx("button",{type:"button",onClick:()=>{mt(!1),Et(null)},className:"px-5 py-2.5 border border-[#E8DDD0] hover:bg-gray-50 rounded-xl font-semibold text-xs",children:"Cancel"}),i.jsx("button",{type:"submit",className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl font-semibold uppercase tracking-wider shadow-lg text-xs",children:"Save Changes"})]})]})]})})]}),i.jsxs("aside",{className:"hidden lg:flex lg:w-72 lg:fixed lg:inset-y-0 lg:flex-col bg-[#151117] border-r border-[#2C232B] z-30 text-white select-none",children:[i.jsxs("div",{className:"p-6 border-b border-[#2C232B]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-[#8E51A3] to-[#552766] flex items-center justify-center font-serif text-xl font-bold text-white shadow-lg shadow-[#7B4B8E]/30 border border-white/20",children:"P"}),i.jsxs("div",{children:[i.jsx("h1",{className:"font-serif text-lg font-bold tracking-wider text-white",children:"PURESTITCH"}),i.jsx("p",{className:"text-[10px] uppercase tracking-widest text-[#E8DDD0]/60 font-medium",children:"Atelier Back-Office"})]})]}),i.jsxs("div",{className:"mt-4 px-3 py-2 rounded-xl bg-[#201922] border border-[#302633] flex items-center justify-between text-[11px]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),i.jsx("span",{className:"text-emerald-300 font-medium",children:"System Operational"})]}),i.jsx("span",{className:"text-[#E8DDD0]/50 text-[10px]",children:"Online"})]})]}),i.jsxs("div",{className:"flex-1 px-4 py-6 space-y-6 overflow-y-auto",children:[i.jsxs("div",{children:[i.jsx("span",{className:"px-3 text-[10px] font-bold uppercase tracking-widest text-[#E8DDD0]/40",children:"Operations"}),i.jsx("nav",{className:"mt-2 space-y-1",children:nn.slice(0,4).map(g=>{const K=f===g.key;return i.jsxs("button",{type:"button",onClick:()=>p(g.key),className:`w-full flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs font-medium transition-all ${K?"bg-[#7B4B8E] text-white shadow-lg shadow-[#7B4B8E]/30 font-semibold":"text-[#E8DDD0]/80 hover:bg-white/5 hover:text-white"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:K?"text-white":"text-[#E8DDD0]/60",children:g.icon}),i.jsx("span",{children:g.label})]}),g.badge!==void 0&&i.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-semibold ${K?"bg-white/20 text-white":"bg-white/10 text-[#E8DDD0]/70"}`,children:g.badge})]},g.key)})})]}),i.jsxs("div",{children:[i.jsx("span",{className:"px-3 text-[10px] font-bold uppercase tracking-widest text-[#E8DDD0]/40",children:"Configuration"}),i.jsx("nav",{className:"mt-2 space-y-1",children:nn.slice(4).map(g=>{const K=f===g.key;return i.jsx("button",{type:"button",onClick:()=>p(g.key),className:`w-full flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs font-medium transition-all ${K?"bg-[#7B4B8E] text-white shadow-lg shadow-[#7B4B8E]/30 font-semibold":"text-[#E8DDD0]/80 hover:bg-white/5 hover:text-white"}`,children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:K?"text-white":"text-[#E8DDD0]/60",children:g.icon}),i.jsx("span",{children:g.label})]})},g.key)})})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-gradient-to-br from-[#221A25] to-[#1C151F] border border-[#332836] space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[#E8DDD0]/60",children:[i.jsx("span",{children:"Gross Fulfilled"}),i.jsx("span",{className:"text-[#3AA89C] font-semibold",children:"Live Sync"})]}),i.jsxs("p",{className:"font-serif text-xl font-bold text-white",children:["₹",(U?.overview?.totalRevenue??0).toLocaleString()]}),i.jsxs("div",{className:"pt-2 border-t border-white/5 flex items-center justify-between text-[10px] text-[#E8DDD0]/50",children:[i.jsx("span",{children:"Fastrr Checkout"}),i.jsx("span",{className:"text-emerald-400 font-semibold",children:"Operational"})]})]})]}),i.jsxs("div",{className:"p-4 border-t border-[#2C232B] space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3 px-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-full bg-[#7B4B8E]/40 border border-[#7B4B8E] flex items-center justify-center text-xs font-semibold text-white",children:F?.name?F.name.charAt(0).toUpperCase():"A"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-xs font-semibold text-white truncate",children:F?.name||"Administrator"}),i.jsx("p",{className:"text-[10px] text-[#E8DDD0]/50 truncate",children:F?.email||"[email protected]"})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-1",children:[i.jsxs("button",{type:"button",onClick:()=>s("home"),className:"px-2.5 py-2 rounded-xl bg-white/5 hover:bg-white/10 text-white/80 hover:text-white text-[11px] font-medium flex items-center justify-center gap-1.5 transition-colors border border-white/5",children:[i.jsx("span",{children:"Storefront"}),i.jsx("span",{children:"↗"})]}),i.jsx("button",{type:"button",onClick:ys,className:"px-2.5 py-2 rounded-xl bg-rose-950/30 hover:bg-rose-900/50 text-rose-300 text-[11px] font-medium flex items-center justify-center gap-1 transition-colors border border-rose-900/40",children:i.jsx("span",{children:"Sign Out"})})]})]})]}),i.jsxs("div",{className:"flex-1 lg:pl-72 flex flex-col min-w-0 min-h-screen",children:[i.jsxs("header",{className:"sticky top-0 z-20 bg-white/90 backdrop-blur-md border-b border-[#E8DDD0] px-6 lg:px-10 py-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[#5A4E55] uppercase tracking-wider font-semibold",children:[i.jsx("span",{children:"Atelier Back-Office"}),i.jsx("span",{children:"/"}),i.jsxs("span",{className:"text-[#7B4B8E]",children:[f==="dashboard"&&"Overview & KPIs",f==="products"&&"Catalog & Cloudinary",f==="categories"&&"Collections & Categories",f==="orders"&&"Orders & Fastrr",f==="coupons"&&"Coupons & Discounts",f==="banners"&&"Hero Banners & Storefront Slides",f==="settings"&&"Live Storefront CMS"]})]}),i.jsxs("h2",{className:"font-serif text-xl sm:text-2xl font-semibold text-[#2A2229] mt-0.5",children:[f==="dashboard"&&"Overview & Performance Analytics",f==="products"&&"Product Catalog & Cloudinary CDN",f==="categories"&&"Store Categories & Hierarchy",f==="orders"&&"Orders & Shiprocket Fastrr",f==="coupons"&&"Coupons & Promotional Rules",f==="banners"&&"Hero Slideshow Banners & Media",f==="settings"&&"Live Site Announcement & Settings"]})]}),i.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[f==="products"&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>de(!0),className:"px-3.5 py-2 bg-white hover:bg-[#F7F3EE] text-[#2A2229] border border-[#E8DDD0] rounded-xl text-xs font-semibold uppercase tracking-wider shadow-xs transition-colors flex items-center gap-1.5 cursor-pointer",children:i.jsx("span",{children:"+ Category"})}),i.jsx("button",{type:"button",onClick:()=>ae(!0),className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 flex items-center gap-1.5 cursor-pointer",children:i.jsx("span",{children:"+ New Product"})})]}),f==="categories"&&i.jsx("button",{type:"button",onClick:()=>de(!0),className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 flex items-center gap-1.5 cursor-pointer",children:i.jsx("span",{children:"+ Add Category"})}),f==="banners"&&i.jsx("button",{type:"button",onClick:()=>ht(!0),className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 flex items-center gap-1.5 cursor-pointer",children:i.jsx("span",{children:"+ Add Hero Banner"})}),f==="coupons"&&i.jsx("button",{type:"button",onClick:()=>je(!0),className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 cursor-pointer",children:"+ Create Coupon"}),i.jsxs("button",{type:"button",onClick:Mt,disabled:Ue,className:"px-3.5 py-2 bg-white hover:bg-[#F7F3EE] text-[#5A4E55] border border-[#E8DDD0] rounded-xl text-xs font-medium transition-colors flex items-center gap-1.5 cursor-pointer disabled:opacity-50",title:"Refresh all data",children:[i.jsx("span",{className:Ue?"animate-spin":"",children:"↻"}),i.jsx("span",{children:Ue?"Refreshing...":"Refresh"})]}),i.jsxs("button",{type:"button",onClick:()=>s("home"),className:"hidden sm:inline-flex items-center gap-1 px-3.5 py-2 bg-white hover:bg-[#F7F3EE] text-[#2A2229] border border-[#E8DDD0] rounded-xl text-xs font-semibold transition-colors cursor-pointer",children:[i.jsx("span",{children:"Storefront"}),i.jsx("span",{className:"text-[10px]",children:"↗"})]})]})]}),i.jsxs("main",{className:"flex-1 p-4 sm:p-6 lg:p-8 max-w-7xl w-full mx-auto space-y-8",children:[f==="dashboard"&&i.jsxs("div",{className:"mt-8 space-y-8",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:[i.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-[#E8DDD0] shadow-sm",children:[i.jsx("span",{className:"text-[11px] uppercase font-semibold text-[#5A4E55]",children:"Total Sales Revenue"}),i.jsxs("p",{className:"font-serif text-3xl font-bold text-[#7B4B8E] mt-2",children:["₹",(U?.overview?.totalRevenue??0).toLocaleString()]}),i.jsx("span",{className:"text-[10px] text-[#5A4E55]",children:"Live fulfilled sales"})]}),i.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-[#E8DDD0] shadow-sm",children:[i.jsx("span",{className:"text-[11px] uppercase font-semibold text-[#5A4E55]",children:"Total Orders"}),i.jsx("p",{className:"font-serif text-3xl font-bold text-[#2A2229] mt-2",children:U?.overview?.totalOrders??Z.length??0}),i.jsx("span",{className:"text-[10px] text-[#5A4E55]",children:"Fastrr + Storefront Orders"})]}),i.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-[#E8DDD0] shadow-sm",children:[i.jsx("span",{className:"text-[11px] uppercase font-semibold text-[#5A4E55]",children:"Active Catalog Items"}),i.jsx("p",{className:"font-serif text-3xl font-bold text-[#2A2229] mt-2",children:U?.overview?.activeProducts??H.length??0}),i.jsx("span",{className:"text-[10px] text-[#3AA89C]",children:"All synced to Cloudinary CDN"})]}),i.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-[#E8DDD0] shadow-sm",children:[i.jsx("span",{className:"text-[11px] uppercase font-semibold text-[#5A4E55]",children:"Low Stock Warnings"}),i.jsx("p",{className:"font-serif text-3xl font-bold text-amber-600 mt-2",children:U?.overview?.lowStockVariants??0}),i.jsx("span",{className:"text-[10px] text-[#5A4E55]",children:(U?.overview?.lowStockVariants??0)===0?"Inventory healthy":"Items below safety stock"})]})]}),i.jsxs("div",{className:"bg-white rounded-3xl border border-[#E8DDD0] p-6 shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-[#E8DDD0]",children:[i.jsx("h3",{className:"font-serif text-xl text-[#2A2229]",children:"Recent Orders & Shiprocket Sync"}),i.jsx("button",{onClick:()=>p("orders"),className:"text-xs font-semibold text-[#7B4B8E] hover:underline",children:"View All Orders →"})]}),Z.length===0?i.jsx("p",{className:"text-xs text-[#5A4E55] py-8 text-center",children:"No orders recorded yet. Live orders from Shiprocket Fastrr will appear here."}):i.jsx("div",{className:"mt-4 divide-y divide-[#E8DDD0]/60",children:Z.slice(0,5).map(g=>i.jsxs("div",{className:"py-3 flex items-center justify-between text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-[#2A2229]",children:g.order_number}),i.jsxs("span",{className:"text-[#5A4E55] ml-2",children:[g.customer_name," (",g.shipping_city||"N/A",")"]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"font-bold text-[#7B4B8E]",children:["₹",g.total_amount]}),i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-[10px] uppercase font-semibold bg-[#3AA89C]/10 text-[#2E8B57]",children:g.order_status})]})]},g.id))})]})]}),f==="products"&&i.jsxs("div",{className:"mt-8 space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Catalog & Cloudinary CDN Assets"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Manage luxury products, variants, swatches, and direct Cloudinary image uploads."})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>de(!0),className:"px-4 py-2.5 bg-white hover:bg-[#F7F3EE] text-[#2A2229] border border-[#E8DDD0] rounded-xl text-xs font-semibold uppercase tracking-wider shadow-xs flex items-center gap-1.5 transition-colors",children:i.jsx("span",{children:"+ Add Category"})}),i.jsx("button",{onClick:()=>ae(!0),className:"px-5 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-lg flex items-center gap-2 transition-transform active:scale-95",children:i.jsx("span",{children:"+ Add New Product"})})]})]}),i.jsx("div",{className:"bg-white rounded-3xl border border-[#E8DDD0] shadow-sm overflow-hidden",children:H.length===0?i.jsxs("div",{className:"p-12 text-center text-xs text-[#5A4E55]",children:[i.jsx("p",{className:"font-serif text-lg text-[#2A2229] mb-1",children:"No Products Found"}),i.jsx("p",{children:'Click "+ Add New Product" above to create a product and upload assets to Cloudinary CDN.'})]}):i.jsxs("table",{className:"w-full text-left text-xs",children:[i.jsx("thead",{className:"bg-[#F7F3EE] border-b border-[#E8DDD0] text-[#5A4E55] uppercase text-[10px] tracking-wider",children:i.jsxs("tr",{children:[i.jsx("th",{className:"p-4",children:"Image"}),i.jsx("th",{className:"p-4",children:"Product Name & ID"}),i.jsx("th",{className:"p-4",children:"Category"}),i.jsx("th",{className:"p-4",children:"Price"}),i.jsx("th",{className:"p-4",children:"Variants"}),i.jsx("th",{className:"p-4",children:"Inventory"}),i.jsx("th",{className:"p-4",children:"Status"}),i.jsx("th",{className:"p-4 text-right",children:"Actions"})]})}),i.jsx("tbody",{className:"divide-y divide-[#E8DDD0]/60",children:H.map(g=>i.jsxs("tr",{className:"hover:bg-[#FBF8F5]/80 transition-colors",children:[i.jsx("td",{className:"p-4",children:i.jsx("img",{src:g.primary_image,alt:g.name,className:"w-12 h-14 object-cover rounded-xl bg-gray-100 border border-[#E8DDD0]"})}),i.jsxs("td",{className:"p-4",children:[i.jsx("span",{className:"font-semibold text-[#2A2229] block",children:g.name}),i.jsx("span",{className:"text-[10px] text-[#5A4E55] font-mono",children:g.id})]}),i.jsx("td",{className:"p-4 text-[#5A4E55]",children:g.category_title||g.category_name||"Lingerie"}),i.jsxs("td",{className:"p-4 font-bold text-[#7B4B8E]",children:["₹",g.price]}),i.jsxs("td",{className:"p-4 text-[#5A4E55]",children:[g.variants_count??g.variants?.length??0," SKUs"]}),i.jsxs("td",{className:"p-4 text-[#2E8B57] font-semibold",children:[g.total_inventory??g.stock_quantity??0," in stock"]}),i.jsxs("td",{className:"p-4",children:[i.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-semibold ${g.is_active?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:g.is_active?"Active":"Inactive"}),g.is_bestseller?i.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 text-[9px] font-bold",children:"★ Best"}):null]}),i.jsx("td",{className:"p-4 text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[i.jsx("button",{onClick:()=>_t(g),className:"px-2.5 py-1 bg-white hover:bg-[#7B4B8E] hover:text-white text-[#2A2229] border border-[#E8DDD0] rounded-lg text-[11px] font-semibold transition-all shadow-xs flex items-center gap-1",title:"Edit all product specifications, pricing, and media",children:i.jsx("span",{children:"✎ Edit"})}),i.jsx("button",{onClick:()=>Fn(g.id,g.name),className:"px-2.5 py-1 bg-white hover:bg-red-600 hover:text-white text-red-600 border border-red-200 rounded-lg text-[11px] font-semibold transition-all shadow-xs flex items-center gap-1",title:"Permanently Delete Product",children:i.jsx("span",{children:"🗑 Delete"})})]})})]},g.id))})]})})]}),f==="categories"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Collections & Categories"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Manage store apparel collections, URL slugs, display hierarchy, and catalog associations."})]}),i.jsx("button",{type:"button",onClick:()=>de(!0),className:"px-5 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 flex items-center gap-2 self-start sm:self-auto cursor-pointer",children:i.jsx("span",{children:"+ Add New Category"})})]}),le.length===0&&r.length===0?i.jsxs("div",{className:"bg-white p-12 rounded-3xl border border-[#E8DDD0] text-center text-xs text-[#5A4E55]",children:[i.jsx("p",{className:"font-serif text-lg text-[#2A2229] mb-1",children:"No Categories Found"}),i.jsx("p",{children:'Click "+ Add New Category" above to create product categories.'})]}):i.jsx("div",{className:"bg-white rounded-3xl border border-[#E8DDD0] shadow-sm overflow-hidden",children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-[#E8DDD0] bg-[#FBF8F5] text-[#5A4E55] uppercase tracking-wider text-[10px] font-semibold",children:[i.jsx("th",{className:"p-4",children:"Order"}),i.jsx("th",{className:"p-4",children:"Category Name"}),i.jsx("th",{className:"p-4",children:"Slug (Route)"}),i.jsx("th",{className:"p-4",children:"Description"}),i.jsx("th",{className:"p-4 text-center",children:"Products"}),i.jsx("th",{className:"p-4 text-center",children:"Status"}),i.jsx("th",{className:"p-4 text-right",children:"Actions"})]})}),i.jsx("tbody",{className:"divide-y divide-[#E8DDD0]",children:(le.length>0?le:r).map(g=>i.jsxs("tr",{className:"hover:bg-[#FBF8F5]/60 transition-colors",children:[i.jsxs("td",{className:"p-4 font-mono text-[11px] text-[#5A4E55]",children:["#",g.sort_order??0]}),i.jsx("td",{className:"p-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[g.image_url||g.image?i.jsx("img",{src:g.image_url||g.image,alt:g.name,className:"w-10 h-10 rounded-xl object-cover border border-[#E8DDD0] shrink-0"}):i.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#FBF8F5] border border-[#E8DDD0] flex items-center justify-center text-gray-400 shrink-0 text-xs",children:"📁"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-serif font-bold text-sm text-[#2A2229] block",children:g.name}),i.jsxs("span",{className:"block text-[10px] text-gray-400 font-mono",children:["ID: ",g.id]})]})]})}),i.jsx("td",{className:"p-4",children:i.jsxs("span",{className:"px-2.5 py-1 rounded-md bg-purple-50 font-mono text-[11px] text-[#7B4B8E] border border-purple-100",children:["/",g.slug]})}),i.jsx("td",{className:"p-4 max-w-xs truncate text-[#5A4E55]",children:g.description||"—"}),i.jsx("td",{className:"p-4 text-center",children:i.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-[10px] font-semibold bg-[#7B4B8E]/10 text-[#7B4B8E]",children:[g.product_count??0," items"]})}),i.jsx("td",{className:"p-4 text-center",children:i.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider ${g.is_active!==0?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-500"}`,children:g.is_active!==0?"Active":"Hidden"})}),i.jsx("td",{className:"p-4 text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:()=>tn(g),className:"px-3 py-1 bg-white hover:bg-[#7B4B8E] hover:text-white text-[#2A2229] border border-[#E8DDD0] rounded-lg text-xs font-semibold transition-colors flex items-center gap-1 shadow-xs cursor-pointer",children:"✎ Edit"}),i.jsx("button",{type:"button",onClick:()=>os(g.id,g.name,Number(g.product_count||0)),className:"px-3 py-1 bg-white hover:bg-rose-600 hover:text-white text-rose-600 border border-rose-200 rounded-lg text-xs font-semibold transition-colors flex items-center gap-1 shadow-xs cursor-pointer",children:"🗑 Delete"})]})})]},g.id))})]})})})]}),f==="banners"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Hero Slideshow Banners"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Manage homepage visual slides, promotion headlines, call-to-action buttons, and Cloudinary backdrops."})]}),i.jsx("button",{type:"button",onClick:()=>ht(!0),className:"px-5 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-md shadow-[#7B4B8E]/25 transition-transform active:scale-95 flex items-center gap-2 self-start sm:self-auto cursor-pointer",children:i.jsx("span",{children:"+ Add New Hero Banner"})})]}),ne.length===0?i.jsxs("div",{className:"bg-white p-12 rounded-3xl border border-[#E8DDD0] text-center text-xs text-[#5A4E55]",children:[i.jsx("p",{className:"font-serif text-lg text-[#2A2229] mb-1",children:"No Hero Banners Found"}),i.jsx("p",{children:'Click "+ Add New Hero Banner" above to create promotional slides for the homepage.'})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:ne.map(g=>i.jsxs("div",{className:"bg-white rounded-3xl border border-[#E8DDD0] shadow-sm overflow-hidden flex flex-col justify-between group hover:shadow-md transition-shadow",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"relative h-48 w-full bg-neutral-100 overflow-hidden",children:[i.jsx("img",{src:g.image_url,alt:g.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent"}),i.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-1.5",children:[i.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider ${g.is_active?"bg-emerald-500 text-white":"bg-neutral-600 text-white"}`,children:g.is_active?"Active":"Hidden"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold bg-white/85 backdrop-blur-sm text-[#2A2229]",children:["Order #",g.sort_order||0]})]}),g.badge_text&&i.jsx("div",{className:"absolute bottom-3 left-3 right-3",children:i.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[#E8DDD0] font-semibold bg-black/40 backdrop-blur-sm px-2 py-0.5 rounded",children:g.badge_text})})]}),i.jsxs("div",{className:"p-5 space-y-2",children:[i.jsx("h4",{className:"font-serif text-lg font-bold text-[#2A2229] line-clamp-1",children:g.title}),g.subtitle&&i.jsx("p",{className:"text-xs text-[#5A4E55] line-clamp-2",children:g.subtitle}),i.jsxs("div",{className:"pt-2 flex items-center gap-2 text-[11px] text-[#7B4B8E] font-medium",children:[i.jsx("span",{children:"CTA:"}),i.jsx("span",{className:"px-2 py-0.5 bg-[#7B4B8E]/10 rounded-md font-semibold",children:g.cta_label||"Explore"}),i.jsxs("span",{className:"text-[#5A4E55] font-mono text-[10px] truncate",children:["(",g.cta_link||"#/shop",")"]})]})]})]}),i.jsxs("div",{className:"p-4 bg-[#FBF8F5] border-t border-[#E8DDD0]/60 flex items-center justify-between",children:[i.jsxs("span",{className:"text-[10px] text-[#5A4E55]",children:["Banner #",g.id]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>js(g),className:"px-3 py-1 bg-white hover:bg-[#7B4B8E] hover:text-white text-[#2A2229] border border-[#E8DDD0] rounded-lg text-xs font-semibold transition-colors flex items-center gap-1 shadow-xs cursor-pointer",children:i.jsx("span",{children:"✎ Edit"})}),i.jsx("button",{type:"button",onClick:()=>ha(g.id,g.title),className:"px-3 py-1 bg-white hover:bg-rose-600 hover:text-white text-rose-600 border border-rose-200 rounded-lg text-xs font-semibold transition-colors flex items-center gap-1 shadow-xs cursor-pointer",children:i.jsx("span",{children:"🗑 Delete"})})]})]})]},g.id))})]}),f==="orders"&&i.jsxs("div",{className:"mt-8 space-y-6",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Orders & Shiprocket Fastrr Fulfillment"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Track live orders and fulfillment status synced directly from Shiprocket Fastrr."})]})}),i.jsx("div",{className:"bg-white rounded-3xl border border-[#E8DDD0] shadow-sm overflow-hidden",children:Z.length===0?i.jsxs("div",{className:"p-12 text-center text-xs text-[#5A4E55]",children:[i.jsx("p",{className:"font-serif text-lg text-[#2A2229] mb-1",children:"No Orders Found"}),i.jsx("p",{children:"Customer orders from Shiprocket Fastrr and storefront checkout will automatically sync here."})]}):i.jsxs("table",{className:"w-full text-left text-xs",children:[i.jsx("thead",{className:"bg-[#F7F3EE] border-b border-[#E8DDD0] text-[#5A4E55] uppercase text-[10px] tracking-wider",children:i.jsxs("tr",{children:[i.jsx("th",{className:"p-4",children:"Order #"}),i.jsx("th",{className:"p-4",children:"Customer"}),i.jsx("th",{className:"p-4",children:"Shipping Destination"}),i.jsx("th",{className:"p-4",children:"Total"}),i.jsx("th",{className:"p-4",children:"Payment"}),i.jsx("th",{className:"p-4",children:"Status"}),i.jsx("th",{className:"p-4",children:"Action"})]})}),i.jsx("tbody",{className:"divide-y divide-[#E8DDD0]/60",children:Z.map(g=>i.jsxs("tr",{className:"hover:bg-[#FBF8F5]/80 transition-colors",children:[i.jsx("td",{className:"p-4 font-bold text-[#2A2229] font-mono",children:g.order_number}),i.jsxs("td",{className:"p-4",children:[i.jsx("span",{className:"font-semibold block",children:g.customer_name}),i.jsx("span",{className:"text-[11px] text-[#5A4E55]",children:g.customer_phone})]}),i.jsxs("td",{className:"p-4 text-[#5A4E55]",children:[g.shipping_city,", ",g.shipping_state," (",g.shipping_pincode,")"]}),i.jsxs("td",{className:"p-4 font-bold text-[#7B4B8E]",children:["₹",g.total_amount]}),i.jsx("td",{className:"p-4",children:i.jsxs("span",{className:"px-2 py-0.5 rounded-full text-[10px] uppercase font-semibold bg-purple-100 text-purple-800",children:[g.payment_method," · ",g.payment_status]})}),i.jsx("td",{className:"p-4",children:i.jsx("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-[11px] font-semibold capitalize ${String(g.order_status).toLowerCase()==="delivered"?"bg-emerald-100 text-emerald-800 border border-emerald-200":String(g.order_status).toLowerCase()==="shipped"?"bg-blue-100 text-blue-800 border border-blue-200":String(g.order_status).toLowerCase()==="cancelled"?"bg-rose-100 text-rose-800 border border-rose-200":"bg-amber-100 text-amber-800 border border-amber-200"}`,children:g.order_status||"Processing"})}),i.jsx("td",{className:"p-4",children:i.jsx("span",{className:"text-[11px] text-[#3AA89C] font-semibold",children:"Synced with Fastrr"})})]},g.id))})]})})]}),f==="coupons"&&i.jsxs("div",{className:"mt-8 space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Coupons & Promotions"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Create discount codes for the PureStitch storefront and Shiprocket checkout."})]}),i.jsx("button",{onClick:()=>je(!0),className:"px-5 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-lg",children:"+ Create Coupon"})]}),ee.length===0?i.jsxs("div",{className:"bg-white p-12 rounded-3xl border border-[#E8DDD0] text-center text-xs text-[#5A4E55]",children:[i.jsx("p",{className:"font-serif text-lg text-[#2A2229] mb-1",children:"No Active Promo Coupons"}),i.jsx("p",{children:'Click "+ Create Coupon" above to create discount codes for your customers.'})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:ee.map(g=>i.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-[#E8DDD0] shadow-sm space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"px-3 py-1 rounded-lg bg-[#7B4B8E]/10 text-[#7B4B8E] font-mono font-bold text-sm",children:g.code}),i.jsx("button",{onClick:()=>sn(g.id),className:"text-red-500 text-xs hover:underline",children:"Delete"})]}),i.jsx("p",{className:"text-xl font-serif font-bold text-[#2A2229]",children:g.discount_type==="percentage"?`${g.discount_value}% OFF`:`₹${g.discount_value} OFF`}),i.jsxs("p",{className:"text-xs text-[#5A4E55]",children:["Min order: ₹",g.min_order_amount||0]}),i.jsxs("div",{className:"pt-2 border-t border-[#E8DDD0]/60 flex items-center justify-between text-[11px] text-[#5A4E55]",children:[i.jsxs("span",{children:["Used: ",g.used_count||0," times"]}),i.jsx("span",{className:"text-green-600 font-semibold",children:"Active"})]})]},g.id))})]}),f==="settings"&&i.jsxs("div",{className:"mt-8 max-w-2xl bg-white p-8 rounded-3xl border border-[#E8DDD0] shadow-sm space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-2xl text-[#2A2229]",children:"Live Storefront Content Settings"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Changes made here immediately update the website top marquee and checkout shipping rules."})]}),i.jsxs("form",{onSubmit:Gi,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-[#2A2229] mb-1",children:"Top Marquee Announcement Banner"}),i.jsx("input",{type:"text",value:Se.announcement_text||"",onChange:g=>Be({...Se,announcement_text:g.target.value}),className:"w-full px-4 py-3 bg-[#FBF8F5] border border-[#E8DDD0] rounded-xl text-xs text-[#2A2229] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-[#2A2229] mb-1",children:"Promo Badge Notice"}),i.jsx("input",{type:"text",value:Se.promo_badge_text||"",onChange:g=>Be({...Se,promo_badge_text:g.target.value}),className:"w-full px-4 py-3 bg-[#FBF8F5] border border-[#E8DDD0] rounded-xl text-xs text-[#2A2229] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-[#2A2229] mb-1",children:"Free Shipping Minimum Threshold (₹) — 0 for All Orders Free"}),i.jsx("input",{type:"number",value:Se.free_shipping_threshold??0,onChange:g=>Be({...Se,free_shipping_threshold:Number(g.target.value)}),className:"w-full px-4 py-3 bg-[#FBF8F5] border border-[#E8DDD0] rounded-xl text-xs text-[#2A2229] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsx("button",{type:"submit",className:"py-3 px-6 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-lg",children:"Save Live Settings"})]})]})]})]}),i.jsxs(Jt,{children:[z&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-3xl w-full p-6 md:p-8 max-h-[92vh] overflow-y-auto space-y-5 border border-[#E8DDD0] shadow-2xl",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-xl md:text-2xl font-semibold text-[#2A2229]",children:"Create Catalog Product"}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Configure garment attributes, pricing, Cloudinary media, variants, and Shiprocket sync."})]}),i.jsx("button",{onClick:()=>ae(!1),className:"w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-500 flex items-center justify-center text-sm font-bold",children:"✕"})]}),i.jsxs("form",{onSubmit:St,className:"space-y-5 text-xs text-[#2A2229]",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"1. Basic Information & Pricing"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Product Name *"}),i.jsx("input",{type:"text",placeholder:"e.g. AURA-SET or Velvet Lace Bralette",value:me.name,onChange:g=>{const K=g.target.value;tt(te=>({...te,name:K,id:te.id?te.id:K.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-")}))},className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("label",{className:"font-semibold",children:"Product ID / Slug"}),i.jsx("button",{type:"button",onClick:()=>{me.name&&tt(g=>({...g,id:g.name.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-")}))},className:"text-[10px] text-[#7B4B8E] hover:underline font-medium",children:"Auto from Name"})]}),i.jsx("input",{type:"text",placeholder:"e.g. aura-set",value:me.id,onChange:g=>tt({...me,id:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-mono text-[11px] focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Category *"}),i.jsx("select",{value:me.categoryId,onChange:g=>tt({...me,categoryId:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:(le.length>0?le:r).length>0?(le.length>0?le:r).map(g=>i.jsx("option",{value:g.id,children:g.name},g.id)):i.jsx("option",{value:1,children:"General Collection"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Selling Price (₹ MRP) *"}),i.jsx("input",{type:"number",value:me.price,onChange:g=>{const K=Number(g.target.value);tt(te=>({...te,price:K,wholesalePrice:te.wholesalePrice?te.wholesalePrice:Math.round(K*.5)}))},className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-semibold focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Wholesale Price (₹ WSP)"}),i.jsx("input",{type:"number",value:me.wholesalePrice,onChange:g=>tt({...me,wholesalePrice:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-[#3AA89C] font-semibold focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Total Inventory / Stock *"}),i.jsx("input",{type:"number",min:"0",placeholder:"e.g. 50, 100, 700",value:me.inventory,onChange:g=>tt({...me,inventory:g.target.value===""?0:Math.max(0,parseInt(g.target.value,10)||0)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-[#2E8B57] font-semibold focus:outline-none focus:border-[#7B4B8E]",required:!0}),i.jsx("span",{className:"text-[10px] text-[#5A4E55] mt-1 block leading-tight",children:"Distributed across all variants"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"2. Product Images (Cloudinary CDN)"})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-3 items-center",children:[i.jsxs("div",{className:"sm:col-span-8 space-y-2",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Primary Image URL"}),i.jsx("input",{type:"text",placeholder:"Paste Cloudinary or web image URL (or upload below)",value:me.primaryImage,onChange:g=>tt({...me,primaryImage:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-mono text-[11px] focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Or Upload File to Cloudinary CDN"}),i.jsx("input",{type:"file",accept:"image/*",onChange:Ii,className:"block w-full text-[11px] text-gray-500 file:mr-3 file:py-1.5 file:px-3 file:rounded-xl file:border-0 file:text-xs file:font-semibold file:bg-[#7B4B8E] file:text-white hover:file:bg-[#683C79] cursor-pointer"}),da&&i.jsx("p",{className:"text-amber-600 text-[11px] mt-1 animate-pulse",children:"☁️ Uploading asset to Cloudinary..."})]})]}),i.jsx("div",{className:"sm:col-span-4 flex items-center justify-center",children:i.jsx("div",{className:"w-24 h-28 rounded-2xl bg-white border border-[#E8DDD0] overflow-hidden flex items-center justify-center shadow-sm relative",children:me.primaryImage?i.jsx("img",{src:me.primaryImage,alt:"Preview",className:"w-full h-full object-cover"}):i.jsx("span",{className:"text-[10px] text-gray-400 text-center px-2",children:"Image Preview"})})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Additional Gallery Image URLs (comma or newline separated)"}),i.jsx("textarea",{rows:2,placeholder:"https://res.cloudinary.com/.../gallery1.jpg, https://...",value:me.galleryUrls,onChange:g=>tt({...me,galleryUrls:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-mono text-[11px] focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"3. Apparel Specifications & Fit"}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Padding"}),i.jsxs("select",{value:me.padding,onChange:g=>tt({...me,padding:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"Non-Padded",children:"Non-Padded"}),i.jsx("option",{value:"Padded",children:"Padded"}),i.jsx("option",{value:"Lightly Padded",children:"Lightly Padded"}),i.jsx("option",{value:"Push-Up",children:"Push-Up"}),i.jsx("option",{value:"Removable",children:"Removable"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Fabric"}),i.jsxs("select",{value:me.fabric,onChange:g=>tt({...me,fabric:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"Cottonblend",children:"Cottonblend"}),i.jsx("option",{value:"Lace",children:"Lace"}),i.jsx("option",{value:"Pure Silk",children:"Pure Silk"}),i.jsx("option",{value:"Modal",children:"Modal"}),i.jsx("option",{value:"Satin",children:"Satin"}),i.jsx("option",{value:"Lycra",children:"Lycra"}),i.jsx("option",{value:"Net",children:"Net"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Cup Size"}),i.jsxs("select",{value:me.cup,onChange:g=>tt({...me,cup:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"A-Cup",children:"A-Cup"}),i.jsx("option",{value:"B-Cup",children:"B-Cup"}),i.jsx("option",{value:"C-Cup",children:"C-Cup"}),i.jsx("option",{value:"D-Cup",children:"D-Cup"}),i.jsx("option",{value:"Full Coverage",children:"Full Coverage"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Seam Style"}),i.jsxs("select",{value:me.seam,onChange:g=>tt({...me,seam:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"Seamed",children:"Seamed"}),i.jsx("option",{value:"Seamless",children:"Seamless"}),i.jsx("option",{value:"Wirefree",children:"Wirefree"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Pattern"}),i.jsxs("select",{value:me.pattern,onChange:g=>tt({...me,pattern:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"SelfDesign",children:"SelfDesign"}),i.jsx("option",{value:"Solid",children:"Solid"}),i.jsx("option",{value:"Floral Lace",children:"Floral Lace"}),i.jsx("option",{value:"Printed",children:"Printed"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Coverage"}),i.jsxs("select",{value:me.coverage,onChange:g=>tt({...me,coverage:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"Full",children:"Full"}),i.jsx("option",{value:"3/4th Coverage",children:"3/4th Coverage"}),i.jsx("option",{value:"Demi",children:"Demi"}),i.jsx("option",{value:"Medium",children:"Medium"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Straps"}),i.jsxs("select",{value:me.straps,onChange:g=>tt({...me,straps:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"Regular",children:"Regular"}),i.jsx("option",{value:"Detachable",children:"Detachable"}),i.jsx("option",{value:"Multiway",children:"Multiway"}),i.jsx("option",{value:"Convertible",children:"Convertible"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Detachable Straps"}),i.jsxs("select",{value:me.detachable,onChange:g=>tt({...me,detachable:g.target.value}),className:"w-full px-2.5 py-2 bg-white border border-[#E8DDD0] rounded-xl",children:[i.jsx("option",{value:"No",children:"No"}),i.jsx("option",{value:"Yes",children:"Yes"})]})]})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"4. Available Band Sizes"}),i.jsxs("span",{className:"text-[11px] text-[#5A4E55]",children:["Selected: ",me.sizes.join(", ")||"None"]})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:["28","30","32","34","36","38","40","S","M","L","XL"].map(g=>{const K=me.sizes.includes(g);return i.jsx("button",{type:"button",onClick:()=>fa(g),className:`px-3 py-1.5 rounded-xl font-medium text-xs transition-all ${K?"bg-[#7B4B8E] text-white shadow-md shadow-[#7B4B8E]/30":"bg-white text-gray-600 border border-[#E8DDD0] hover:border-[#7B4B8E]"}`,children:g},g)})})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"5. Color Swatches & Color-Specific Images"}),i.jsx("p",{className:"text-[11px] text-gray-500",children:"Upload or paste photos for each color so the storefront dynamically shows the correct color when clicked."})]}),i.jsx("button",{type:"button",onClick:()=>tt(g=>({...g,colors:[{name:"Classic Nude",hex:"#D4B49A",image_url:""},{name:"Midnight Black",hex:"#2A2229",image_url:""},{name:"Soft Ivory",hex:"#F5F0E8",image_url:""},{name:"Dusty Rose",hex:"#C9967A",image_url:""}]})),className:"text-[10px] text-[#3AA89C] hover:underline font-medium",children:"+ Load PureStitch Palette"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 p-3 bg-white rounded-xl border border-[#E8DDD0]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"color",value:Nt.hex,onChange:g=>qt({...Nt,hex:g.target.value}),className:"w-8 h-8 p-0.5 rounded-lg border border-[#E8DDD0] cursor-pointer bg-white flex-shrink-0",title:"Pick color hex"}),i.jsx("input",{type:"text",placeholder:"Color name (e.g. Jet Black, Ruby Red)",value:Nt.name,onChange:g=>qt({...Nt,name:g.target.value}),className:"w-36 sm:w-44 px-3 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsx("input",{type:"text",placeholder:"Color image URL (optional)",value:Nt.image_url,onChange:g=>qt({...Nt,image_url:g.target.value}),className:"flex-1 px-3 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"}),i.jsx("button",{type:"button",onClick:zn,className:"px-4 py-1.5 bg-[#2A2229] hover:bg-[#7B4B8E] text-white rounded-lg text-xs font-semibold transition-colors flex-shrink-0",children:"+ Add Swatch"})]}),i.jsx("div",{className:"space-y-2 pt-1",children:me.colors.map((g,K)=>i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-2.5 bg-white border border-[#E8DDD0] rounded-xl shadow-xs text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-[140px]",children:[i.jsx("span",{className:"w-5 h-5 rounded-full border border-black/15 flex-shrink-0 shadow-inner",style:{backgroundColor:g.hex}}),i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-gray-800",children:g.name}),i.jsx("span",{className:"block text-[10px] text-gray-400 font-mono",children:g.hex})]})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.image_url?i.jsx("img",{src:g.image_url,alt:g.name,className:"w-8 h-8 rounded-lg object-cover border border-[#E8DDD0] flex-shrink-0 bg-gray-50"}):i.jsx("div",{className:"w-8 h-8 rounded-lg border border-dashed border-gray-300 flex items-center justify-center flex-shrink-0 bg-gray-50 text-[9px] text-gray-400",children:"No img"}),i.jsx("input",{type:"text",placeholder:"Image URL for this color",value:g.image_url||"",onChange:te=>si("new",K,te.target.value),className:"flex-1 px-2.5 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-2.5 py-1.5 bg-gray-100 hover:bg-[#7B4B8E] hover:text-white rounded-lg cursor-pointer text-[11px] font-medium transition-colors flex items-center gap-1 flex-shrink-0",children:[i.jsx("span",{children:hi?.target==="new"&&hi.index===K?"...":"Upload"}),i.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:hi!==null,onChange:te=>Yi(te,"new",K)})]})]}),i.jsx("button",{type:"button",onClick:()=>_s(K),className:"text-gray-400 hover:text-rose-500 font-bold p-1 rounded transition-colors self-end sm:self-auto",title:"Remove swatch",children:"✕"})]},K))})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"6. Merchandising & Story"}),i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer font-medium",children:[i.jsx("input",{type:"checkbox",checked:me.isBestseller,onChange:g=>tt({...me,isBestseller:g.target.checked}),className:"w-4 h-4 rounded text-[#7B4B8E] focus:ring-[#7B4B8E]"}),i.jsx("span",{children:"⭐ Flagship Bestseller Item"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer font-medium",children:[i.jsx("input",{type:"checkbox",checked:me.isFeatured,onChange:g=>tt({...me,isFeatured:g.target.checked}),className:"w-4 h-4 rounded text-[#7B4B8E] focus:ring-[#7B4B8E]"}),i.jsx("span",{children:"✨ Feature on Homepage"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Product Description & Atelier Craft"}),i.jsx("textarea",{rows:3,placeholder:"Describe the fit, silhouette, craftsmanship, and styling recommendations...",value:me.description,onChange:g=>tt({...me,description:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{className:"flex items-center justify-end gap-3 pt-3 border-t border-[#E8DDD0]",children:[i.jsx("button",{type:"button",onClick:()=>ae(!1),className:"px-5 py-2.5 border border-[#E8DDD0] hover:bg-gray-50 rounded-xl text-xs font-semibold",children:"Cancel"}),i.jsx("button",{type:"submit",className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold uppercase tracking-wider shadow-lg shadow-[#7B4B8E]/25 transition-all",children:"Save & Sync to Shiprocket"})]})]})]})}),Ce&&A&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-3xl w-full p-6 md:p-8 max-h-[92vh] overflow-y-auto space-y-5 border border-[#E8DDD0] shadow-2xl",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"font-serif text-xl md:text-2xl font-semibold text-[#2A2229]",children:["Edit Product: ",A.name]}),i.jsx("p",{className:"text-xs text-[#5A4E55]",children:"Modify catalog specifications, pricing, Cloudinary media, and merchandising flags."})]}),i.jsx("button",{onClick:()=>{E(!1),W(null)},className:"w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 text-gray-500 flex items-center justify-center text-sm font-bold",children:"✕"})]}),i.jsxs("form",{onSubmit:bi,className:"space-y-5 text-xs text-[#2A2229]",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"1. Basic Information & Pricing"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Product Name *"}),i.jsx("input",{type:"text",value:A.name,onChange:g=>W({...A,name:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Product ID (Read-only)"}),i.jsx("input",{type:"text",value:A.id,disabled:!0,className:"w-full px-3 py-2 bg-gray-100 border border-[#E8DDD0] rounded-xl font-mono text-[11px] text-gray-600 cursor-not-allowed"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Category *"}),i.jsx("select",{value:A.categoryId,onChange:g=>W({...A,categoryId:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:(le.length>0?le:r).length>0?(le.length>0?le:r).map(g=>i.jsx("option",{value:g.id,children:g.name},g.id)):i.jsx("option",{value:1,children:"General Collection"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Selling Price (₹ MRP) *"}),i.jsx("input",{type:"number",value:A.price,onChange:g=>W({...A,price:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl font-semibold focus:outline-none focus:border-[#7B4B8E]",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Wholesale Price (₹ WSP)"}),i.jsx("input",{type:"number",value:A.wholesalePrice,onChange:g=>W({...A,wholesalePrice:Number(g.target.value)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-[#3AA89C] font-semibold focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Total Inventory / Stock"}),i.jsx("input",{type:"number",min:"0",placeholder:"e.g. 50, 100, 700",value:A.inventory??"",onChange:g=>W({...A,inventory:g.target.value===""?0:Math.max(0,parseInt(g.target.value,10)||0)}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-[#2E8B57] font-semibold focus:outline-none focus:border-[#7B4B8E]"}),i.jsx("span",{className:"text-[10px] text-[#5A4E55] mt-1 block leading-tight",children:"Updates stock across all variants"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"2. Product Media (Cloudinary CDN)"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"block font-semibold",children:"Primary Image URL"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"https://res.cloudinary.com/...",value:A.primaryImage,onChange:g=>W({...A,primaryImage:g.target.value}),className:"flex-1 px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs font-mono focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold cursor-pointer shrink-0 flex items-center justify-center",children:[V?"Uploading...":"Upload File",i.jsx("input",{type:"file",accept:"image/*",onChange:ol,className:"hidden",disabled:V})]})]}),A.primaryImage&&i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsx("img",{src:A.primaryImage,alt:"Preview",className:"w-16 h-20 object-cover rounded-xl border border-[#E8DDD0] shadow-sm bg-white"}),i.jsx("span",{className:"text-[11px] text-[#5A4E55] break-all",children:"Previewing active primary asset"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"3. Garment Specifications"}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Padding"}),i.jsxs("select",{value:A.padding,onChange:g=>W({...A,padding:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"Non-Padded",children:"Non-Padded"}),i.jsx("option",{value:"Lightly Padded",children:"Lightly Padded"}),i.jsx("option",{value:"Padded",children:"Padded"}),i.jsx("option",{value:"Removable Padding",children:"Removable Padding"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Fabric"}),i.jsxs("select",{value:A.fabric,onChange:g=>W({...A,fabric:g.target.value,material:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"Cottonblend",children:"Cottonblend"}),i.jsx("option",{value:"Pure Cotton",children:"Pure Cotton"}),i.jsx("option",{value:"French Lace",children:"French Lace"}),i.jsx("option",{value:"Satin Silk",children:"Satin Silk"}),i.jsx("option",{value:"Microfiber",children:"Microfiber"}),i.jsx("option",{value:"Modal",children:"Modal"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Cup Size"}),i.jsxs("select",{value:A.cup,onChange:g=>W({...A,cup:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"B-Cup",children:"B-Cup (Standard)"}),i.jsx("option",{value:"A-Cup",children:"A-Cup"}),i.jsx("option",{value:"C-Cup",children:"C-Cup"}),i.jsx("option",{value:"D-Cup",children:"D-Cup"}),i.jsx("option",{value:"DD-Cup",children:"DD-Cup"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Seam Style"}),i.jsxs("select",{value:A.seam,onChange:g=>W({...A,seam:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"Seamed",children:"Seamed"}),i.jsx("option",{value:"Seamless",children:"Seamless"}),i.jsx("option",{value:"Cut & Sewn",children:"Cut & Sewn"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 pt-2",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Pattern"}),i.jsxs("select",{value:A.pattern,onChange:g=>W({...A,pattern:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"SelfDesign",children:"SelfDesign"}),i.jsx("option",{value:"Solid",children:"Solid"}),i.jsx("option",{value:"Floral Lace",children:"Floral Lace"}),i.jsx("option",{value:"Ribbed",children:"Ribbed"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Coverage"}),i.jsxs("select",{value:A.coverage,onChange:g=>W({...A,coverage:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"Full",children:"Full Coverage"}),i.jsx("option",{value:"Demi",children:"Demi Coverage"}),i.jsx("option",{value:"Medium",children:"Medium Coverage"}),i.jsx("option",{value:"Plunge",children:"Plunge"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Straps"}),i.jsxs("select",{value:A.straps,onChange:g=>W({...A,straps:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"Regular",children:"Regular"}),i.jsx("option",{value:"Multiway",children:"Multiway"}),i.jsx("option",{value:"Strapless",children:"Strapless"}),i.jsx("option",{value:"Racerback",children:"Racerback"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Detachable"}),i.jsxs("select",{value:A.detachable,onChange:g=>W({...A,detachable:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E]",children:[i.jsx("option",{value:"No",children:"No"}),i.jsx("option",{value:"Yes",children:"Yes"})]})]})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"4. Merchandising & Story"}),i.jsxs("div",{className:"flex flex-wrap gap-4 pt-1",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:A.isBestseller,onChange:g=>W({...A,isBestseller:g.target.checked}),className:"w-4 h-4 accent-[#7B4B8E] rounded"}),i.jsx("span",{className:"font-semibold text-xs",children:"Mark as Bestseller"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:A.isFeatured,onChange:g=>W({...A,isFeatured:g.target.checked}),className:"w-4 h-4 accent-[#7B4B8E] rounded"}),i.jsx("span",{className:"font-semibold text-xs",children:"Feature on Homepage"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:A.isActive,onChange:g=>W({...A,isActive:g.target.checked}),className:"w-4 h-4 accent-[#7B4B8E] rounded"}),i.jsx("span",{className:"font-semibold text-xs",children:"Active in Storefront Catalog"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Product Description"}),i.jsx("textarea",{rows:3,value:A.description,onChange:g=>W({...A,description:g.target.value}),className:"w-full px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs focus:outline-none focus:border-[#7B4B8E]"})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-serif text-sm font-semibold text-[#7B4B8E] uppercase tracking-wider",children:"5. Color Swatches & Color-Specific Images"}),i.jsx("p",{className:"text-[11px] text-gray-500",children:"Upload or paste distinct photos for each color shade."})]}),i.jsx("button",{type:"button",onClick:()=>W(g=>({...g,colors:[...g?.colors||[],{name:"Classic Nude",hex:"#D4B49A",image_url:""},{name:"Midnight Black",hex:"#2A2229",image_url:""},{name:"Soft Ivory",hex:"#F5F0E8",image_url:""}]})),className:"text-[10px] text-[#3AA89C] hover:underline font-medium",children:"+ Add Default Palette"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 p-3 bg-white rounded-xl border border-[#E8DDD0]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"color",value:Zt.hex,onChange:g=>Ci({...Zt,hex:g.target.value}),className:"w-8 h-8 p-0.5 rounded-lg border border-[#E8DDD0] cursor-pointer bg-white flex-shrink-0",title:"Pick color hex"}),i.jsx("input",{type:"text",placeholder:"Color name (e.g. Jet Black, Ruby Red)",value:Zt.name,onChange:g=>Ci({...Zt,name:g.target.value}),className:"w-36 sm:w-44 px-3 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"})]}),i.jsx("input",{type:"text",placeholder:"Color image URL (optional)",value:Zt.image_url,onChange:g=>Ci({...Zt,image_url:g.target.value}),className:"flex-1 px-3 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"}),i.jsx("button",{type:"button",onClick:Pi,className:"px-4 py-1.5 bg-[#2A2229] hover:bg-[#7B4B8E] text-white rounded-lg text-xs font-semibold transition-colors flex-shrink-0",children:"+ Add Swatch"})]}),i.jsxs("div",{className:"space-y-2 pt-1",children:[(A.colors||[]).map((g,K)=>i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-2.5 bg-white border border-[#E8DDD0] rounded-xl shadow-xs text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-[140px]",children:[i.jsx("span",{className:"w-5 h-5 rounded-full border border-black/15 flex-shrink-0 shadow-inner",style:{backgroundColor:g.hex}}),i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-gray-800",children:g.name}),i.jsx("span",{className:"block text-[10px] text-gray-400 font-mono",children:g.hex})]})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.image_url?i.jsx("img",{src:g.image_url,alt:g.name,className:"w-8 h-8 rounded-lg object-cover border border-[#E8DDD0] flex-shrink-0 bg-gray-50"}):i.jsx("div",{className:"w-8 h-8 rounded-lg border border-dashed border-gray-300 flex items-center justify-center flex-shrink-0 bg-gray-50 text-[9px] text-gray-400",children:"No img"}),i.jsx("input",{type:"text",placeholder:"Image URL for this color",value:g.image_url||"",onChange:te=>si("edit",K,te.target.value),className:"flex-1 px-2.5 py-1.5 bg-[#FAF7F2] border border-[#E8DDD0] rounded-lg text-xs focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-2.5 py-1.5 bg-gray-100 hover:bg-[#7B4B8E] hover:text-white rounded-lg cursor-pointer text-[11px] font-medium transition-colors flex items-center gap-1 flex-shrink-0",children:[i.jsx("span",{children:hi?.target==="edit"&&hi.index===K?"...":"Upload"}),i.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:hi!==null,onChange:te=>Yi(te,"edit",K)})]})]}),i.jsx("button",{type:"button",onClick:()=>$s(K),className:"text-gray-400 hover:text-rose-500 font-bold p-1 rounded transition-colors self-end sm:self-auto",title:"Remove swatch",children:"✕"})]},K)),(!A.colors||A.colors.length===0)&&i.jsx("p",{className:"text-xs text-gray-400 italic py-1",children:"No color swatches configured yet for this product."})]})]}),i.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[i.jsx("button",{type:"button",onClick:()=>{E(!1),W(null)},className:"px-5 py-2.5 border border-[#E8DDD0] hover:bg-gray-50 rounded-xl font-semibold text-xs",children:"Cancel"}),i.jsx("button",{type:"submit",className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl font-semibold uppercase tracking-wider shadow-lg text-xs",children:"Save Changes"})]})]})]})}),Me&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-lg w-full p-6 sm:p-7 space-y-4 border border-[#E8DDD0] shadow-2xl overflow-y-auto max-h-[90vh]",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-xl font-semibold text-[#2A2229]",children:"Create New Category"}),i.jsx("p",{className:"text-[11px] text-[#5A4E55]",children:"Add a luxury collection category to the live storefront."})]}),i.jsx("button",{onClick:()=>de(!1),className:"w-8 h-8 rounded-full border border-gray-200 flex items-center justify-center text-gray-400 hover:text-[#2A2229] transition-colors",children:"✕"})]}),i.jsxs("form",{onSubmit:Os,className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Category Name *"}),i.jsx("input",{type:"text",placeholder:"e.g. Silk Lounge or Bridal Atelier",value:et.name,onChange:g=>{const K=g.target.value;He(te=>{const ue=te.name.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Ie=!te.slug||te.slug===ue,ui=K.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return{...te,name:K,slug:Ie?ui:te.slug}})},className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs",required:!0})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:["Category Slug * ",i.jsx("span",{className:"font-normal text-gray-400 text-[10px]",children:"(URL path identifier)"})]}),i.jsx("input",{type:"text",placeholder:"e.g. silk-lounge",value:et.slug,onChange:g=>He(K=>({...K,slug:g.target.value})),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs font-mono bg-gray-50/50",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Description"}),i.jsx("textarea",{placeholder:"Brief description of the luxury craft or intention...",rows:2,value:et.description,onChange:g=>He(K=>({...K,description:g.target.value})),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs resize-none"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-2.5",children:[i.jsx("label",{className:"block font-semibold text-[#7B4B8E]",children:"Category Image (Cloudinary CDN)"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"Paste image URL or upload below",value:et.imageUrl,onChange:g=>He({...et,imageUrl:g.target.value}),className:"flex-1 px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs font-mono focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold cursor-pointer shrink-0 flex items-center justify-center",children:[ns?"Uploading...":"Upload File",i.jsx("input",{type:"file",accept:"image/*",onChange:xt,className:"hidden",disabled:ns})]})]}),et.imageUrl&&i.jsxs("div",{className:"relative h-28 w-full rounded-xl overflow-hidden border border-[#E8DDD0]",children:[i.jsx("img",{src:et.imageUrl,alt:"Category Preview",className:"w-full h-full object-cover"}),i.jsx("button",{type:"button",onClick:()=>He({...et,imageUrl:""}),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-black/60 text-white text-xs flex items-center justify-center hover:bg-black/80",children:"✕"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Display Sort Order"}),i.jsx("input",{type:"number",min:"0",placeholder:"0",value:et.sortOrder,onChange:g=>He(K=>({...K,sortOrder:Number(g.target.value)})),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs"})]}),i.jsxs("div",{className:"flex justify-end gap-3 pt-3 border-t border-[#E8DDD0]",children:[i.jsx("button",{type:"button",onClick:()=>de(!1),className:"px-4 py-2.5 border border-[#E8DDD0] rounded-xl text-gray-600 hover:bg-gray-50 transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:_,className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl font-semibold uppercase tracking-wider shadow-md disabled:opacity-50 transition-colors",children:_?"Creating...":"Create Category"})]})]})]})}),Ke&&Ee&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-lg w-full p-6 sm:p-7 space-y-4 border border-[#E8DDD0] shadow-2xl overflow-y-auto max-h-[90vh]",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif text-xl font-semibold text-[#2A2229]",children:"Edit Category"}),i.jsx("p",{className:"text-[11px] text-[#5A4E55]",children:"Modify collection name, slug, order, or visibility."})]}),i.jsx("button",{type:"button",onClick:()=>{Oe(!1),wt(null)},className:"w-8 h-8 rounded-full border border-gray-200 flex items-center justify-center text-gray-400 hover:text-[#2A2229] transition-colors",children:"✕"})]}),i.jsxs("form",{onSubmit:qi,className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Category Name *"}),i.jsx("input",{type:"text",value:Ee.name,onChange:g=>wt({...Ee,name:g.target.value}),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs",required:!0})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:["Category Slug * ",i.jsx("span",{className:"font-normal text-gray-400 text-[10px]",children:"(URL path identifier)"})]}),i.jsx("input",{type:"text",value:Ee.slug,onChange:g=>wt({...Ee,slug:g.target.value}),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs font-mono bg-gray-50/50",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Description"}),i.jsx("textarea",{rows:2,value:Ee.description,onChange:g=>wt({...Ee,description:g.target.value}),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs resize-none"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-[#FBF8F5] border border-[#E8DDD0] space-y-2.5",children:[i.jsx("label",{className:"block font-semibold text-[#7B4B8E]",children:"Category Image (Cloudinary CDN)"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",placeholder:"Paste image URL or upload below",value:Ee.imageUrl||"",onChange:g=>wt({...Ee,imageUrl:g.target.value}),className:"flex-1 px-3 py-2 bg-white border border-[#E8DDD0] rounded-xl text-xs font-mono focus:outline-none focus:border-[#7B4B8E]"}),i.jsxs("label",{className:"px-4 py-2 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl text-xs font-semibold cursor-pointer shrink-0 flex items-center justify-center",children:[gi?"Uploading...":"Upload File",i.jsx("input",{type:"file",accept:"image/*",onChange:rs,className:"hidden",disabled:gi})]})]}),Ee.imageUrl&&i.jsxs("div",{className:"relative h-28 w-full rounded-xl overflow-hidden border border-[#E8DDD0]",children:[i.jsx("img",{src:Ee.imageUrl,alt:"Category Preview",className:"w-full h-full object-cover"}),i.jsx("button",{type:"button",onClick:()=>wt({...Ee,imageUrl:""}),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-black/60 text-white text-xs flex items-center justify-center hover:bg-black/80",children:"✕"})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Display Sort Order"}),i.jsx("input",{type:"number",min:"0",value:Ee.sortOrder,onChange:g=>wt({...Ee,sortOrder:Number(g.target.value)}),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1 text-[#2A2229]",children:"Visibility"}),i.jsxs("select",{value:Ee.isActive?"active":"hidden",onChange:g=>wt({...Ee,isActive:g.target.value==="active"}),className:"w-full px-3.5 py-2.5 border border-[#E8DDD0] rounded-xl focus:outline-none focus:border-[#7B4B8E] text-xs bg-white",children:[i.jsx("option",{value:"active",children:"Active (Visible on Store)"}),i.jsx("option",{value:"hidden",children:"Hidden (Archive / Inactive)"})]})]})]}),i.jsxs("div",{className:"flex justify-end gap-3 pt-3 border-t border-[#E8DDD0]",children:[i.jsx("button",{type:"button",onClick:()=>{Oe(!1),wt(null)},className:"px-4 py-2.5 border border-[#E8DDD0] rounded-xl text-gray-600 hover:bg-gray-50 transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:ci,className:"px-6 py-2.5 bg-[#7B4B8E] hover:bg-[#683C79] text-white rounded-xl font-semibold uppercase tracking-wider shadow-md disabled:opacity-50 transition-colors",children:ci?"Saving...":"Save Changes"})]})]})]})})]}),i.jsx(Jt,{children:he&&i.jsx("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:i.jsxs(ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-3xl max-w-md w-full p-6 space-y-4 border border-[#E8DDD0] shadow-2xl",children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[#E8DDD0]",children:[i.jsx("h3",{className:"font-serif text-xl font-semibold",children:"Create Promo Coupon"}),i.jsx("button",{onClick:()=>je(!1),className:"text-gray-400",children:"✕"})]}),i.jsxs("form",{onSubmit:cs,className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Coupon Code (Uppercase)"}),i.jsx("input",{type:"text",placeholder:"e.g. FESTIVE25",value:Qt.code,onChange:g=>Vi({...Qt,code:g.target.value.toUpperCase()}),className:"w-full px-3 py-2 border border-[#E8DDD0] rounded-lg font-mono uppercase",required:!0})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Discount Type"}),i.jsxs("select",{value:Qt.discountType,onChange:g=>Vi({...Qt,discountType:g.target.value}),className:"w-full px-3 py-2 border border-[#E8DDD0] rounded-lg bg-white",children:[i.jsx("option",{value:"percentage",children:"Percentage (%)"}),i.jsx("option",{value:"flat",children:"Flat (₹)"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Discount Value"}),i.jsx("input",{type:"number",value:Qt.discountValue,onChange:g=>Vi({...Qt,discountValue:Number(g.target.value)}),className:"w-full px-3 py-2 border border-[#E8DDD0] rounded-lg",required:!0})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block font-semibold mb-1",children:"Minimum Order Amount (₹)"}),i.jsx("input",{type:"number",value:Qt.minOrderAmount,onChange:g=>Vi({...Qt,minOrderAmount:Number(g.target.value)}),className:"w-full px-3 py-2 border border-[#E8DDD0] rounded-lg"})]}),i.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[i.jsx("button",{type:"button",onClick:()=>je(!1),className:"px-4 py-2 border rounded-xl",children:"Cancel"}),i.jsx("button",{type:"submit",className:"px-5 py-2 bg-[#7B4B8E] text-white rounded-xl font-semibold uppercase",children:"Create Coupon"})]})]})]})})})]}):i.jsxs("div",{className:"min-h-screen bg-[#0F0B10] text-[#FBF8F5] flex items-center justify-center p-4 sm:p-6 relative overflow-hidden font-sans selection:bg-[#7B4B8E] selection:text-white",children:[i.jsx("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[550px] h-[550px] bg-gradient-to-tr from-[#7B4B8E]/25 to-transparent blur-3xl pointer-events-none rounded-full"}),i.jsx("div",{className:"absolute -bottom-24 -right-24 w-80 h-80 bg-gradient-to-tr from-[#3AA89C]/15 to-transparent blur-3xl pointer-events-none rounded-full"}),i.jsxs(ve.div,{initial:{opacity:0,y:24,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.4,ease:[.16,1,.3,1]},className:"w-full max-w-md bg-[#18131A]/95 border border-[#E8DDD0]/15 rounded-3xl p-8 sm:p-10 shadow-2xl backdrop-blur-xl relative z-10 space-y-7",children:[i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-[#8E51A3] to-[#552766] border border-white/20 shadow-xl shadow-[#7B4B8E]/30 text-white font-serif text-2xl font-bold",children:"P"}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[10px] uppercase tracking-[0.25em] text-[#3AA89C] font-semibold block",children:"PureStitch Atelier Portal"}),i.jsx("h1",{className:"font-serif text-2xl sm:text-3xl font-normal text-white mt-1",children:"Administrator Sign In"}),i.jsx("p",{className:"text-xs text-[#E8DDD0]/60 mt-1",children:"Catalog Management · Cloudinary CDN · Shiprocket Fastrr"})]})]}),i.jsxs("form",{onSubmit:en,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold uppercase tracking-wider text-[#E8DDD0]/80 mb-1.5",children:"Admin Email"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"email",value:y,onChange:g=>v(g.target.value),placeholder:"[email protected]",className:"w-full pl-4 pr-10 py-3 bg-[#110D13] border border-white/10 rounded-xl text-sm text-white placeholder-white/25 focus:outline-none focus:border-[#7B4B8E] focus:ring-1 focus:ring-[#7B4B8E] transition-all",required:!0}),i.jsx("span",{className:"absolute right-3.5 top-3.5 text-white/30",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold uppercase tracking-wider text-[#E8DDD0]/80 mb-1.5",children:"Password"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"password",value:w,onChange:g=>D(g.target.value),placeholder:"••••••••••••",className:"w-full pl-4 pr-10 py-3 bg-[#110D13] border border-white/10 rounded-xl text-sm text-white placeholder-white/25 focus:outline-none focus:border-[#7B4B8E] focus:ring-1 focus:ring-[#7B4B8E] transition-all font-mono",required:!0}),i.jsx("span",{className:"absolute right-3.5 top-3.5 text-white/30",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:i.jsx("path",{d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})})]})]}),i.jsx("button",{type:"submit",disabled:I,className:"w-full py-3.5 bg-gradient-to-r from-[#7B4B8E] to-[#683C79] hover:from-[#88549C] hover:to-[#734386] text-white rounded-xl font-semibold text-xs tracking-wider uppercase transition-all shadow-lg shadow-[#7B4B8E]/30 flex items-center justify-center gap-2 cursor-pointer active:scale-[0.99] disabled:opacity-50",children:I?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),i.jsx("span",{children:"Authenticating..."})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"Sign In to Back-Office"}),i.jsx("span",{children:"→"})]})})]}),i.jsxs("div",{className:"pt-4 border-t border-white/10 flex items-center justify-between text-xs text-[#E8DDD0]/50",children:[i.jsxs("button",{type:"button",onClick:()=>s("home"),className:"hover:text-white transition-colors flex items-center gap-1 text-[11px]",children:[i.jsx("span",{children:"←"}),i.jsx("span",{children:"Back to Storefront"})]}),i.jsxs("span",{className:"text-[10px] text-emerald-400/80 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400"}),i.jsx("span",{children:"System Online"})]})]})]})]})}function bA(){const{route:s,selectedProductId:a,toastMessage:r,cartOpen:o}=Rt(),u=N.useRef(null);return N.useEffect(()=>{const h=new ej({duration:1.2,easing:p=>Math.min(1,1.001-Math.pow(2,-10*p)),smoothWheel:!0});u.current=h;function f(p){h.raf(p),requestAnimationFrame(f)}return requestAnimationFrame(f),()=>{h.destroy(),u.current=null}},[]),N.useEffect(()=>{u.current&&(o?u.current.stop():u.current.start())},[o]),N.useEffect(()=>{window.scrollTo(0,0),u.current&&u.current.scrollTo(0,{immediate:!0})},[s,a]),s==="admin"?i.jsxs("div",{className:"min-h-screen bg-[#140F15] text-[#2A2229] font-sans antialiased selection:bg-[#7B4B8E] selection:text-white",children:[i.jsx(gA,{}),i.jsx(Jt,{children:r&&i.jsxs(ve.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:350,damping:25},className:"fixed bottom-6 right-6 z-[120] bg-[#2A2229] text-white px-6 py-4 rounded-2xl shadow-2xl flex items-center gap-3 border border-white/10",children:[i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#3AA89C] text-white flex items-center justify-center text-xs font-bold",children:"✓"}),i.jsx("p",{className:"text-xs font-medium tracking-wide",children:r})]})})]}):i.jsxs("div",{className:"relative min-h-screen bg-[#FBF8F5] text-[#2A2229] overflow-x-hidden flex flex-col justify-between",children:[i.jsx(l4,{}),i.jsx(r4,{}),i.jsx("main",{className:"flex-1 flex flex-col",children:i.jsx(Jt,{mode:"wait",children:i.jsxs(ve.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.35,ease:[.16,1,.3,1]},className:"flex-1 flex flex-col",children:[s==="home"&&i.jsx(j4,{}),s==="shop"&&i.jsx(S4,{}),s==="product"&&i.jsx(N4,{}),s==="categories"&&i.jsx(I4,{}),s==="cart"&&i.jsx(A4,{}),s==="checkout"&&i.jsx(D4,{}),s==="wishlist"&&i.jsx(C4,{}),s==="story"&&i.jsx(B4,{}),s==="privacy-policy"&&i.jsx(dA,{}),s==="terms-and-conditions"&&i.jsx(fA,{}),s==="shipping-policy"&&i.jsx(hA,{}),s==="return-exchange-policy"&&i.jsx(mA,{}),s==="contact"&&i.jsx(xA,{}),s==="thank-you"&&i.jsx(pA,{})]},s+(a||""))})}),i.jsx(Jt,{children:r&&i.jsxs(ve.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:350,damping:25},className:"fixed bottom-6 right-6 z-[70] bg-[#2A2229] text-white px-6 py-4 rounded-2xl shadow-2xl flex items-center gap-3 border border-white/10",children:[i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#3AA89C] text-white flex items-center justify-center text-xs font-bold",children:"✓"}),i.jsx("p",{className:"text-xs font-medium tracking-wide",children:r})]})}),i.jsx(d4,{}),i.jsx(u4,{})]})}function yA(){return i.jsx(a4,{children:i.jsx(bA,{})})}G2.createRoot(document.getElementById("root")).render(i.jsx(N.StrictMode,{children:i.jsx(yA,{})}));

RIYA – Non-Padded Non-Padded Sets

RIYA

Shop RIYA by PureStitch. Non-Padded, Non-Padded Sets, Full coverage, Cottonblend fabric, sizes 28-40. Explore the collection online.

Price: ₹399

Explore more products