PageSourceSearch

https://sendunlimitedemail.com/sue/mod-Awr9CEOD.js

js sendunlimitedemail.com collected 2026-10-05 06:25:04 UTC 12,740 bytes, 1 lines download raw bytes

1import{k as J,a1 as U,a2 as Y,r as t,j as e,B as k,o as Z,e as b,t as f}from"./edge-BOITG1XR.js";import{I as F}from"./mod-BUsEZZHX.js";import{L as v}from"./mod-kvo2LsX8.js";import{C as i,a as c,b as d,d as m,c as h}from"./mod-DgQ0OFXm.js";import{S as _,a as N,b as w,c as C,d as x}from"./mod-B0rofsOr.js";import{L as S}from"./mod-DxqX0N6D.js";import{S as G}from"./mod-C9xhOiHj.js";import{P as O}from"./mod-h5TzTLP8.js";import{S as $}from"./mod-CIn4OWcr.js";import{T as ee}from"./mod-DlSXWp2B.js";import{R as ae}from"./mod-RPxq32x0.js";import"./mod-CmjZ4fHE.js";const se=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],re=J("moon-star",se),oe=[{name:"Ocean Blue",primary:"#2563eb",secondary:"#1e40af"},{name:"Rose Pink",primary:"#ec4899",secondary:"#be185d"},{name:"Forest Green",primary:"#16a34a",secondary:"#15803d"},{name:"Sunset Orange",primary:"#f97316",secondary:"#ea580c"},{name:"Gold Luxury",primary:"#c9a84c",secondary:"#a07836"},{name:"Midnight Blue",primary:"#1e40af",secondary:"#1e3a8a"},{name:"Gaming Red",primary:"#dc2626",secondary:"#b91c1c"},{name:"Violet",primary:"#7c3aed",secondary:"#4c1d95"}],E=o=>({primary_color:o.primaryColor||"#7c3aed",secondary_color:o.secondaryColor||"#4c1d95",font_family:o.fontFamily||"Inter",border_radius:typeof o.borderRadius=="number"?`${(o.borderRadius/16).toFixed(3)}rem`:o.borderRadius||"0.75rem",shadow_intensity:o.shadowIntensity||"subtle"}),le=["Inter","Roboto","Open Sans","Lato","Outfit","Montserrat","Poppins"],te=[{label:"None (0px)",value:"0"},{label:"Small (4px)",value:"0.25rem"},{label:"Medium (8px)",value:"0.5rem"},{label:"Large (12px)",value:"0.75rem"},{label:"X-Large (16px)",value:"1rem"},{label:"Full (Rounded)",value:"9999px"}],ne=[{label:"None",value:"none"},{label:"Subtle",value:"subtle"},{label:"Medium",value:"medium"},{label:"Strong",value:"strong"}],ve=()=>{const{theme:o="system",setTheme:V}=U(),{theme:n,applyTheme:y,refreshTheme:H}=Y(),[a,j]=t.useState(()=>E(n)),[z,ie]=t.useState(!1),[g,R]=t.useState(!1),[T,I]=t.useState(!1),[K,p]=t.useState(!1),[P,Q]=t.useState(""),W=t.useMemo(()=>["light","dark","system"].includes(o)?o:"system",[o]);t.useEffect(()=>{j(E(n))},[n.primaryColor,n.secondaryColor,n.fontFamily,n.borderRadius,n.shadowIntensity]);const u=(s,l)=>{const r={...a,[s]:l};j(r),p(!1),y({primaryColor:r.primary_color,secondaryColor:r.secondary_color,fontFamily:r.font_family,borderRadius:r.border_radius,shadowIntensity:r.shadow_intensity})},X=s=>{const l={...a,primary_color:s.primary,secondary_color:s.secondary};j(l),p(!1),y({primaryColor:s.primary,secondaryColor:s.secondary,fontFamily:a.font_family,borderRadius:a.border_radius,shadowIntensity:a.shadow_intensity})},L=async()=>{R(!0);try{const s={primaryColor:a.primary_color,secondaryColor:a.secondary_color,fontFamily:a.font_family,borderRadius:a.border_radius,shadowIntensity:a.shadow_intensity},l={primary_color:a.primary_color,secondary_color:a.secondary_color,font_family:a.font_family,border_radius:a.border_radius};await b.put("/page-templates/global-styles",{global_styles:s}),b.put("/theme",l).catch(()=>{}),y(s),await H(),p(!1),f.success("Theme saved! Colors updated across the entire store.")}catch{try{await b.put("/theme",{primary_color:a.primary_color,secondary_color:a.secondary_color,font_family:a.font_family,border_radius:a.border_radius}),y({primaryColor:a.primary_color,secondaryColor:a.secondary_color,fontFamily:a.font_family}),f.success("Theme saved (colors updated).")}catch{f.error("Failed to save theme. Please check your connection.")}}finally{R(!1)}},A=async()=>{I(!0),p(!1);try{const s=P.trim()||"Modern professional e-commerce store",r=(await b.post("/ai/generate-theme",{prompt:s,current_theme:{primaryColor:a.primary_color,secondaryColor:a.secondary_color,fontFamily:a.font_family}})).data||{},M=r.primaryColor||r.primary_color||a.primary_color,D=r.secondaryColor||r.secondary_color||a.secondary_color,B=r.fontFamily||r.font_family||a.font_family,q={...a,primary_color:M,secondary_color:D,font_family:B};j(q),y({primaryColor:M,secondaryColor:D,fontFamily:B}),p(!0),f.success("AI theme applied! Click Save to keep it.")}catch{f.error("AI generate failed. Try again or enter a different prompt.")}finally{I(!1)}};return z?e.jsx("div",{className:"flex items-center justify-center h-96",children:e.jsx(S,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Theme Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Customize store colors, typography, and shape. Changes apply live to the entire storefront."})]}),e.jsx(k,{onClick:L,disabled:g,className:"gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4"})," Save Changes"]})})]}),e.jsxs(i,{children:[e.jsxs(c,{className:"pb-3",children:[e.jsxs(d,{className:"flex items-center gap-2 text-base",children:[e.jsx(O,{className:"w-4 h-4"})," Quick Color Palettes"]}),e.jsx(m,{children:"One-click preset themes — instantly previews on the entire site."})]}),e.jsx(h,{children:e.jsx("div",{className:"flex flex-wrap gap-2",children:oe.map(s=>e.jsxs("button",{onClick:()=>X(s),title:s.name,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-medium hover:scale-105 transition-transform",style:{borderColor:s.primary,color:s.primary},children:[e.jsx("span",{className:"w-3 h-3 rounded-full inline-block",style:{background:`linear-gradient(135deg, ${s.primary}, ${s.secondary})`}}),s.name,a.primary_color===s.primary&&e.jsx(Z,{className:"w-3 h-3"})]},s.name))})})]}
1),e.jsxs(i,{className:"border-violet-200 bg-violet-50/50",children:[e.jsxs(c,{className:"pb-3",children:[e.jsxs(d,{className:"flex items-center gap-2 text-base",children:[e.jsx($,{className:"w-4 h-4 text-violet-600"})," AI Theme Generator"]}),e.jsxs(m,{children:["Describe your store style and AI will generate a matching color palette.",K&&e.jsx("span",{className:"ml-2 text-green-600 font-medium",children:"✓ Applied! Click Save to keep."})]})]}),e.jsx(h,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{placeholder:"e.g. Luxury fashion brand, minimalist, black and gold...",value:P,onChange:s=>Q(s.target.value),onKeyDown:s=>s.key==="Enter"&&A(),className:"flex-1 bg-white"}),e.jsx(k,{onClick:A,disabled:T,variant:"outline",className:"gap-2 border-violet-400 text-violet-700 hover:bg-violet-100",children:T?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 animate-spin"})," Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4"})," Generate"]})})]})})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(d,{className:"flex items-center gap-2",children:[e.jsx(re,{className:"w-5 h-5"})," Display Mode"]}),e.jsx(m,{children:"Light / Dark / System preference."})]}),e.jsx(h,{children:e.jsxs(_,{value:W,onValueChange:V,children:[e.jsx(N,{children:e.jsx(w,{placeholder:"Select mode"})}),e.jsxs(C,{children:[e.jsx(x,{value:"light",children:"Light"}),e.jsx(x,{value:"dark",children:"Dark"}),e.jsx(x,{value:"system",children:"System"})]})]})})]}),e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(d,{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-5 h-5"})," Brand Colors"]}),e.jsx(m,{children:"Changes apply live as you pick."})]}),e.jsx(h,{className:"space-y-4",children:[{key:"primary_color",label:"Primary Color"},{key:"secondary_color",label:"Secondary Color"}].map(({key:s,label:l})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:s,children:l}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{id:s,type:"color",value:a[s],onChange:r=>u(s,r.target.value),className:"w-12 h-10 p-1 cursor-pointer border-2",style:{borderColor:a[s]}}),e.jsx(F,{type:"text",value:a[s],onChange:r=>u(s,r.target.value),className:"flex-1 font-mono",placeholder:"#7c3aed"})]})]},s))})]}),e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(d,{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"w-5 h-5"})," Typography & Shape"]}),e.jsx(m,{children:"Font family, border radius, and card shadows."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Font Family"}),e.jsxs(_,{value:a.font_family,onValueChange:s=>u("font_family",s),children:[e.jsx(N,{children:e.jsx(w,{})}),e.jsx(C,{children:le.map(s=>e.jsx(x,{value:s,style:{fontFamily:s},children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Border Radius"}),e.jsxs(_,{value:a.border_radius,onValueChange:s=>u("border_radius",s),children:[e.jsx(N,{children:e.jsx(w,{})}),e.jsx(C,{children:te.map(s=>e.jsx(x,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Card Shadow"}),e.jsxs(_,{value:a.shadow_intensity,onValueChange:s=>u("shadow_intensity",s),children:[e.jsx(N,{children:e.jsx(w,{})}),e.jsx(C,{children:ne.map(s=>e.jsx(x,{value:s.value,children:s.label},s.value))})]})]})]})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs(i,{className:"border-2 border-dashed sticky top-4",children:[e.jsxs(c,{children:[e.jsxs(d,{className:"text-base flex items-center gap-2",children:[e.jsx(ae,{className:"w-4 h-4"}),"Live Preview"]}),e.jsx(m,{children:"Reflects instantly — no save needed to see changes."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg shadow-sm",style:{background:a.primary_color}}),e.jsx("span",{className:"text-[10px] text-gray-500",children:"Primary"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg shadow-sm",style:{background:a.secondary_color}}),e.jsx("span",{className:"text-[10px] text-gray-500",children:"Secondary"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg shadow-sm",style:{background:`linear-gradient(135deg, ${a.primary_color}, ${a.secondary_color})`}}),e.jsx("span",{className:"text-[10px] text-gray-500",children:"Gradient"})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-card text-card-foreground shadow-sm space-y-3",style:{fontFamily:a.font_family,borderRadius:a.border_radius},children:[e.jsx("h3",{className:"text-base font-semibold",children:"Sample Heading"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview of typography, colors, and border radius."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{className:"px-3 py-1.5 text-xs font-semibold text-white shadow-sm transition-opacity hover:opacity-90",style:{background:a.primary_color,borderRadius:a.border_radius},children:"Primary Button"}),e.jsx("button",{className:"px-3 py-1.5 text-xs font-semibold bg-white shadow-sm transition-opacity hover:opacity-80",style:{border:`1.5px solid ${a.primary_color}`,color:a.primary_color,borderRadius:a.border_radius},children:"Outline Button"})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded text-white text-xs font-semibold",style:{background:a.primary_color},children:[e.jsx("span",{children:"🏪 Store Name"}),e.jsx("span",{children:"Cart (3)"})]}),e.jsxs("div",{className:"border p-2 rounded",style:{borderRadius:a.border_radius},children:[e.jsx("div",{className:"h-16 rounded mb-2",style:{background:`linear-gradient(135deg, ${a.primary_color}22, ${a.secondary_color}22)`}}),e.jsx("div",{className:"text-xs font-bold",style:{fontFamily:a.font_family},children:"Product Name"}),e.jsx("div",{className:"text-xs font-semibold mt-1",style:{color:a.primary_color},children:"AED 299"})]})]}),e.jsxs("p",{className:"text-[10px] text-gray-400 text-center",children:["Font: ",e.jsx("strong",{children:a.font_family})," · Radius: ",e.jsx("strong",{children:a.border_radius})," · Shadow: ",e.jsx("strong",{children:a.shadow_intensity})]})]})]})})]}),e.jsx("div",{className:"flex justify-end pb-8",children:e.jsx(k,{onClick:L,disabled:g,size:"lg",className:"gap-2 px-8",children:g?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4"})," Save & Apply to Store"]})})})]})};export{ve as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.