PageSourceSearch

https://tracycateringrefresh.lovable.app/assets/WeddingChairsAddon-CkckSErr.js

js tracycateringrefresh.lovable.app collected 2026-10-03 03:51:05 UTC 11,777 bytes, 1 lines download raw bytes

1import{j as e,r as T,aI as N,aq as v}from"./index-sffQ7FRS.js";const y=[{name:"White",hex:"#ffffff"},{name:"Ivory",hex:"#fffff0"},{name:"Pastel Pink",hex:"#f9d6d6"},{name:"Pink",hex:"#f48fb1"},{name:"Peach",hex:"#ffcba4"},{name:"Shrimp",hex:"#fa8072"},{name:"Orange",hex:"#ff8c00"},{name:"Burnt Orange",hex:"#cc5500"},{name:"Copper",hex:"#b87333"},{name:"Gold",hex:"#d4af37"},{name:"Poppy",hex:"#e63946"},{name:"Maize",hex:"#f6d860"},{name:"Lemon",hex:"#fff44f"},{name:"Light Olive",hex:"#b5b35c"},{name:"Olive",hex:"#808000"},{name:"Lime",hex:"#bfff00"},{name:"Celadon",hex:"#ace1af"},{name:"Kelly Green",hex:"#4cbb17"},{name:"Hunter Green",hex:"#355e3b"},{name:"Pacifica",hex:"#1ca9c9"},{name:"Teal",hex:"#008080"},{name:"Mint",hex:"#98ff98"},{name:"Turquoise",hex:"#40e0d0"},{name:"Ocean",hex:"#1f6f8b"},{name:"Light Blue",hex:"#add8e6"},{name:"Periwinkle",hex:"#ccccff"},{name:"Slate Blue",hex:"#6a5acd"},{name:"Royal Blue",hex:"#4169e1"},{name:"Navy",hex:"#001f54"},{name:"Eggplant",hex:"#614051"},{name:"Raspberry",hex:"#b3446c"},{name:"Plum",hex:"#8e4585"},{name:"Grape",hex:"#6f2da8"},{name:"Amethyst",hex:"#9966cc"},{name:"Lilac",hex:"#c8a2c8"},{name:"Mauve",hex:"#e0b0ff"},{name:"Flamingo",hex:"#fc8eac"},{name:"Dusty Rose",hex:"#dcae96"},{name:"Magenta",hex:"#ff00ff"},{name:"Cardinal Red",hex:"#c41e3a"},{name:"Burgundy",hex:"#800020"},{name:"Chocolate",hex:"#7b3f00"},{name:"Khaki",hex:"#c3b091"},{name:"Beige",hex:"#f5f5dc"},{name:"Pewter",hex:"#8a9597"},{name:"Grey",hex:"#808080"},{name:"Black",hex:"#000000"}];function E({on:s,onChange:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>a(!s),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${s?"bg-primary":"bg-muted"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-background shadow transition-transform ${s?"translate-x-5":"translate-x-0.5"}`})})}const L=N,k=[{key:"rect",label:"8'x4' Rectangular Tables",sub:"Seats up to 8 per table",seats:8,nameLabel:"8'x4' Rectangular"},{key:"round",label:"6' Round Tables",sub:"Seats 10 per table",seats:10,nameLabel:"6' Round"},{key:"round6",label:"5' Round Tables",sub:"Seats 8 per table",seats:8,nameLabel:"5' Round"}],C=(s,a)=>{const l=k.find(o=>o.key===s)?.seats??10,i=Math.ceil(a/l);return s==="rect"?i<=1?2:i:Math.max(1,i)},j=(s,a="round6")=>({id:Math.random().toString(36).slice(2,10),tableType:a,linenColor:"White",qty:C(a,s)});function U({price:s,on:a,setOn:l,guests:i,entries:o,setEntries:m,helper:c}){const h=(t,x)=>{m(o.map(d=>d.id===t?{...d,...x}:d))},u=t=>{m(o.filter(x=>x.id!==t))},n=()=>m([...o,j(i)]),r=t=>{t&&m([j(i)]),l(t)};return e.jsxs("div",{className:"rounded-xl border border-border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:"Rent Guest Tables with Linens"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Guest tables with linen to-the-floor in your color of choice."}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s})]}),e.jsx(E,{on:a,onChange:r})]}),a&&e.jsxs("div",{className:"mt-3 space-y-3",children:[o.map((t,x)=>e.jsx(G,{index:x,entry:t,guests:i,canRemove:o.length>1,onChange:d=>h(t.id,d),onRemove:()=>u(t.id)},t.id)),e.jsx("button",{type:"button",onClick:n,className:"w-full rounded-lg border border-dashed border-border px-3 py-2 text-xs font-medium text-muted-foreground hover:bg-secondary/50 hover:text-foreground transition-colors",children:"+ Add another table"}),c&&e.jsx("p",{className:"text-xs text-muted-foreground",children:c})]})]})}function G({index:s,entry:a,guests:l,canRemove:i,onChange:o,onRemove:m}){const[c,h]=T.useState(!1),u=y.find(r=>r.name===a.linenColor)?.hex??"#ffffff",n=r=>{if(r===a.tableType)return;const t=C(r,l);o({tableType:r,qty:Math.max(a.qty,t)})};return e.jsxs("div",{className:"rounded-lg border border-border bg-secondary/30 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-xs font-semibold text-muted-foreground",children:["Table #",s+1]}),i&&e.jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-destructive transition-colors",children:"Remove"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-1",children:"Table style"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:k.map(r=>e.jsxs("button",{type:"button",onClick:()=>n(r.key),className:`relative text-left rounded-lg border px-3 py-2 text-sm transition-colors ${a.tableType===r.key?"border-primary bg-primary/5":"border-border hover:bg-secondary/50"}`,children:[e.jsx("div",{className:"font-medium",children:r.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:r.sub}),r.key==="round6"&&e.jsx("span",{className:"rec-badge absolute -top-2 right-2 roun
1ded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-white",style:{backgroundColor:"#752125"},children:"Recommended"})]},r.key))})]}),e.jsx("div",{className:"flex flex-wrap items-end justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-1",children:"Quantity"}),e.jsx(L,{value:a.qty,min:1,onChange:r=>o({qty:r})})]})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-1",children:"Linen color"}),e.jsxs("button",{type:"button",onClick:()=>h(r=>!r),className:"h-9 w-full rounded-lg border border-border bg-background px-2 text-sm flex items-center gap-2 text-left hover:bg-secondary/50",children:[e.jsx("span",{className:"inline-block h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:u},"aria-hidden":"true"}),e.jsx("span",{className:"truncate flex-1",children:a.linenColor}),e.jsx("span",{className:"text-xs text-muted-foreground",children:c?"▴":"▾"})]}),c&&e.jsx("div",{role:"radiogroup","aria-label":"Linen color",className:"mt-2 grid grid-cols-2 sm:grid-cols-3 gap-1.5",children:y.map(r=>{const t=a.linenColor===r.name;return e.jsxs("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>{o({linenColor:r.name}),h(!1)},className:`flex items-center gap-2 rounded-lg border px-2 py-1.5 text-xs cursor-pointer transition-colors text-left ${t?"border-primary bg-primary/5":"border-border hover:bg-secondary/50"}`,children:[e.jsx("span",{className:"inline-block h-5 w-5 rounded border border-border shrink-0",style:{backgroundColor:r.hex},"aria-hidden":"true"}),e.jsx("span",{className:"truncate",children:r.name})]},r.name)})})]})]})}const w="/assets/white-resin-chair-BNDFuqp3.webp",O="/assets/black-resin-chair-CxYyM3uh.webp",A="/assets/natural-wood-chair-DnEAGh2u.webp",R="/assets/chiavari-chair-DInb_X1i.webp",B="/assets/chiavari-chair-white-BbOOKkQp.webp",W="/assets/chiavari-chair-gold-BkODti-u.webp",_="/assets/chiavari-chair-black-jHsxEjL6.webp",p=[{name:"White Resin",hex:"#f8f7f4"},{name:"Black Resin",hex:"#1a1a1a"},{name:"Natural Wood",hex:"#c9a274"}],g=[{name:"White",hex:"#f8f7f4"},{name:"Silver",hex:"#c0c0c0"},{name:"Gold",hex:"#d4af37"},{name:"Black",hex:"#1a1a1a"}],I=5.8,S=16,P={"White Resin":w,"Black Resin":O,"Natural Wood":A},M={White:B,Silver:R,Gold:W,Black:_},$=(s,a)=>s==="chiavari"?M[a]??R:P[a]??w,q=(s=1)=>({id:Math.random().toString(36).slice(2,10),chairType:"resin",color:p[0].name,qty:s}),V=s=>s==="chiavari"?"Chiavari Chairs":"Resin Folding Chairs",Q=(s,a)=>s==="chiavari"?a?.chiavari??S:a?.resin??I;function D({on:s,onChange:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>a(!s),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${s?"bg-primary":"bg-muted"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-background shadow transition-transform ${s?"translate-x-5":"translate-x-0.5"}`})})}const H=N;function Y({on:s,setOn:a,minQty:l,entries:i,setEntries:o,resinPrice:m,chiavariPrice:c,defaultNewEntryQty:h}){const u=m??I,n=c??S,r=(d,b)=>{o(i.map(f=>f.id===d?{...f,...b}:f))},t=d=>o(i.filter(b=>b.id!==d)),x=()=>o([...i,q(Math.max(l,h??l))]);return e.jsxs("div",{className:"rounded-xl border border-border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:"Rent Chairs"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Resin Folding $",v(u)," ea • Chiavari $",v(n)," ea"]})]}),e.jsx(D,{on:s,onChange:a})]}),s&&e.jsxs("div",{className:"mt-3 space-y-3",children:[i.map((d,b)=>e.jsx(F,{index:b,entry:d,minQty:l,canRemove:i.length>1,resinPrice:u,chiavariPrice:n,onChange:f=>r(d.id,f),onRemove:()=>t(d.id)},d.id)),e.jsx("button",{type:"button",onClick:x,className:"w-full rounded-lg border border-dashed border-border px-3 py-2 text-xs font-medium text-muted-foreground hover:bg-secondary/50 hover:text-foreground transition-colors",children:"+ Add another chair"})]})]})}function F({index:s,entry:a,minQty:l,canRemove:i,resinPrice:o,chiavariPrice:m,onCh
1ange:c,onRemove:h}){const u=a.chairType==="resin"?p:g;return e.jsxs("div",{className:"rounded-lg border border-border bg-secondary/30 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-xs font-semibold text-muted-foreground",children:["Chair #",s+1]}),i&&e.jsx("button",{type:"button",onClick:h,className:"text-xs text-muted-foreground hover:text-destructive transition-colors",children:"Remove"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-2",children:"Chair type"}),e.jsx("div",{role:"radiogroup","aria-label":"Chair type",className:"grid grid-cols-2 gap-1.5",children:[{key:"resin",label:"Resin Folding Chairs",price:o},{key:"chiavari",label:"Chiavari Chairs",price:m}].map(n=>{const r=a.chairType===n.key,t=r?a.color:n.key==="resin"?p[0].name:g[0].name,x=$(n.key,t);return e.jsxs("button",{type:"button",role:"radio","aria-checked":r,onClick:()=>{const d=n.key==="resin"?p[0].name:g[0].name;c({chairType:n.key,color:d})},className:`flex flex-col items-stretch gap-2 rounded-lg border p-2 text-left text-xs transition-colors ${r?"border-primary bg-primary/5":"border-border hover:bg-secondary/50"}`,children:[e.jsx("img",{src:x,alt:n.label,className:"w-full aspect-square sm:aspect-auto sm:h-56 rounded-md object-cover border border-border"}),e.jsxs("div",{className:"px-1 pb-1",children:[e.jsx("div",{className:"font-medium text-sm",children:n.label}),e.jsxs("div",{className:"text-muted-foreground",children:["$",v(n.price)," ea"]})]})]},n.key)})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-2",children:"Chair color"}),e.jsx("div",{role:"radiogroup","aria-label":"Chair color",className:"grid grid-cols-2 sm:grid-cols-4 gap-1.5",children:u.map(n=>{const r=a.color===n.name;return e.jsxs("button",{type:"button",role:"radio","aria-checked":r,onClick:()=>c({color:n.name}),className:`flex items-center gap-2 rounded-lg border px-2 py-1.5 text-xs cursor-pointer transition-colors text-left ${r?"border-primary bg-primary/5":"border-border hover:bg-secondary/50"}`,children:[e.jsx("span",{className:"inline-block h-5 w-5 rounded border border-border shrink-0",style:{backgroundColor:n.hex},"aria-hidden":"true"}),e.jsx("span",{className:"truncate",children:n.name})]},n.name)})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium mb-2",children:"Quantity"}),e.jsx(H,{value:a.qty,min:l,onChange:n=>c({qty:n})})]})]})}export{U as G,y as L,Y as W,q as a,k as b,Q as c,V as d,g as e,p as f,R as g,A as h,O as i,B as j,W as k,_ as l,$ as m,j as n,w as r};

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.