/* Growth navigation and presentation. */ (()=>{'use strict'; if(!(['growthroaster.com','www.growthroaster.com'].includes(location.hostname)||(location.hostname==='salla.sa'&&location.pathname.startsWith('/ffd0d7b2-be78-4834-91c3-3c6fc0528bc9'))))return; function mount(){ const header=document.querySelector('header.store-header');if(!header)return; if(!document.getElementById('growth-native-nav')){ const nav=document.createElement('nav');nav.id='growth-native-nav';nav.className='growth-native-nav';nav.setAttribute('aria-label','أقسام قروث'); const home=header.querySelector('a.navbar-brand')?.href;if(!home)return; const base=home.replace(/\/$/,''); const links=[['الرئيسية',home],['محاصيل القهوة',base+'/category/VRQEgb'],['المحاصيل الفاخرة',base+'/category/lRgDbD'],['أظرف القهوة',base+'/category/YeqQPW'],['البوكسات والهدايا',base+'/-/c939566399'],['بوكس التذوق',base+'/#growth-bundle'],['عن قروث','#growth-about']]; links.push(['مبيعات الجملة','https://wa.me/966554548646']); for(const [label,href] of links){const a=document.createElement('a');a.textContent=label;a.href=href;if(href.startsWith('https://wa.me/')){a.target='_blank';a.rel='noopener';}nav.appendChild(a);} header.appendChild(nav); const dialog=document.createElement('dialog');dialog.id='growth-about';dialog.className='growth-about-dialog'; dialog.innerHTML='
محمصة قروث في المدينة المنورة. محاصيل قهوة مختصة من مناشئ متنوعة، وأظرف ترشيح وبوكسات لاكتشاف النكهات ومشاركتها.
الاستلام من فرع محمصة قروث في حي الدفاع.
موقع الاستلام على خرائط Google ↗'; document.body.appendChild(dialog); nav.querySelector('a[href$="#growth-bundle"]').addEventListener('click',e=>{const box=document.getElementById('growth-bundle');if(box){e.preventDefault();history.replaceState(null,'','#growth-bundle');box.scrollIntoView({behavior:'smooth',block:'start'});}}); nav.querySelector('a[href="#growth-about"]').addEventListener('click',e=>{e.preventDefault();dialog.showModal();}); } } if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',mount,{once:true});else mount(); const observer=new MutationObserver(()=>mount());observer.observe(document.documentElement,{childList:true,subtree:true});setTimeout(()=>observer.disconnect(),15000); })(); /* Growth sampler: 3 or 5 whole-bean crops, 250g each, native Salla cart. */ (()=>{'use strict'; const previewHost=(['growthroaster.com','www.growthroaster.com'].includes(location.hostname)||(location.hostname==='salla.sa'&&location.pathname.startsWith('/ffd0d7b2-be78-4834-91c3-3c6fc0528bc9'))); if(!previewHost)return; const products=[{"id": 79389685, "name": "إثيوبي قوجي", "price": 48, "image": "https://cdn.files.salla.network/products/284195285/1c95b777-1c8e-4b88-b5c6-87a919375fe0-original.webp", "tier": "standard", "note": "خوخ، كراميل، توت"}, {"id": 436014834, "name": "أوغندي مسابا", "price": 46, "image": "https://cdn.files.salla.network/products/284195285/4074863e-57dc-49db-affa-5f822cf8625c-original.webp", "tier": "premium", "note": "توت، فانيليا، برقوق، عنب"}, {"id": 544121335, "name": "كولومبيا هويلا", "price": 42, "image": "https://cdn.files.salla.network/products/284195285/6022cf67-c681-44f3-8f75-3a20d7e31d11-original.webp", "tier": "standard", "note": "سكر بني، شوكولاتة، كراميل، جريب فروت"}, {"id": 549286460, "name": "إثيوبي هاديسو", "price": 49, "image": "https://cdn.salla.sa/rArvxw/8005c767-ce1e-433c-b091-4a75e89f88b2-1000x1000-msa9x8Qhgvn142S8y6DmCurKlqdQ8pFFAfWygBQd.png", "tier": "premium", "note": "عنب، فراولة"}, {"id": 609053937, "name": "كولومبيا توليما", "price": 43, "image": "https://cdn.files.salla.network/products/284195285/58d908ef-362c-4f09-9f44-91af312348fd-original.webp", "tier": "standard", "note": "سكر بني، فواكه مجففة، قشر الليمون"}, {"id": 790530325, "name": "إثيوبي أنيروبيك همبيلا", "price": 59, "image": "https://cdn.salla.sa/rArvxw/232678ef-dec9-4f2d-ac3a-ea63a5509a81-1000x1000-PhbjwhlxDEepIy2OIedLQnJCLodoYkcAro5FVJEx.png", "tier": "reserve", "note": "مانجو، أناناس، كرز"}, {"id": 929919236, "name": "إثيوبي شاكيسو", "price": 47, "image": "https://cdn.files.salla.network/other/284195285/7d2d513a-db6c-4f4f-9d0f-98c4f86b46f2-original.webp", "tier": "premium", "note": "عسل، فواكه، مذاق نظيف"}, {"id": 1418212548, "name": "إثيوبي همبيلا", "price": 44, "image": "https://cdn.files.salla.network/products/284195285/77490472-86e6-4dbd-a854-82eab28ed2d7-original.webp", "tier": "standard", "note": "خوخ، توت"}, {"id": 1451328246, "name": "إثيوبي ننسيبو", "price": 46, "image": "https://cdn.files.salla.network/products/284195285/ab89cf85-5881-49b2-8f1f-9d30aaf3c24f-original.webp", "tier": "premium", "note": "عنب أسود، شوكولاتة، تين"}, {"id": 1624960427, "name": "إثيوبي أوراقا", "price": 48, "image": "https://cdn.salla.sa/rArvxw/abc1aae2-a6fc-4ce0-bd62-292fff5ec9b2-1000x1000-uKMYaxPRa5yjhzGAPWwcB8itqyUnd5AlP537mfgJ.png", "tier": "premium", "note": "شوكولاتة، مكسرات، أزهار، ليمون"}, {"id": 1634372350, "name": "برازيلي فازيندا", "price": 40, "image": "https://cdn.files.salla.network/products/284195285/c400fa1d-4c02-491b-8593-8bda8563f9e2-original.webp", "tier": "standard", "note": "شوكولاتة، كراميل، مكسرات"}, {"id": 1672039633, "name": "إثيوبي تشيلتشيلي", "price": 47, "image": "https://cdn.files.salla.network/products/284195285/3004540f-fd1f-4a29-8605-674735586572-original.webp", "tier": "premium", "note": "فاكهية، حلوة، شاي، زهرية"}, {"id": 1813598748, "name": "أوغندي بوجوكو", "price": 48, "image": "https://cdn.salla.sa/rArvxw/1a85f8eb-6c57-4d2b-87e9-fef27ddd7e0e-1000x1000-gPhljxyo9ATzFvu6SklMf3C93Je3uSnzD4DidbR8.png", "tier": "standard", "note": "سكر بني، كاكاو"}, {"id": 1910819723, "name": "أوغندي ماناناسي", "price": 49, "image": "https://cdn.salla.sa/rArvxw/fbf00179-b313-4279-affa-3c612cac0d84-1000x1000-JuOruNnRf341gjOYgLiv5XCEdnSlVNYvl3IHbkvh.png", "tier": "standard", "note": "مشمش، مانجو، شوكولاتة داكنة"}, {"id": 709442074, "name": "أوغندا زيوا", "price": 42, "image": "https://cdn.files.salla.network/other/284195285/63f058ed-6523-4858-85dc-3062346f0c58-original.webp", "tier": "standard", "note": "شوكولاتة بالحليب، كراميل، زهور، موز، توابل بنية، عنب"}, {"id": 1917567216, "name": "سلفادور سانتا", "price": 42, "image": "https://cdn.files.salla.network/products/284195285/84c3c525-2528-45c6-8372-5eab1381c43d-original.webp", "tier": "standard", "note": "لوز، كاكاو، برقوق"}, {"id": 323422794, "name": "كيني مغسول", "price": 43, "image": "https://cdn.files.salla.network/other/284195285/2a9ce5e0-048c-4f73-b3b9-4a7e3c298946-original.webp", "tier": "standard", "note": "كشمش أسود، توت أحمر، حمضيات، سكر بني"}, {"id": 249436507, "name": "يمني فاخر حراز", "price": 79, "image": "https://cdn.files.salla.network/other/284195285/83d45d4e-c7bd-41bf-9083-cc0c2ebca464-original.webp", "tier": "signature", "note": "زهور، فواكه استوائية"}, {"id": 430375075, "name": "كولومبي معزز بنكهة فراولة", "price": 79, "image": "https://cdn.files.salla.network/other/284195285/0d4cbca0-1e10-407d-828c-a4c6f144e37e-original.webp", "tier": "reserve", "note": "فراولة"}, {"id": 214354601, "name": "كولومبي سنجاريا — العنب", "price": 79, "image": "https://cdn.files.salla.network/other/284195285/c13836e6-897a-4310-8a38-037b6741ab38-original.webp", "tier": "reserve", "note": "عنب"}, {"id": 820010430, "name": "يمني حراز — تخمير مشترك بالهيل", "price": 91, "image": "https://cdn.files.salla.network/other/284195285/13e55402-00da-4ddb-8a61-e537f1da1d41-original.webp", "tier": "reserve", "note": "هيل"}, {"id": 1870431104, "name": "كولومبيا إل تابور", "price": 58, "image": "https://cdn.files.salla.network/other/284195285/2d14e5e8-c171-4586-8dca-b29fba770db3-original.webp", "tier": "signature", "note": "عسل، باشن فروت، توت العليق"}, {"id": 329127573, "name": "إثيوبي أوراقا — نبيذ العنب", "price": 89, "image": "https://cdn.files.salla.network/other/284195285/eafcb7ad-c192-4e8c-9f24-b0aa7e520748-original.webp", "tier": "signature", "note": "عنب"}, {"id": 1311333535, "name": "البرازيل كارمو ميناس", "price": 45, "image": "https://cdn.files.salla.network/other/284195285/2b003d16-9098-43e8-8ddb-a933a72a28f3-original.webp", "tier": "signature", "note": "شوكولاتة بالحليب، بندق"}, {"id": 719283168, "name": "رواندا هويي قيشامفو", "price": 56, "image": "https://cdn.files.salla.network/other/284195285/c89b5fb3-c316-4005-8cf3-5f14e839562c-original.webp", "tier": "signature", "note": "فواكه صفراء، مانجو، كراميل"}, {"id": 395217641, "name": "إثيوبيا قوجي بنتي ننكا", "price": 54, "image": "https://cdn.files.salla.network/other/284195285/0b7a6166-8a45-4afc-8255-edd5260892c2-original.webp", "tier": "signature", "note": "خوخ ناضج، لمحات فواكه استوائية"}, {"id": 1774452477, "name": "كولومبيا تانجرين برتقال يوسفي", "price": 88, "image": "https://cdn.files.salla.network/other/284195285/fffba401-1eb6-48ae-babe-c2ab8b49f91a-original.webp", "tier": "reserve", "note": "يوسفي، ماندارين، برتقال حلو"}]; const base=document.querySelector('a.navbar-brand')?.href.replace(/\/$/,'');if(!base)return; const homePath=new URL(base).pathname.replace(/\/$/,'');if(location.pathname.replace(/\/$/,'')!==homePath)return; let busy=false,finished=false,filter='all';const selected=new Set(); const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const money=n=>new Intl.NumberFormat('ar-SA',{maximumFractionDigits:2}).format(n)+' ريال'; const limit=(promise)=>Promise.race([promise,new Promise((_,reject)=>setTimeout(()=>reject(Error('تأخر تأكيد سلة. راجع السلة قبل إعادة المحاولة.')),20000))]); async function check(p){const r=await limit(salla.product.getDetails(p.id,['options']));if(!r.success||!r.data)throw Error('تعذر التحقق من '+p.name);const d=r.data;if(d.is_available===false)throw Error(p.name+' غير متاح حاليًا');if(Array.isArray(d.options)&&d.options.length)throw Error(p.name+' يحتاج اختيار خيارات من صفحة المنتج');const q=await limit(salla.product.getPrice({id:p.id,quantity:1}));if(!q.success||!Number.isFinite(Number(q.data?.price)))throw Error('تعذر تأكيد سعر '+p.name);return {price:Number(q.data.price),available:d.is_available,options:(d.options||[]).length,weight:d.weight_label||d.weight};} function mount(){const main=document.querySelector('main');if(!main||document.getElementById('growth-bundle'))return; const style=document.createElement('style');style.textContent=`#growth-bundle{max-width:1240px;margin:48px auto;padding:32px 20px;background:#fffaf1;color:#40261e;border:1px solid #ddccb4;border-radius:18px;scroll-margin-top:110px}#growth-bundle h2{font-size:30px;font-weight:800;color:#234c35;margin:0 0 12px}#growth-bundle p{line-height:1.9}#growth-bundle .gb-tools{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:20px 0}#growth-bundle select,#growth-bundle input[type=search]{padding:12px;border:1px solid #b7a181;border-radius:8px;background:white;color:#234c35}#growth-bundle input[type=search]{flex:1;min-width:160px}#growth-bundle .gb-tabs{display:flex;gap:8px;flex-wrap:wrap}#growth-bundle button{padding:10px 17px;border-radius:8px;border:1px solid #234c35;background:#fffaf1;color:#234c35;font-weight:700}#growth-bundle button[aria-pressed=true],#growth-bundle #growth-box-send{background:#234c35;color:white}#growth-bundle button:disabled{opacity:.45;cursor:not-allowed}#growth-box-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:24px 0}#growth-bundle .gb-card{position:relative;border:1px solid #ddccb4;border-radius:10px;padding:8px;background:#fff;display:flex;flex-direction:column;gap:8px;cursor:pointer}#growth-bundle .gb-card:has(input:checked){outline:3px solid #234c35}#growth-bundle .gb-card[hidden]{display:none}#growth-bundle .gb-card img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:6px}#growth-bundle .gb-card input{accent-color:#234c35;width:19px;height:19px}#growth-bundle .gb-card strong{font-size:14px}#growth-bundle .gb-note{font-size:11px;line-height:1.7;color:#79634e;min-height:35px}#growth-bundle .gb-price{color:#234c35;font-weight:800}#growth-bundle .gb-star{color:#9e7427;font-size:12px}#growth-bundle .gb-summary{position:static;background:#f1e8d6;padding:18px;border:1px solid #c7b187;border-radius:12px;box-shadow:0 5px 20px #0002}#growth-box-slots{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}#growth-box-slots img{width:64px;height:64px;border-radius:6px;object-fit:contain}#growth-bundle .gb-empty{width:64px;height:64px;border:1px dashed #9a8669;display:grid;place-items:center;border-radius:6px;color:#9a8669}#growth-bundle .gb-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap}#growth-box-status{margin:8px 0 0}#growth-bundle details{margin-top:20px;font-size:12px}#growth-bundle pre{white-space:pre-wrap;direction:rtl}#growth-box-total{font-size:20px;font-weight:800} @media(max-width:900px){#growth-box-options{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:550px){#growth-bundle{margin:24px 10px;padding:20px 12px}#growth-box-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#growth-bundle h2{font-size:24px}#growth-bundle .gb-summary{bottom:4px;padding:12px}#growth-box-slots img,#growth-bundle .gb-empty{width:45px;height:45px}}`; document.head.append(style);const panel=document.createElement('section');panel.id='growth-bundle';panel.dir='rtl';panel.innerHTML=`اختر ٣ أو ٥ محاصيل من قروث. كل كيس ٢٥٠ جرام من الحبوب الكاملة، والسعر هو مجموع المحاصيل التي تختارها.
`;const anchor=main.querySelector('#best-offers-5-slider');if(anchor)anchor.after(panel);else main.append(panel); const q=id=>document.getElementById(id),options=q('growth-box-options');for(const p of products){const label=document.createElement('label');label.className='gb-card';label.dataset.id=p.id;label.innerHTML=`محمصة قروث
' + 'محاصيل مختصة بإيحاءات متنوعة. اختر النكهة الأقرب لك، أو كوّن بوكس التذوق من ٣ أو ٥ محاصيل.
' + ''; const heroProduct = document.createElement('img'); heroProduct.className = 'gc-hero-product'; heroProduct.src = picks[0].image; heroProduct.alt = ''; heroProduct.setAttribute('aria-hidden', 'true'); heroProduct.width = 320; heroProduct.height = 320; heroProduct.decoding = 'async'; hero.appendChild(heroProduct); main.prepend(hero); } let choices = document.getElementById('growth-conversion-picks'); if (!choices) { choices = document.createElement('section'); choices.id = 'growth-conversion-picks'; choices.dir = 'rtl'; choices.setAttribute('aria-labelledby', 'growth-conversion-picks-title'); choices.innerHTML = 'اختيارات تساعدك تبدأ
' + 'ثلاثة محاصيل بإيحاءات مختلفة · حبوب كاملة · ٢٥٠ جم للكيس
إيحاءات: ' + escapeHTML(product.note) + '
' + '' + (href ? 'شوف المحصول' : 'اختره ضمن بوكسك') + '