function M(){function n(t,o){return`<span class="w-12 h-12 rounded-xl grid place-items-center shrink-0" style="background:${t};">
          <svg viewBox="0 0 32 32" class="w-7 h-7">${o}</svg>
        </span>`}const d=`
        <path fill="#7F54B3" d="M2 6.5C2 5.1 3.1 4 4.5 4h23A2.5 2.5 0 0 1 30 6.5v13a2.5 2.5 0 0 1-2.5 2.5H17l-6 5 1.5-5H4.5A2.5 2.5 0 0 1 2 19.5v-13z"/>
        <path fill="#fff" d="M5.4 9.5c.4-.1.8 0 1 .3.2.3.2.7.1 1.1-.5 2-.9 3.7-1.1 5l1.3-2.5c.3-.5.6-.8.9-.8.5-.1.8.2.9.9.1 1 .2 1.8.4 2.6.2-1.7.5-3 .9-3.7.1-.3.4-.5.7-.5.2 0 .5.1.6.2.2.2.3.4.3.6 0 .2 0 .4-.1.5-.3.5-.5 1.4-.7 2.6-.2 1.2-.3 2.1-.3 2.7 0 .2 0 .4-.1.5-.1.2-.3.3-.5.3-.3 0-.5-.1-.8-.4-.8-.8-1.5-2-2-3.6-.6 1.2-1 2.1-1.3 2.7-.5 1-1 1.5-1.4 1.6-.3 0-.5-.2-.7-.7-.5-1.4-1-4-1.6-7.9 0-.4.2-.8.6-.9zm21 1.7c-.4-.7-.9-1.1-1.6-1.3-.2 0-.4-.1-.5-.1-.9 0-1.7.5-2.3 1.4-.5.8-.7 1.7-.7 2.7 0 .7.2 1.4.5 1.9.4.7.9 1.1 1.6 1.3.2 0 .4.1.5.1.9 0 1.7-.5 2.3-1.4.5-.8.7-1.7.7-2.7 0-.8-.2-1.4-.5-1.9zm-1.2 2.6c-.1.7-.4 1.2-.8 1.5-.3.3-.6.4-.9.3-.3-.1-.5-.3-.6-.7-.1-.3-.2-.6-.2-.9 0-.3 0-.5.1-.7.1-.4.3-.8.5-1.2.3-.5.7-.7 1-.6.3.1.5.3.6.7.1.3.2.6.2.9 0 .2 0 .4 0 .7zm-6.4-2.6c-.4-.7-.9-1.1-1.6-1.3-.2 0-.4-.1-.5-.1-.9 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2.5.2 2.5.2z"/>`,h=`
        <path fill="#0F9D58" d="M19 3H7C5.9 3 5 3.9 5 5v22c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V11l-8-8z"/>
        <path fill="#87CEAC" d="M19 3v6c0 1.1.9 2 2 2h6l-8-8z"/>
        <path fill="#fff" d="M22 16H10v9h12v-9zm-1 8h-3.5v-1.5H21V24zm0-2.5h-3.5V20H21v1.5zm0-2.5h-3.5v-1.5H21V19zm-4.5 5H13v-1.5h3.5V24zm0-2.5H13V20h3.5v1.5zm0-2.5H13v-1.5h3.5V19z"/>`,f=`
        <path fill="#25D366" d="M16 3C8.8 3 3 8.8 3 16c0 2.6.8 5 2.1 7L3 29l6.2-2c1.9 1 4.1 1.6 6.4 1.6h.4c7.2 0 13-5.8 13-13S23.2 3 16 3z"/>
        <rect x="9" y="9.5" width="14" height="13" rx="1" fill="#fff"/>
        <path stroke="#25D366" stroke-width="1.6" stroke-linecap="round" d="M11.5 13.5h9M11.5 16h9M11.5 18.5h6"/>`,m=`
        <path fill="#128C7E" d="M16 3C8.8 3 3 8.8 3 16c0 2.6.8 5 2.1 7L3 29l6.2-2c1.9 1 4.1 1.6 6.4 1.6h.4c7.2 0 13-5.8 13-13S23.2 3 16 3z"/>
        <path fill="#fff" d="M9 12h14l-1 2.5c-.2.5-.7.8-1.2.8h-9.6c-.5 0-1-.3-1.2-.8L9 12z"/>
        <rect x="10.5" y="15.8" width="11" height="7.7" rx="0.6" fill="#fff"/>
        <rect x="13" y="18.3" width="3" height="5.2" fill="#128C7E"/>
        <path fill="#fff" d="M9 11.5l1-2.5h12l1 2.5z"/>`,g=`
        <path d="M16 11v6M11 17l5-2 5 2" stroke="#FF7A59" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
        <circle cx="16" cy="8"  r="3" fill="#FF7A59"/>
        <circle cx="8"  cy="19" r="3" fill="#FF7A59"/>
        <circle cx="24" cy="19" r="3" fill="#FF7A59"/>`,u=`
        <rect x="6" y="9" width="20" height="17" rx="2" fill="#4285F4"/>
        <rect x="6" y="9" width="20" height="5" fill="#1A73E8"/>
        <rect x="9" y="6" width="2" height="6" rx="1" fill="#1A73E8"/>
        <rect x="21" y="6" width="2" height="6" rx="1" fill="#1A73E8"/>
        <text x="16" y="22" text-anchor="middle" fill="#fff" font-family="Arial" font-size="9" font-weight="bold">31</text>`,a=window.WADESK_BRAND&&window.WADESK_BRAND.appName||"WaDesk",w=[{id:"shopify",name:"Shopify",cat:"ecom",desc:"Sync orders, customers, abandoned carts and product catalog into "+a+" chats.",tile:n("#F1F9EC",p),connected:!!window.SHOPIFY_CONNECTED,official:!0},{id:"woocommerce",name:"WooCommerce",cat:"ecom",desc:"Pull WooCommerce orders into chat threads — confirm, ship, and refund without leaving "+a+".",tile:n("#F3ECFA",d),connected:!!window.WOOCOMMERCE_CONNECTED,official:!0},{id:"wa-catalog",name:"WhatsApp Catalog",cat:"ecom",desc:"Push products to Meta’s Commerce Catalog so buyers browse them inside WhatsApp — SPM, MPM, carousels, orders.",tile:n("#E7FFDB",f),connected:!!window.WA_CATALOG_CONNECTED,official:!1},{id:"wa-store",name:"WhatsApp Store",cat:"ecom",desc:"A full storefront inside WhatsApp — browse, add to cart, and pay without leaving the chat.",tile:n("#E0F4F1",m),connected:!1,official:!1,multi:!0},{id:"gsheets",name:"Google Sheets",cat:"productivity",desc:"Edit your shop catalog in a Google Sheet — add a row, tweak a price, click Sync. Every change goes live on your storefront.",tile:n("#E8F5E9",h),connected:!!window.GSHEETS_CONNECTED,official:!1},{id:"hubspot",name:"HubSpot CRM",cat:"crm",desc:"Push contacts and deals into HubSpot whenever a "+a+" conversation triggers an event — new chat, order placed, SKU of interest.",tile:n("#FFE4D6",g),connected:!!window.HUBSPOT_CONNECTED,official:!0},{id:"gcal",name:"Google Calendar",cat:"productivity",desc:"Let customers book appointments inside WhatsApp. "+a+" reads your availability and writes confirmed bookings straight to your calendar.",tile:n("#E8F0FE",u),connected:!!window.GCAL_CONNECTED,official:!0}];let l="all",i="";const x={all:"All integrations",ecom:"E-commerce",productivity:"Productivity",crm:"CRM"};function v(){return w.filter(t=>{const o=l==="all"||t.cat===l,e=i.trim().toLowerCase(),c=!e||t.name.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e);return o&&c})}function r(){const t=v(),o=document.getElementById("grid");o.innerHTML="",t.forEach(e=>{const c=document.createElement("div");c.className="bg-paper-0 border border-paper-200 rounded-[14px] p-4 shadow-card hover:border-wa-deep hover:shadow-soft transition flex flex-col";const b=`
              <span class="inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-[10px] font-mono bg-wa-mint text-wa-deep border border-wa-green/40">
                <span class="w-1.5 h-1.5 rounded-full bg-wa-green"></span>Connected
              </span>`,C=`
              <a href="${e.id==="shopify"?"/shopify":e.id==="woocommerce"?"/woocommerce":e.id==="hubspot"?"/hubspot":e.id==="gcal"?"/appointments":e.id==="gsheets"?"/sheets-addon":e.id==="wa-catalog"?"/catalog":`/connect?platform=${e.id}&mode=manage`}" class="px-3 py-1.5 rounded-full bg-paper-0 border border-paper-200 hover:bg-paper-50 text-[11.5px] font-medium inline-flex items-center gap-1.5">
                <svg viewBox="0 0 16 16" class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M3 8h10M9 4l4 4-4 4"/></svg>
                Manage
              </a>
              <button class="w-8 h-8 rounded-full border border-paper-200 bg-paper-0 hover:bg-paper-50 grid place-items-center" title="Settings">
                <svg viewBox="0 0 16 16" class="w-3.5 h-3.5 text-ink-700" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="2"/><path d="M13 8a5 5 0 0 0-.1-1.1l1.4-1-1.5-2.6-1.6.7a5 5 0 0 0-1.9-1.1L9 1H7l-.3 1.9a5 5 0 0 0-1.9 1.1l-1.6-.7-1.5 2.6 1.4 1A5 5 0 0 0 3 8c0 .4 0 .7.1 1.1l-1.4 1 1.5 2.6 1.6-.7a5 5 0 0 0 1.9 1.1L7 15h2l.3-1.9a5 5 0 0 0 1.9-1.1l1.6.7 1.5-2.6-1.4-1c.1-.4.1-.7.1-1.1Z"/></svg>
              </button>`,s=window.WA_STORE_SHOPS&&window.WA_STORE_SHOPS.length||0,E=e.id==="wa-store"&&s>0,y=e.id==="gsheets"?"/sheets-addon":e.id==="wa-catalog"?"/catalog":e.id==="shopify"?"/shopify":e.id==="woocommerce"?"/woocommerce":e.id==="hubspot"?"/hubspot":e.id==="gcal"?"/appointments/settings":`/connect?platform=${e.id}`,S=E?`
              <a href="/connect?platform=wa-store" class="ml-auto px-3 py-1.5 rounded-full bg-paper-0 border border-paper-200 hover:bg-paper-50 text-[11.5px] font-medium inline-flex items-center gap-1.5">
                <svg viewBox="0 0 16 16" class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M3 8h10M9 4l4 4-4 4"/></svg>
                View shops <span class="font-mono text-[10px] opacity-70">(${s})</span>
              </a>
              <a href="/connect?platform=wa-store&action=add" class="px-3 py-1.5 rounded-full bg-wa-deep hover:bg-wa-teal text-paper-0 text-[11.5px] font-semibold inline-flex items-center gap-1.5">
                <svg viewBox="0 0 16 16" class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3v10M3 8h10"/></svg>
                Add shop
              </a>`:`
              <a href="${y}" class="ml-auto px-4 py-2 rounded-full bg-wa-deep hover:bg-wa-teal text-paper-0 text-[12px] font-semibold inline-flex items-center gap-1.5">
                <svg viewBox="0 0 16 16" class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 8h10M9 4l4 4-4 4"/></svg>
                ${e.id==="gsheets"||e.id==="wa-catalog"?"Set up":"Connect now"}
              </a>`;c.innerHTML=`
            <div class="flex items-start justify-between gap-3">
              ${e.tile}
              ${e.connected?b:""}
            </div>
            <div class="mt-3 flex items-center gap-1.5 flex-wrap">
              <h3 class="font-semibold text-[16px] leading-tight">${e.name}</h3>
              ${e.official?'<span class="text-[9px] font-mono px-1.5 py-0.5 rounded bg-paper-50 text-ink-700 border border-paper-200">OFFICIAL</span>':""}
            </div>
            <p class="mt-1.5 text-[12px] text-ink-500 leading-snug flex-1">${e.desc}</p>
            <div class="mt-4 pt-3 border-t border-paper-200 flex items-center justify-between gap-2">
              ${e.connected?C:S}
            </div>`,o.appendChild(c)}),document.getElementById("empty").classList.toggle("hidden",t.length>0),document.getElementById("grid-title").textContent=x[l],document.getElementById("grid-count").textContent=t.length+" app"+(t.length===1?"":"s")}document.querySelectorAll("#cat-tabs .cat-tab").forEach(t=>t.addEventListener("click",()=>{document.querySelectorAll("#cat-tabs .cat-tab").forEach(o=>{o.classList.remove("bg-wa-deep","text-paper-0"),o.classList.add("text-ink-600","hover:bg-paper-100")}),t.classList.add("bg-wa-deep","text-paper-0"),t.classList.remove("text-ink-600","hover:bg-paper-100"),l=t.dataset.cat,r()})),document.getElementById("search").addEventListener("input",t=>{i=t.target.value,r()}),r()}export{M as default};
