r.json())
.then(d => {
if (d.found) {
this.upsQuote = Number(d.price);
this.upsQuoteMsg = (d.estimated ? 'Est. UPS to ' : 'UPS to ') + z + ': $' + this.upsQuote.toFixed(2)
+ (d.estimated ? ' (confirmed at checkout)' : '');
} else {
this.upsQuote = null;
this.upsQuoteMsg = d.reason === 'invalid'
? 'Enter a valid 5-digit ZIP.'
: 'We\'ll confirm shipping to ' + z + ' at checkout.';
}
})
.catch(() => { this.upsQuoteMsg = 'Could not check that ZIP. We\'ll confirm at checkout.'; });
},
showEmailModal: false,
showSaveModal: false,
showRoomModal: false,
emailNotes: '',
saveNotes: '',
emailAddress: '',
zoomSrc: null,
zoomLabel: '',
// Only fire the hover preview on real pointer devices — on touch screens a
// 'hover' is emulated by a tap and would cover the page.
showZoom(src, label) {
if (!window.matchMedia('(hover: hover) and (pointer: fine)').matches) return;
this.zoomSrc = src; this.zoomLabel = label || '';
},
hideZoom() { this.zoomSrc = null; this.zoomLabel = ''; },
get currentImg() { return this.images[this.imgIdx] ?? 'https://www.costikyancustomcarpet.com/media/products/2t2JGwBAWHP8NZfbN5cSAs7zDplPtloRMXCYGykn.jpg'; },
prev() { this.imgIdx = (this.imgIdx - 1 + this.images.length) % this.images.length; },
next() { this.imgIdx = (this.imgIdx + 1) % this.images.length; },
get customSqFt() {
let w = (parseFloat(this.wFt) || 0) + (parseFloat(this.wIn) || 0) / 12;
let h = (parseFloat(this.hFt) || 0) + (parseFloat(this.hIn) || 0) / 12;
return (w > 0 && h > 0) ? w * h : 0;
},
get sizePrice() {
if (Object.keys(this.dimPrices).length > 0) {
let dim = this.dimPrices[this.selectedSize];
if (dim) return Number(dim.sale_price ?? dim.price);
if (this.selectedSize === 'custom') {
let sqft = this.customSqFt;
let ref = this.dimPrices[this.lastStandardSize];
let refPrice = Number(ref ? (ref.sale_price ?? ref.price) : 1000.00);
let refSqft = (ref && ref.width && ref.length) ? (ref.width * ref.length) : 54;
return sqft > 0 ? Math.round(refPrice * (sqft / refSqft)) : refPrice;
}
return 1000.00;
}
let base = 1000.00;
if (this.selectedSize === 'custom') {
let sqft = this.customSqFt;
return sqft > 0 ? Math.round(base * (sqft / 54)) : base;
}
return Math.round(base * (this.sizeModifiers[this.selectedSize] ?? 1));
},
get sergePrice() {
let dim = this.dimPrices[this.selectedSize];
if (dim && dim.width && dim.length) {
let wl = Math.round(parseFloat(dim.width)) + 'x' + Math.round(parseFloat(dim.length));
if (this.sergePrices[wl]) return this.sergePrices[wl];
return Math.round(parseFloat(dim.width) * parseFloat(dim.length) * 11.5);
}
if (this.selectedSize === 'custom') {
let sqft = this.customSqFt;
return sqft > 0 ? Math.round(sqft * 11.5) : this.sergePrices['6x9'];
}
let s = String(this.selectedSize).toLowerCase().replace(/[^0-9x]/g, '');
return this.sergePrices[s] ?? this.sergePrices['6x9'];
},
get addOnsTotal() {
let add = 0;
if (this.addOns.protector) add += 120;
if (this.addOns.padding) add += 190;
if (this.addOns.spot) add += 19.99;
if (this.addOns.serge) add += this.sergePrice;
return add;
},
get deliveryPrice() {
if (this.delivery === 'whiteglove') return 250;
if (this.delivery === 'ups') return this.upsQuote ?? 0;
if (this.delivery === 'pickup') return 50;
return 0;
},
get deliveryLabel() {
if (this.delivery === 'whiteglove') return 'White-Glove Delivery';
if (this.delivery === 'ups') return 'Standard UPS Shipping';
if (this.delivery === 'pickup') return 'Warehouse Pick-Up';
return 'Delivery';
},
get qtyNum() { return Math.max(1, parseInt(this.qty) || 1); },
// Rug + add-ons scale with quantity; delivery is charged once.
get estimateTotal() {
return (this.sizePrice + this.addOnsTotal) * this.qtyNum + this.deliveryPrice;
},
fmt(n) { return '$' + Number(n).toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2}); },
roomGenerating: false,
roomResultUrl: '',
roomError: '',
roomStatus: '',
roomCredits: 0,
resetRoom() { this.roomResultUrl = ''; this.roomError = ''; this.roomStatus = ''; },
async generateRoom(e) {
const form = e.target;
if (!form.room_photo.files.length) return;
this.roomError = '';
this.roomResultUrl = '';
this.roomGenerating = true;
const msgs = ['Analyzing your room…', 'Placing your rug…', 'Matching lighting & shadows…', 'Adding finishing touches…'];
let i = 0; this.roomStatus = msgs[0];
const ticker = setInterval(() => { i = (i + 1) % msgs.length; this.roomStatus = msgs[i]; }, 2800);
try {
const res = await fetch(form.action, {
method: 'POST',
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name=csrf-token]').content,
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
},
body: new FormData(form),
});
let json = {};
try { json = await res.json(); } catch (_) {}
if (res.ok && json.success) {
this.roomResultUrl = json.url;
if (typeof json.credits !== 'undefined') this.roomCredits = json.credits;
form.reset();
document.getElementById('roomPreview')?.classList.add('hidden');
document.getElementById('roomFilename').textContent = 'Click to upload room photo';
} else {
this.roomError = (json && json.error) ? json.error : 'Generation failed. Please try again.';
if (typeof json.credits !== 'undefined') this.roomCredits = json.credits;
}
} catch (err) {
this.roomError = 'Something went wrong. Please check your connection and try again.';
} finally {
clearInterval(ticker);
this.roomGenerating = false;
}
}
}">
WAREHOUSE SALE · ANTIQUE
Construction: Hand-Knotted
Material: Wool
$2,000.00
From $1,000.00
Rug Details:
| Material |
Wool |
| Construction |
Hand-Knotted |
| Origin |
Turkey |
Dimensions
9' 0" X 5' 7"
One-of-a-kind piece — sold as shown.
Add-on Services
Extra comfort, grip, and longevity
Choose your pad:
Delivery method
White-Glove Delivery & Spread
+$250
Timeline: 2 weeks
This delivery option is currently available only in New York, New Jersey, Connecticut, Boston, and Philadelphia.
Log in to see our trade pricing.
Log in
Creating your visualization — this can take up to a minute.
Credits remaining:
Please log in to use See It In Your Room. You will receive 3 free AI credits.
Log In
Rug
Add-on services
Quantity
Total
Rug & add-ons shown per piece × quantity. Delivery charged once. Final price confirmed at checkout.