!function(){"use strict";if(!window.__alphaGuideLoaded){window.__alphaGuideLoaded=!0;var e,t,n,a,o,i=window.AlphaGuideCfg||{},s="Alpha Web Agency is a Muscat-based team of web developers, software engineers and graphic designers, serving clients across Oman and the GCC since 2016. Founded by Hussein Al Nabulsi, we deliver award-winning websites, complete branding, and powerful custom business systems (Alpha Systems). Our expertise spans modern web frameworks and custom software, which makes us one of the most trusted web solution partners in the region.",r="Our vision is to revolutionize how businesses present themselves online — whether selling services or products, or showcasing a company and its portfolio. We believe your website is your digital office, and we are committed to transforming how businesses appear and operate online.",l="Clients choose Alpha Web because we combine three things most agencies split apart: design, development and custom business software. You get award-winning, fast, SEO-ready websites; full brand identity work; and, when you need it, tailored systems that automate your operations. We are known in the Omani market for clear communication, reliability, and genuinely understanding what each client needs — and we support everything we build.",u="We work to a few simple principles: build around how your business actually operates rather than off-the-shelf assumptions, communicate clearly at every stage, deliver work that is secure and built to last, and treat every project as a long-term partnership. Most of our clients are repeat clients.",d="Branding builds recognition, loyalty and trust, and it ultimately supports sales and growth. Our branding work includes brand identity and strategy, logo design (Arabic and English), colour schemes and typography, business cards and stationery, custom illustrations, and consistent visuals across your channels. Effective branding starts with a clear understanding of your target market — that is where we begin.",c="We design and build several kinds of websites:\n\n• Introductory — a clean, focused presence to introduce your business\n• Portfolio — to showcase your work and projects\n• Corporate — dynamic, scalable sites for established companies\n• E-commerce — full online stores with bookings and payments\n• Real estate — property listings and enquiry-driven sites\n\nWe build on WordPress or any preferred language and framework (including Vue.js and React.js). The right choice depends on how much customization you need and how heavy-duty the site has to be — a straightforward site is perfect on WordPress, while a highly custom or high-traffic platform may be better built in a dedicated framework. Tell me what you have in mind and I can point you the right way.",h=[{id:"portal",triggers:["portal","client portal","client lounge","web portal","crm","lead pipeline"],answer:"Alpha Web Portal is an all-in-one business operations platform: a 16-stage lead pipeline CRM, contracts with e-signatures, client onboarding, renewals, reminders and workflow automation — all in one secure, branded environment. It replaces scattered spreadsheets and emails, and it is built to grow with your team."},{id:"booking",triggers:["booking","book ","appointment","reservation","schedule","sea tour","clinic booking","payment","pay online","thawani"],answer:"Alpha Booking System handles online bookings and appointments end to end — availability, payments, confirmations and an admin dashboard. It supports several business modes (restaurant, clinic, consultancy, tours and more), multiple payment gateways, and is hardened against double-booking. It installs as a web app."},{id:"agent",triggers:["web agent","agent","ai ","seo content","write content","yoast","seo issue","seo issues","optimi"],answer:"Alpha Web Agent is an AI assistant for your WordPress site, powered by the Anthropic API. It writes SEO content, checks your site and per-page SEO issues, and corrects them for you through Yoast SEO. It also flags plugin problems and advises on how to configure each plugin properly. You provide your own API key."},{id:"https",triggers:["https","ssl","padlock","not secure","certificate","mixed content","hsts"],answer:"Alpha HTTPS Doctor diagnoses why a site shows 'not secure' or a broken padlock — mixed content, missing HSTS, redirect or certificate issues — and provides the exact fix, including ready-to-paste configuration snippets. It is read-only and safe, and works well on cPanel and shared hosting."},{id:"health",triggers:["health","audit","website doctor","site doctor","checkup","diagnose"],answer:"Alpha Website Health Audit is a free website 'doctor'. It passively scans for security, performance, SEO and accessibility issues, provides a full report with clear fixes per site, runs background scans, and can email a weekly digest. It can monitor multiple client sites from one dashboard."},{id:"suite",triggers:["business suite","accounting","invoicing","suite","finance","bookkeeping"],answer:"Alpha Web Business Suite is a complete business management system — invoicing, clients, accounting and more — branded for your business, with proper currency support and security hardening built in."},{id:"theme",triggers:["theme","custom theme","design theme","wordpress theme","template"],answer:"Alpha Theme is our WordPress theme, and we build fully custom themes on it for clients — including Elementor-friendly layouts and clean, crawler- and AI-friendly SEO out of the box."},{id:"rtl",triggers:["rtl","arabic","right to left","right-to-left","polylang","bilingual","translate layout"],answer:"Alpha RTL Maker corrects right-to-left (Arabic) design and layout so your site looks polished in RTL. Paired with the Polylang plugin, the two work together to deliver a clean, fully correct bilingual and RTL site."},{id:"woo",triggers:["woocommerce","shop","store","ecommerce","diving","course","sell online"],answer:"We build custom WooCommerce and e-commerce solutions — for example, sea-tour and diving booking platforms with filtering and a themed interface. If you sell something specific online, we tailor it to fit."}],p={portal:"Alpha Web Portal",booking:"Alpha Booking System",agent:"Alpha Web Agent",https:"Alpha HTTPS Doctor",health:"Alpha Website Health Audit",suite:"Alpha Web Business Suite",theme:"Alpha Theme",rtl:"Alpha RTL Maker",woo:"a custom e-commerce build"},m="We have worked with a wide range of businesses across Oman and the GCC, including Tasees (company formation & business support), WeDoTrips.co and Demaniyat Adventures (tourism & sea tours), Mobula Dive Center, Indigo Events, Nafas International (consultancy), Rabeha Energy (oil, gas & mining), Parinama, and the Bayanat Platform for Oman's Capital Market Authority. Many of our clients return for repeat work — which we are quite proud of.",g=["Why choose Alpha Web?","What websites do you build?","Tell me about branding","I would like something built"],y=!1,w={branding:["What websites do you build?","See our clients","Get a quote"],websites:["Tell me about branding","Why choose Alpha Web?","Get a quote"],why:["See our clients","What do you offer?","Get a quote"],about:["Our vision","See our clients","Why choose Alpha Web?"],vision:["Our values","Why choose Alpha Web?","What do you offer?"],values:["About Alpha Web","Why choose Alpha Web?"],clients:["Why choose Alpha Web?","Get a quote","How can I contact you?"],services:["What websites do you build?","Tell me about branding","Get a quote"],products:["What websites do you build?","Get a quote","How can I contact you?"],contact:["Get a quote","What do you offer?"],support:["What do you offer?","How can I contact you?"],seo:["What websites do you build?","Get a quote"],product:["Get a quote","How can I contact you?","What else do you offer?"]},b=[{id:"request",strong:["quote","price","pricing","cost","how much","hire","build me","make me","i want","i need","i would like","get started","work with you"],weak:["custom","develop","project","estimate","budget","rate","fee","charge"]},{id:"contact",strong:["contact","phone","email","whatsapp","watsapp","number","call","reach","get in touch","mobile","telephone","mail"],weak:["talk","speak","address","location","where are you","reach out"]},{id:"why",strong:["why choose","why you","why alpha","right choice","right for","why should"],weak:["best","trust","different","stand out","compete","better","advantage","good","reliable"]},{id:"vision",strong:["vision","mission"],weak:["goal","purpose","aim","future","believe in"]},{id:"values",strong:["values","principle","principles"],weak:["believe","culture","approach","how do you work","ethic"]},{id:"about",strong:["about","who are you","who is","your team","your story","founded","history","background","hussein","experience"],weak:["company","agency","established","owner","since when","how long","located","based"]},{id:"clients",strong:["client","clients","portfolio","worked with","case study","past work","references"],weak:["projects","examples","customers","who have you","previous","testimonial","review"]},{id:"branding",strong:["brand","branding","logo","identity"],weak:["graphic","visual","colour","color","typography","stationery","business card","rebrand"]},{id:"websites",strong:["website","web design","web development","corporate site","ecommerce","e-commerce","real estate","introductory","landing page","online store"],weak:["site","wordpress","framework","vue","react","web page","webpage","responsive","mobile site"]},{id:"seo",strong:["seo","search engine","rank","ranking","google ranking"],weak:["traffic","visibility","keywords","found on google"]},{id:"services",strong:["services","what do you offer","what can you do","what do you do"],weak:["offer","provide","help with"]},{id:"support",strong:["support","maintenance","maintain","third party","3rd party"],weak:["fix","update","help me with my site","broken","down","not working"]},{id:"products",strong:["products","alpha systems","your systems","software","plugins","apps"],weak:["tools","solutions","what do you sell","list"]},{id:"existing_client",strong:["already a client","existing client","my project","my invoice","client lounge","my account","track my","my ticket","support ticket status","log in","login","sign in","client login","my order"],weak:["status","dashboard","portal login"]},{id:"smalltalk_bot",strong:["are you a robot","are you human","are you ai","are you real","is this a bot","are you a bot"],weak:["chatbot","automated"]},{id:"smalltalk_lang",strong:["do you speak arabic","تتكلم عربي","عربي","arabic language","speak arabic"],weak:[]},{id:"thanks",strong:["thank","thanks","shukran","appreciate"],weak:["great","awesome","perfect"]},{id:"greeting",strong:["hi","hello","hey","salam","salaam","marhaba","good morning","good evening","greetings"],weak:[]}];b.forEach(function(e){e.strong.sort(function(e,t){return t.length-e.length}),e.weak.sort(function(e,t){return t.length-e.length})});var f={contact:function(){return e=[],i.phone&&e.push("• Phone: "+i.phone),i.whatsapp&&e.push("• WhatsApp: https://wa.me/"+i.whatsapp),i.cemail&&e.push("• Email: "+i.cemail),e.length?"Here is how to reach us:\n\n"+e.join("\n")+"\n\nOr send a request right here and we will get back to you.":"You can reach the team through the contact page on this website, or send a request right here and we will get back to you.";var e},why:function(){return l},vision:function(){return r},values:function(){return u},about:function(){return s},clients:function(){return m},branding:function(){return d},websites:function(){return c},services:function(){return"Our services are:\n\n• Branding — identity, strategy, logo, colours, typography and collateral\n• Web design & development — introductory, portfolio, corporate, e-commerce and real estate sites\n• Business systems development & workflow automation — custom software, CRMs, portals, booking and approval systems, reporting and AI-powered workflows\n\nWe support everything we build; we do not take on third-party work we did not develop. Tell me what you need and I will pass it to the team."},products:function(){return"Here is what we build:\n\n• Alpha Web Portal — operations platform & CRM\n• Alpha Booking System — online bookings\n• Alpha Web Agent — AI SEO & content assistant\n• Alpha HTTPS Doctor — resolve 'not secure' sites\n• Alpha Website Health Audit — site checkups\n• Alpha Web Business Suite — invoicing & business management\n• Alpha Theme — custom WordPress themes\n• Alpha RTL Maker — polished Arabic & RTL layouts\n• Custom WooCommerce builds\n\nAsk me about any of them, or tell me what you would like built."},support:function(){return"We provide support and maintenance for everything we build for you. We do not take on third-party work we did not develop, so we can stand fully behind the quality. Would you like support on an Alpha Web build, or something new?"},seo:function(){return"Yes — SEO is part of how we build. Our websites ship clean, crawler- and AI-friendly, and SEO-ready out of the box. We also offer Alpha Web Agent, an AI assistant that writes SEO content and finds and fixes on-page SEO issues through Yoast. Would you like this for your site?"},existing_client:function(){return"If you are already a client, you can sign in to your Client Lounge at /client to track your project, invoices and support tickets. If you need anything else, I am happy to help."},smalltalk_bot:function(){return"I am Alpha Guide, an automated assistant for Alpha Web. I can answer questions about the company, our services and our products, and pass your request to the team. For anything detailed, a real person will follow up with you."},smalltalk_lang:function(){return"نعم، فريق Alpha Web يتحدث العربية والإنجليزية. Alpha Web works fully in both Arabic and English, including right-to-left websites. How may I help?"},thanks:function(){return"You are most welcome. Is there anything else I can help with?"},greeting:function(){return"Hello, and welcome. I can tell you about Alpha Web — who we are, our work, our services and systems — or take a request for something custom. How may I help?"}},v=null,k=[];"loading"===document.readyState?document.addEventListener("DOMContentLoaded",B):B()}function A(){e.scrollTop=e.scrollHeight}function W(t,n){var a=document.createElement("div");a.className="a-row "+("user"===t?"user":"");var o=document.createElement("div");o.className="user"===t?"a-user":"a-bot",o.textContent=n,a.appendChild(o),e.appendChild(a),A()}function I(t,n){var a=document.createElement("div");a.className="a-row";var o=document.createElement("div");o.className="a-bot a-typing",o.innerHTML='<span class="a-d"></span><span class="a-d"></span><span class="a-d"></span>',a.appendChild(o),e.appendChild(a),A();var i=Math.min(400+4*t.length,1100);window.setTimeout(function(){o.classList.remove("a-typing"),o.textContent=t,A(),n&&function(e){if(!e)return;var t="product"===e.type?"product":e.id;E(w[t])}(n)},i)}function E(t){if(t&&t.length){var n=document.createElement("div");n.className="a-quick",t.forEach(function(e){var t=document.createElement("button");t.type="button",t.textContent=e,t.onclick=function(){n.remove(),L(e)},n.appendChild(t)}),e.appendChild(n),A()}}function S(){t.style.display="none";var n=document.createElement("div");n.className="a-form",n.innerHTML='<h4>Tell us about your project</h4><input id="rf-name" type="text" placeholder="Your name" maxlength="120" /><input id="rf-contact" type="text" placeholder="Email or phone" maxlength="160" /><textarea id="rf-details" placeholder="What would you like us to build?" maxlength="4000"></textarea><input class="a-hp" id="rf-website" type="text" tabindex="-1" autocomplete="off" aria-hidden="true" placeholder="Leave this empty" /><div class="btns"><button class="a-send-req" id="rf-send" type="button">Send request</button><button class="a-cancel" id="rf-cancel" type="button">Cancel</button></div>',e.appendChild(n),A(),document.getElementById("rf-cancel").onclick=function(){n.remove(),t.style.display="flex"},document.getElementById("rf-send").onclick=function(){var e=this,a=document.getElementById("rf-name").value.trim(),o=document.getElementById("rf-contact").value.trim(),s=document.getElementById("rf-details").value.trim(),r=document.getElementById("rf-website").value;if(a&&o&&s){e.disabled=!0,e.textContent="Sending…";var l=new URLSearchParams;l.append("action","alpha_guide_request"),l.append("nonce",i.nonce||""),l.append("name",a),l.append("contact",o),l.append("details",s),l.append("website",r),l.append("topic",v&&v.label?v.label:""),l.append("page_url",location.href),fetch(i.ajax,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l.toString()}).then(function(e){return e.json()}).then(function(e){n.remove(),t.style.display="flex",W("user","Project request: "+s),W("bot",(e&&e.data&&e.data.message?e.data.message:"Thank you. Your request has been sent and we will be in touch shortly.")+" Is there anything else I can help with?")}).catch(function(){e.disabled=!1,e.textContent="Send request",W("bot","I could not send that just now. Please check your connection and try again, or contact us directly.")})}}}function x(e,t){if(e===t)return 0;var n=e.length,a=t.length;if(Math.abs(n-a)>2)return 3;var o,i,s=[],r=[];for(i=0;i<=a;i++)s[i]=i;for(o=1;o<=n;o++){for(r[0]=o,i=1;i<=a;i++){var l=e.charAt(o-1)===t.charAt(i-1)?0:1;r[i]=Math.min(s[i]+1,r[i-1]+1,s[i-1]+l)}for(i=0;i<=a;i++)s[i]=r[i]}return s[a]}function T(e,t,n){if(t.indexOf(n)>-1)return!0;if(n.indexOf(" ")>-1||n.length<4)return!1;for(var a=n.length>=7?2:1,o=0;o<e.length;o++){var i=e[o];if(!(i.length<4)&&(!(Math.abs(i.length-n.length)>a)&&x(i,n)<=a))return!0}return!1}function C(e,t,n){var a,o=0;for(a=0;a<n.strong.length;a++)T(e,t,n.strong[a])&&(o+=10+n.strong[a].length);for(a=0;a<n.weak.length;a++)T(e,t,n.weak[a])&&(o+=3);return o}function q(e){var t=" "+e.toLowerCase().trim()+" ",n=e.toLowerCase().replace(/[^a-z0-9\u0600-\u06FF ]/g," ").split(/\s+/).filter(Boolean);if(!/\b(already (a|your) client|existing client|my (project|invoice|ticket|account|order)|client lounge|sign in|log in|login)\b/.test(t)){if(/\b(tell me more|more info|more detail|go on|what about (it|that|this)|and that|continue|explain more)\b/.test(t)){var a=v?"product"===v.type?"Happy to go further. We tailor "+v.label+" to each business, so the best next step is a quick chat about your needs. Shall I take a few details for the team?":"websites"===v.id?c:"branding"===v.id?d:"clients"===v.id?m:null:null;if(a)return void I(a)}if(v&&/\b(price|pricing|cost|how much|quote)\b/.test(t)&&/\b(it|that|this|for that)\b/.test(t))return I("For "+(v.label||"that")+", pricing depends on your exact requirements. Let me take a few details and the team will come back to you with a tailored quote."),void window.setTimeout(S,400);var o=function(e,t){var n,a,o,i=null,s=0;for(n=0;n<h.length;n++){for(o=0,a=0;a<h[n].triggers.length;a++)T(e,t,h[n].triggers[a])&&(o+=10+h[n].triggers[a].length);o>s&&(s=o,i=h[n])}return s>0?{id:i.id,answer:i.answer,score:s}:null}(n,t),i=o?o.score:0,s=function(e,t){var n,a,o=null,i=0;for(n=0;n<b.length;n++)(a=C(e,t,b[n]))>i&&(i=a,o=b[n]);return i>0?{id:o.id,score:i}:null}(n,t),r=s?s.score:0;return s&&"request"===s.id&&r>=i?(v={type:"intent",id:"request"},I("I would be glad to help with that. Let me take a few details and send them to the team, and we will get back to you to discuss building it for you."),void window.setTimeout(S,400)):o&&i>=r?(v={type:"product",id:o.id,label:p[o.id]||"this"},void I(o.answer+"\n\nWould you like this for your business, or do you have a custom variation in mind? Just let me know.",v)):s&&f[s.id]?(v={type:"intent",id:s.id,label:s.id},void I(f[s.id](),v)):void I("I may have missed that. I can tell you about Alpha Web — our story, vision, values and clients — our services (branding, websites, business systems), and our products (Portal, Booking, Web Agent, HTTPS Doctor, Health Audit, Business Suite, Theme, RTL Maker). You can also ask how to contact us, or tell me what you would like built.")}I("If you are already a client, you can sign in to your Client Lounge at /client to track your project, invoices and support tickets. If you need anything else, I am happy to help.")}function L(t){(t=(t||"").trim())&&(W("user",t),n.value="",k.push({role:"user",content:t}),i.ai?function(t){if(n=t,/\b(get a quote|request a quote|submit (a )?request|leave (my )?details|start (a )?project|contact me|call me back)\b/i.test(n))return I("Of course. Let me take a few details and the team will get back to you."),void window.setTimeout(S,400);var n;var a=document.createElement("div");a.className="a-row";var o=document.createElement("div");o.className="a-bot a-typing",o.innerHTML='<span class="a-d"></span><span class="a-d"></span><span class="a-d"></span>',a.appendChild(o),e.appendChild(a),A();var s=new URLSearchParams;s.append("action","alpha_guide_chat"),s.append("nonce",i.nonce||""),s.append("messages",JSON.stringify(k.slice(-6))),fetch(i.ajax,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()}).then(function(e){return e.json()}).then(function(e){e&&e.success&&e.data&&e.data.reply?(o.classList.remove("a-typing"),o.textContent=e.data.reply,k.push({role:"assistant",content:e.data.reply}),A()):(a.remove(),q(t))}).catch(function(){a.remove(),q(t)})}(t):q(t))}function O(){a.classList.add("open"),a.setAttribute("aria-hidden","false"),y||(y=!0,function(){try{return"1"===sessionStorage.getItem("alphaGuideSeen")}catch(e){return!1}}()?I("Welcome back. How may I help — websites, business systems, or branding?"):(I("Hello, I am Alpha Guide. I can tell you about Alpha Web — who we are, our vision, our work and the clients we have served — our services in branding, websites and business systems, and our Alpha products. I can also take your request for something custom. How may I help?"),function(){try{sessionStorage.setItem("alphaGuideSeen","1")}catch(e){}}()),E(g)),n.focus()}function P(){a.classList.remove("open"),a.setAttribute("aria-hidden","true")}function B(){var i=0;!function s(){if(document.getElementById("alpha-launch"))return e=document.getElementById("alpha-body"),t=document.getElementById("alpha-inputbar"),n=document.getElementById("alpha-input"),a=document.getElementById("alpha-window"),o=document.getElementById("alpha-launch"),void(a&&o&&(o.parentNode!==document.body&&document.body.appendChild(o),a.parentNode!==document.body&&document.body.appendChild(a),o.onclick=function(){a.classList.contains("open")?P():O()},document.getElementById("alpha-close").onclick=P,document.getElementById("alpha-send").onclick=function(){L(n.value)},n.addEventListener("keydown",function(e){"Enter"===e.key&&L(n.value)})));i++<10&&window.setTimeout(s,300)}()}}();