PageSourceSearch

https://leadsflyer.com/_next/static/chunks/pages/commerce-fab7afc2a72eae0b.js

js leadsflyer.com collected 2026-10-02 01:34:53 UTC 158,485 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4815],{3133:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/commerce",function(){return s(7633)}])},7633:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return m}});var c=s(5893),t=s(645),r=s.n(t),o=s(1664),l=s.n(o),n=s(9008),i=s.n(n),d=s(7294),x=s(1163),b=s(610),p=s(7828);let f="https://api.leadsflyer.com";function m(){var e,a,s,t,o,n,m,u,j,h,g,y,N,v,k,w,S,_,D,C,z,R,W;let A=(0,x.useRouter)(),[E,I]=(0,d.useState)(!1),[T,B]=(0,d.useState)("dashboard"),[P,O]=(0,d.useState)(!1),[L,F]=(0,d.useState)([]),[M,U]=(0,d.useState)([]),[V,G]=(0,d.useState)([]),[H,q]=(0,d.useState)([]),[J,Y]=(0,d.useState)([]),[Q,$]=(0,d.useState)(!1),[K,X]=(0,d.useState)(!1),[Z,ee]=(0,d.useState)(""),[ea,es]=(0,d.useState)(""),[ec,et]=(0,d.useState)(!1),[er,eo]=(0,d.useState)(""),[el,en]=(0,d.useState)("UTILITY"),[ei,ed]=(0,d.useState)(!1),[ex,eb]=(0,d.useState)(!1),[ep,ef]=(0,d.useState)(!1),[em,eu]=(0,d.useState)(!1),[ej,eh]=(0,d.useState)(!1),[eg,ey]=(0,d.useState)(null),[eN,ev]=(0,d.useState)(""),[ek,ew]=(0,d.useState)("30"),[eS,e_]=(0,d.useState)("all"),[eD,eC]=(0,d.useState)(""),[ez,eR]=(0,d.useState)(""),[eW,eA]=(0,d.useState)(null),[eE,eI]=(0,d.useState)(!1),[eT,eB]=(0,d.useState)(null),[eP,eO]=(0,d.useState)({announcement:"⚡ Free Express Delivery on all orders | 100% Quality Guaranteed",brand_color:"#10b981",enable_cod:!0,enable_online_payment:!0,enable_whatsapp_order:!0,support_phone:""}),[eL,eF]=(0,d.useState)(!1),[eM,eU]=(0,d.useState)(!1),[eV,eG]=(0,d.useState)(""),[eH,eq]=(0,d.useState)(""),[eJ,eY]=(0,d.useState)(!1),[eQ,e$]=(0,d.useState)(!1),[eK,eX]=(0,d.useState)(null),eZ=e=>{let a=String(e||"USD").toUpperCase();return"INR"===a?"₹":"EUR"===a?"€":"GBP"===a?"\xa3":"$"},e1=(0,d.useMemo)(()=>V.reduce((e,a)=>e+Number(a.total_price||0),0).toFixed(2),[V]),e2=(0,d.useMemo)(()=>{let e=new Date().toDateString();return V.filter(a=>new Date(a.created_at).toDateString()===e).length},[V]),e6=(0,d.useMemo)(()=>0===V.length?"0.00":(.3*V.reduce((e,a)=>e+Number(a.total_price||0),0)).toFixed(2),[V]),e0=(0,d.useMemo)(()=>0===V.length?"0.00":(.2*V.reduce((e,a)=>e+Number(a.total_price||0),0)).toFixed(2),[V]),e4=(0,d.useMemo)(()=>2*V.length,[V]),e5=(0,d.useMemo)(()=>J.filter(e=>"failed"===e.status||"error"===e.status).length,[J]),[e8,e3]=(0,d.useState)({enableEvents:!0,language:"en_US",currency:"USD",timezone:"America/New_York",defaultWhatsAppNumber:""}),e9=L&&L.length>0,e7=eZ((null===(e=L[0])||void 0===e?void 0:e.currency)||e8.currency||"USD");async function ae(){try{let e=await (0,b.S)("/shopify/addon/status");eA(e)}catch(e){console.warn("Could not fetch addon status:",e)}}async function aa(){try{eI(!0),eR("");let e=await (0,b.S)("/shopify/addon/subscribe",{method:"POST",body:JSON.stringify({shop_domain:(null==eW?void 0:eW.store_domain)||""})});if(e.confirmationUrl)window.location.href=e.confirmationUrl;else throw Error(e.error||"Failed to generate Shopify approval link.")}catch(e){eR(e.message||"Failed to activate Shopify Add-On."),eI(!1)}}(0,d.useEffect)(()=>{ae();{let e=localStorage.getItem("leadsflyer_commerce_settings");if(e)try{e3(JSON.parse(e))}catch(e){console.error("Failed to parse saved settings:",e)}}},[]),(0,d.useEffect)(()=>{eC(""),eR("")},[T]),(0,d.useEffect)(()=>{if("success"===A.query.addon&&(eC("Shopify E-Commerce Add-On has been activated successfully!"),ae()),eD){let e=setTimeout(()=>{eC("")},4e3);return()=>clearTimeout(e)}},[eD]),(0,d.useEffect)(()=>{if(ez){let e=setTimeout(()=>{eR("")},4e3);return()=>clearTimeout(e)}},[ez]);let[as,ac]=(0,d.useState)({"customer.created":!0,"customer.updated":!1,"order.created":!0,"order.updated":!0,"order.cancelled":!0,"order.refunded":!1,"order.fulfilled":!0,"order.delivered":!0,"payment.pending":!1,"payment.success":!0,"payment.failed":!0,"product.created":!1,"product.updated":!1,"inventory.updated":!1,"cart.abandoned":!0,backinstock:!1,"review.request":!0}),[at,ar]=(0,d.useState)([]),[ao,al]=(0,d.useState)(null),[an,ai]=(0,d.useState)([]),[ad,ax]=(0,d.useState)(""),[ab,ap]=(0,d.useState)({}),[af,am]=(0,d.useState)([]),[au,aj]=(0,d.useState)([]),[ah,ag]=(0,d.useState)(null),[ay,aN]=(0,d.useState)(!1),[av,ak]=(0,d.useState)("shopify"),[aw,aS]=(0,d.useState)(""),[a_,aD]=(0,d.useState)("");async function aC(e){e.preventDefault();let a=eN.trim().toLowerCase();if(!a){eR("Store domain or URL is required.");return}a=a.replace(/^https?:\/\//,"").split("/")[0];try{eR(""),eC("Redirecting to WooCommerce store authorization...");let e=await (0,b.S)("/shopify/woocommerce/auth?shop=".concat(encodeURIComponent(a)));if(e.authUrl)window.location.href=e.authUrl;else throw Error("Authorization URL could not be generated.")}catch(e){eR(e.message||"Failed to initiate WooCommerce store authorization.")}}async function az(e){if(e)try{eF(!0),eq("");let a=await (0,b.S)("/shopify/storefront-settings?store_id=".concat(e));a&&a.success&&a.settings&&eO({announcement:a.settings.announcement||"⚡ Free Express Delivery on all orders | 100% Quality Guaranteed",brand_color:a.settings.brand_color||"#10b981",enable_cod:!1!==a.settings.enable_cod,enable_online_payment:!1!==a.settings.enable_online_payment,enable_whatsapp_order:!1!==a.settings.enable_whatsapp_order,support_phone:a.settings.support_phone||""})}catch(e){console.error("Failed to load storefront settings:",e)}finally{eF(!1)}}async function aR(e){if(e&&e.preventDefault&&e.preventDefault(),!eT){eq("Please select a connected store first.");return}try{eU(!0),eG(""),eq("");let e=await (0,b.S)("/shopify/storefront-settings",{method:"POST",body:JSON.stringify({store_id:eT,announcement:eP.announcement,brand_color:eP.brand_color,enable_cod:eP.enable_cod,enable_online_payment:eP.enable_online_payment,enable_whatsapp_order:eP.enable_whatsapp_order,support_phone:eP.support_phone})});if(e&&e.success)eG("\uD83C\uDF89 WhatsApp Storefront settings updated and live immediately!"),setTimeout(()=>eG(""),4500);else throw Error((null==e?void 0:e.error)||"Failed to update storefront settings.")}catch(e){eq(e.message||"Failed to save storefront settings.")}finally{eU(!1)}}async function aW(){try{O(!0);let e=(await (0,b.S)("/shopify/stores")).stores||[];F(e),e.length>0&&!eT&&(eB(e[0].id),az(e[0].id)),aI(),aA(),aE(),aT()}catch(e){eR(e.message||"Failed to load store list.")}finally{O(!1)}}async function aA(){try{eb(!0);let e=await (0,b.S)("/api/v1/customers");U(e.customers||[])}catch(e){console.error("Failed to load e-commerce customers",e)}finally{eb(!1)}}async function aE(){try{ef(!0);let e=await (0,b.S)("/api/v1/orders");G(e.orders||[])}catch(e){console.error("Failed to load e-commerce orders",e)}finally{ef(!1)}}async function aI(){try{ed(!0);let e=await (0,b.S)("/api/v1/products");q(e.products||[])}catch(e){console.error("Failed to load e-commerce products",e)}finally{ed(!1)}}async function aT(){try{eu(!0);let e=await (0,b.S)("/shopify/sync-logs");Y(e.logs||[])}catch(e){console.error("Failed to load sync logs",e)}finally{eu(!1)}}async function aB(){try{let e=await (0,b.S)("/smart-followup-flows");ar(e.flows||[])}catch(e){console.error("Failed to load flows:",e)}}async function aP(){try{let e=await (0,b.S)("/smart-followup/whatsapp-channel-status");al(e)}catch(e){console.error(e)}}async function aO(){try{let e=await (0,b.S)("/whatsapp-meta/templates").catch(()=>({templates:[]}));ai(e.templates||[])}catch(e){console.error(e)}}(0,d.useEffect)(()=>{let e=(0,p.LP)();if(!e){A.replace("/login");return}try{let[,a]=String(e).split(".");JSON.parse(window.atob(a.replace(/-/g,"+").replace(/_/g,"/"))),e?I(!0):A.replace("/login")}catch(e){A.replace("/dashboard?access=denied")}},[A]),(0,d.useEffect)(()=>{E&&("products"===T?aI():"customers"===T?aA():"orders"===T?aE():"logs"===T?aT():"stores"===T?aW():"dashboard"===T&&(aW(),aT(),aA(),aE(),aI()))},[T,E]),(0,d.useEffect)(()=>
1{if(E){if(aW(),aT(),aA(),aE(),aI(),aB(),aP(),aO(),A.query.shop&&!A.query.success&&!A.query.error){let e=String(A.query.shop).trim().toLowerCase();if((e=e.replace(/\s+/g,".").replace(/^https?:\/\//,"").replace(/\/.*$/,"").trim()).includes(".")||(e="".concat(e,".myshopify.com")),e.endsWith(".myshopify.com")){eC("Connecting to Shopify OAuth authorization...");let a=(0,p.LP)()||"";window.location.href="".concat(f,"/shopify/auth?shop=").concat(encodeURIComponent(e),"&redirect=true&token=").concat(encodeURIComponent(a))}}"true"===A.query.success?(eC("Connected store ".concat(A.query.shop||""," successfully!")),A.replace("/commerce",void 0,{shallow:!0})):A.query.error&&(eR("Auth error: ".concat(decodeURIComponent(A.query.error))),A.replace("/commerce",void 0,{shallow:!0}))}},[E,A.query]);let aL=L.find(e=>String(e.id)===String(ad));async function aF(e){if(e)try{let a=await (0,b.S)("/shopify/automation-rules?platform_user_id=".concat(e));am(a.rules||[]),aj(a.queue||[])}catch(e){console.error("Failed to load automation rules:",e)}}async function aM(){es(""),ee("");let e=String(er||(null==ah?void 0:ah.rule_key)||(null==ah?void 0:ah.name)||"template").toLowerCase().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").trim();if(!e){es("Template name is required (lowercase letters, numbers, and underscores).");return}if(!(null==ah?void 0:ah.message_template)||!ah.message_template.trim()){es("Message text is required to submit a template.");return}$(!0);try{let a=new FormData;a.append("name",e),a.append("category",el||"UTILITY"),a.append("language","en_US");let s=ah.message_template.trim();/\{\{\s*([^{}]+)\s*\}\}\s*$/.test(s)&&(s=s.trimEnd()+" before stocks run out."),a.append("body",s),a.append("headerType",ah.has_media_header?"image":"none"),a.append("mode","submit"),ah.media_url&&a.append("sample_media_url",ah.media_url);let c=await (0,b.S)("/whatsapp-meta/templates",{method:"POST",body:a}),t=c.template,r=(null==t?void 0:t.status)||(c.already_exists?"APPROVED":"PENDING");await aO(),ag(a=>({...a,meta_template_name:e,selected_template_status:r})),"APPROVED"===r?ee('\uD83C\uDF89 Template "'.concat(e,'" is APPROVED by Meta and selected for this automation!')):ee('⏳ Template "'.concat(e,'" submitted to Meta for approval! Status: PENDING review.')),et(!1)}catch(e){es(e.message||"Failed to submit template to Meta for approval.")}finally{$(!1)}}async function aU(){X(!0),es("");try{let e=(await (0,b.S)("/whatsapp-meta/templates/sync",{method:"POST"})).templates||[];ai(e);let a=(null==ah?void 0:ah.meta_template_name)||er,s=e.find(e=>e.name===a);if(s){let e=s.status||"APPROVED";ag(a=>({...a,meta_template_name:s.name,selected_template_status:e})),"APPROVED"===e?ee('\uD83C\uDF89 Template "'.concat(s.name,'" is APPROVED by Meta and automatically selected for this automation!')):"PENDING"===e?ee('⏳ Template "'.concat(s.name,'" is still pending Meta review. Meta review usually completes within a few minutes.')):"REJECTED"===e&&(ee(""),es("❌ Template was rejected by Meta (".concat(s.rejected_reason||"INVALID_FORMAT",'). Please click "Retry Meta Approval" below to re-submit.')))}else ee("Meta template statuses synced from Meta API.")}catch(e){es(e.message||"Failed to sync status with Meta API.")}finally{X(!1)}}async function aV(e){try{await (0,b.S)("/shopify/automation-rules/save",{method:"POST",body:JSON.stringify({...e,platform_user_id:Number(ad)})}),eC("E-Commerce Automation Rule updated successfully!"),ad&&aF(ad),ag(null)}catch(e){eR(e.message||"Failed to update automation rule.")}}async function aG(e){try{ey(e),eC("Synch queued in background. Data logs will update soon."),eR(""),await (0,b.S)("/shopify/sync",{method:"POST",body:JSON.stringify({platformUserId:e,days:ek,syncType:eS})}),setTimeout(()=>{aW(),aT(),aA(),aE(),aI(),ey(null)},3e3)}catch(e){eR(e.message||"Failed to schedule manual sync."),ey(null)}}async function aH(e){if(confirm("Are you sure you want to disconnect this store? Webhooks updates will cease."))try{eR(""),await (0,b.S)("/shopify/stores/disconnect",{method:"POST",body:JSON.stringify({platformUserId:e})}),eC("Store disconnected."),aW()}catch(e){eR(e.message||"Failed to disconnect store.")}}return(0,d.useEffect)(()=>
1{if(aL)try{ap(aL.trigger_flows_json?JSON.parse(aL.trigger_flows_json):{})}catch(e){ap({})}else L.length>0&&!ad&&ax(String(L[0].id));ad&&aF(ad)},[ad,aL,L,T]),(0,d.useEffect)(()=>{if(!ah)return;let e=ah.meta_template_name;if(!e)return;let a=an.find(a=>a.name===e);if("PENDING"===(a?a.status||"APPROVED":ah.selected_template_status)){let a=setInterval(async()=>{try{let s=(await (0,b.S)("/whatsapp-meta/templates/sync",{method:"POST"})).templates||[];ai(s);let c=s.find(a=>a.name===e);c&&"APPROVED"===c.status?(ag(e=>({...e,meta_template_name:c.name,selected_template_status:"APPROVED"})),ee('\uD83C\uDF89 Template "'.concat(c.name,'" has just been APPROVED by Meta and automatically selected!')),es(""),clearInterval(a)):c&&"REJECTED"===c.status&&(ag(e=>({...e,meta_template_name:c.name,selected_template_status:"REJECTED"})),ee(""),es("❌ Template was rejected by Meta (".concat(c.rejected_reason||"INVALID_FORMAT",'). Please click "Retry Meta Approval" below to re-submit.')),clearInterval(a))}catch(e){}},12e3);return()=>clearInterval(a)}},[null==ah?void 0:ah.meta_template_name,null==ah?void 0:ah.selected_template_status,an]),E?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i(),{children:(0,c.jsx)("title",{className:"jsx-d52c1ba2e6fc146b",children:"Commerce Module | LeadsFlyer"})}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b commerceContainer",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px"},className:"jsx-d52c1ba2e6fc146b commerceHeader",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b commerceTitle",children:[(0,c.jsx)("h1",{className:"jsx-d52c1ba2e6fc146b",children:"Commerce Module"}),(0,c.jsx)("p",{className:"jsx-d52c1ba2e6fc146b",children:"Platform-independent e-commerce integrations dashboard"})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)(l(),{href:"/membership",style:{background:"#0284c7",color:"#ffffff",padding:"9px 16px",borderRadius:"6px",fontWeight:"bold",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"6px",fontSize:"13px"},children:"\uD83D\uDED2 Shopify Plans & Billing"})})]}),eD&&(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b statusAlert success",children:eD}),ez&&(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b statusAlert error",children:ez}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b tabContainer",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b tabs",children:[(0,c.jsx)("button",{onClick:()=>
1B("dashboard"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("dashboard"===T?"active":""),children:"\uD83D\uDCCA Commerce Dashboard"}),(0,c.jsxs)("button",{onClick:()=>B("stores"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("stores"===T?"active":""),children:["\uD83C\uDFEA Stores ",L.length>0&&(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b tabBadge",children:L.length})]}),(0,c.jsxs)("button",{onClick:()=>B("customers"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("customers"===T?"active":""),children:["\uD83D\uDC65 Customers ",M.length>0&&(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b tabBadge",children:M.length})]}),(0,c.jsxs)("button",{onClick:()=>B("orders"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("orders"===T?"active":""),children:["\uD83D\uDCE6 Orders ",V.length>0&&(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b tabBadge",children:V.length})]}),(0,c.jsxs)("button",{onClick:()=>B("products"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("products"===T?"active":""),children:["\uD83C\uDFF7️ Products ",H.length>0&&(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b tabBadge",children:H.length})]}),(0,c.jsxs)("button",{onClick:()=>{B("storefront"),eT&&az(eT)},style:{display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("storefront"===T?"active":""),children:["\uD83D\uDECD️ WhatsApp Storefront ",(0,c.jsx)("span",{style:{background:"linear-gradient(135deg, #10b981, #059669)",color:"#fff",fontSize:"10px",fontWeight:"700",padding:"2px 7px",borderRadius:"999px",letterSpacing:"0.05em",boxShadow:"0 2px 6px rgba(16,185,129,0.3)"},className:"jsx-d52c1ba2e6fc146b",children:"NEW"})]}),(0,c.jsx)("button",{onClick:()=>B("automations"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("automations"===T?"active":""),children:"⚡ Automations"}),(0,c.jsx)("button",{onClick:()=>B("analytics"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("analytics"===T?"active":""),children:"\uD83D\uDCC8 Analytics"}),(0,c.jsx)("button",{onClick:()=>B("logs"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("logs"===T?"active":""),children:"\uD83D\uDCCB Sync Logs"}),(0,c.jsx)("button",{onClick:()=>B("settings"),className:"jsx-d52c1ba2e6fc146b "+"tab ".concat("settings"===T?"active":""),children:"⚙️ Settings"})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b tabContent",children:["dashboard"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b dashboardTabContent",children:[eW&&eW.has_shopify_store&&(0,c.jsxs)("div",{style:{background:eW.is_addon_active?"linear-gradient(135deg, #f0fdf4, #dcfce7)":"linear-gradient(135deg, #f0f9ff, #e0f2fe)",border:eW.is_addon_active?"2px solid #86efac":"2px solid #7dd3fc",borderRadius:"12px",padding:"18px 22px",marginBottom:"20px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"14px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"22px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDED2"}),(0,c.jsx)("h3",{style:{margin:0,color:eW.is_addon_active?"#15803d":"#0369a1",fontSize:"17px"},className:"jsx-d52c1ba2e6fc146b",children:(null===(a=eW.pricing)||void 0===a?void 0:a.name)||"Shopify E-Commerce Automation Add-On"}),(0,c.jsx)("span",{style:{background:eW.is_addon_active?"#22c55e":"#0284c7",color:"#fff",padding:"3px 10px",borderRadius:"999px",fontSize:"11px",fontWeight:"bold",textTransform:"uppercase"},className:"jsx-d52c1ba2e6fc146b",children:eW.is_addon_active?"ACTIVE":"ADD-ON AVAILABLE"}),(null===(s=eW.pricing)||void 0===s?void 0:s.trial_days)>0&&!eW.is_addon_active?(0,c.jsxs)("span",{style:{background:"#fef08a",color:"#854d0e",padding:"3px 8px",borderRadius:"999px",fontSize:"11px",fontWeight:"bold"},className:"jsx-d52c1ba2e6fc146b",children:["\uD83C\uDF89 ",eW.pricing.trial_days,"-Day Free Trial"]}):null]}),(0,c.jsxs)("p",{style:{margin:"6px 0 0",color:"#334155",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:["Connected Store: ",(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:eW.store_domain})," • Price: ",(0,c.jsxs)("strong",{className:"jsx-d52c1ba2e6fc146b",children:[null===(t=eW.pricing)||void 0===t?void 0:t.display_usd," (",null===(o=eW.pricing)||void 0===o?void 0:o.display_inr,")"]}),(0,c.jsx)("span",{style:{color:"#64748b",marginLeft:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"• Billed securely on your Shopify monthly bill"})]})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:eW.is_addon_active?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{style:{color:"#16a34a",fontWeight:"bold",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"✓ Active on Shopify Invoice"})}):(0,c.jsx)("button",{type:"button",onClick:aa,disabled:eE,style:{background:"linear-gradient(135deg, #0284c7, #0369a1)",color:"#fff",border:"none",padding:"10px 20px",borderRadius:"8px",fontWeight:"bold",cursor:"pointer",fontSize:"14px",boxShadow:"0 2px 6px rgba(2,132,199,0.3)"},className:"jsx-d52c1ba2e6fc146b",children:eE?"Connecting to Shopify...":"⚡ Activate Add-On (".concat(null===(n=eW.pricing)||void 0===n?void 0:n.display_usd,")")})})]}),(0,c.jsxs)(c.Fragment,{children:[!e9&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b emptyStoreBanner",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b emptyStoreContent",children:[(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b emptyStoreIcon",children:(0,c.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("circle",{cx:"9",cy:"21",r:"1",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("circle",{cx:"20",cy:"21",r:"1",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6",className:"jsx-d52c1ba2e6fc146b"})]})}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h4",{className:"jsx-d52c1ba2e6fc146b",children:"No E-Commerce Store Connected"}),(0,c.jsx)("p",{className:"jsx-d52c1ba2e6fc146b",children:"Connect your Shopify or WooCommerce store to synchronize your live products catalog, orders, and customer data into LeadsFlyer."})]})]}),(0,c.jsxs)("button",{type:"button",onClick:()=>B("stores"),style:{display:"inline-flex",alignItems:"center",gap:"6px"}
1,className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"Connect Store Now"}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"→"})]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b dashboardGrid",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Total Revenue"}),(0,c.jsx)("div",{style:{background:"#ecfdf5",color:"#059669",border:"1px solid #a7f3d0"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"23",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?"".concat(e7).concat(e1):"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#059669":"#94a3b8",fontWeight:600},className:"jsx-d52c1ba2e6fc146b",children:e9?"✓ Aggregate customer checkouts":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Orders Today"}),(0,c.jsx)("div",{style:{background:"#f5f3ff",color:"#7c3aed",border:"1px solid #ddd6fe"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("path",{d:"M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M16 10a4 4 0 0 1-8 0",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?e2:"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#64748b":"#94a3b8"},className:"jsx-d52c1ba2e6fc146b",children:e9?"".concat(V.length," total store orders"):"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Customers"}),(0,c.jsx)("div",{style:{background:"#eef2ff",color:"#4f46e5",border:"1px solid #c7d2fe"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("circle",{cx:"9",cy:"7",r:"4",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?M.length:"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#4f46e5":"#94a3b8",fontWeight:600},className:"jsx-d52c1ba2e6fc146b",children:e9?"Unique profiles mapped":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Products"}),(0,c.jsx)("div",{style:{background:"#fffbeb",color:"#d97706",border:"1px solid #fde68a"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?H.length:"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#d97706":"#94a3b8",fontWeight:600},className:"jsx-d52c1ba2e6fc146b",children:e9?"Total active items catalog":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Connected Stores"}),(0,c.jsx)("div",{style:{background:"#eff6ff",color:"#2563eb",border:"1px solid #dbeafe"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("polyline",{points:"9 22 9 12 15 12 15 22",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?L.length:"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#2563eb":"#94a3b8",fontWeight:600},className:"jsx-d52c1ba2e6fc146b",children:e9?"".concat((null===(m=L[0])||void 0===m?void 0:m.shop_title)||"Active"," integration"):"No stores connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Messages Sent"}),(0,c.jsx)("div",{style:{background:"#f0f9ff",color:"#0284c7",border:"1px solid #bae6fd"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",className:"jsx-d52c1ba2e6fc146b"})})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?e4:"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:e9?"E-commerce automated triggers":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"WhatsApp Revenue"}),(0,c.jsx)("div",{style:{background:"#f0fdf4",color:"#16a34a",border:"1px solid #bbf7d0"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",className:"jsx-d52c1ba2e6fc146b"})})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?"".concat(e7).concat(e6):"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#16a34a":"#94a3b8"},className:"jsx-d52c1ba2e6fc146b",children:e9?"Driven by follow-up flows":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Campaign Revenue"}),(0,c.jsx)("div",{style:{background:"#fff1f2",color:"#e11d48",border:"1px solid #fecdd3"},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("polyline",{points:"23 6 13.5 15.5 8.5 10.5 1 18",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("polyline",{points:"17 6 23 6 23 12",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?"".concat(e7).concat(e0):"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?"#e11d48":"#94a3b8"},className:"jsx-d52c1ba2e6fc146b",children:e9?"Broadcasting conversion":"No store connected"})})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricCard",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b metricHeader",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b metricTitle",children:"Sync Health"}),(0,c.jsx)("div",{style:{background:e9&&e5>0?"#fef2f2":"#f8fafc",color:e9&&e5>0?"#dc2626":"#475569",border:"1px solid ".concat(e9&&e5>0?"#fecaca":"#e2e8f0")},className:"jsx-d52c1ba2e6fc146b metricIconBadge",children:(0,c.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("polyline",{points:"23 4 23 10 17 10",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("polyline",{points:"1 20 1 14 7 14",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",className:"jsx-d52c1ba2e6fc146b"})]})})]}),(0,c.jsx)("div",{style:{color:e9&&e5>0?"#dc2626":"#0f172a"},className:"jsx-d52c1ba2e6fc146b metricValue",children:e9?0===e5?"100%":"".concat(e5," Issues"):"—"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b metricLabel",children:(0,c.jsx)("span",{style:{color:e9?0===e5?"#059669":"#dc2626":"#94a3b8",fontWeight:600},className:"jsx-d52c1ba2e6fc146b",children:e9?0===e5?"✓ Webhooks operational":"".concat(e5," signature mismatches"):"No store connected"})})]})]})]}),(0,c.jsxs)("div",{style:{display:"grid",gridTemplateColumns:e9&&V.length>0?"2fr 1fr":"1fr",gap:"20px",marginTop:"24px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{marginBottom:0},className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16
1px",flexWrap:"wrap",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0,fontSize:"16px"},className:"jsx-d52c1ba2e6fc146b",children:"Recent Orders Preview"}),(0,c.jsx)("p",{style:{margin:"4px 0 0",color:"#64748b",fontSize:"12.5px"},className:"jsx-d52c1ba2e6fc146b",children:"Latest customer transactions synchronized from connected storefronts"})]}),(0,c.jsxs)("button",{type:"button",onClick:()=>B("orders"),style:{fontSize:"12.5px",fontWeight:"600",color:"#0284c7",background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"View All Orders"}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"→"})]})]}),e9?0===V.length?(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE6"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:"No orders placed yet"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"When a customer places an order on your store, it will automatically sync here."})]}):(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Order"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Customer"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Price"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Payment"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Fulfillment"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Date"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:V.slice(0,5).map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("strong",{className:"jsx-d52c1ba2e6fc146b",children:["#",e.order_number]})}),(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:["Customer #",e.commerce_customer_id||"Guest"]}),(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:[eZ(e.currency),e.total_price]}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("paid"===e.financial_status?"completed":"running"),children:e.financial_status||"pending"})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("fulfilled"===e.fulfillment_status?"completed":"running"),children:e.fulfillment_status||"pending"})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:new Date(e.created_at).toLocaleDateString()})]},e.id))})]})}):(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE6"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Connect your store to see live order checkouts here."})]})]}),e9&&(0,c.jsxs)("div",{style:{marginBottom:0},className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsx)("h3",{style:{margin:"0 0 16px",fontSize:"16px"},className:"jsx-d52c1ba2e6fc146b",children:"Store Integration Status"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{padding:"12px",background:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"11px",fontWeight:"700",textTransform:"uppercase",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Connected Store"}),(0,c.jsx)("div",{style:{fontWeight:"700",color:"#0f172a",marginTop:"2px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:(null===(u=L[0])||void 0===u?void 0:u.shop_title)||(null===(j=L[0])||void 0===j?void 0:j.shop_name)||"Active"}),(0,c.jsx)("small",{style:{color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:null===(h=L[0])||void 0===h?void 0:h.shop_name})]}),(0,c.jsxs)("div",{style:{padding:"12px",background:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"11px",fontWeight:"700",textTransform:"uppercase",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Webhook Status"}),(0,c.jsxs)("div",{style:{fontWeight:"700",color:"#16a34a",marginTop:"2px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:["✓ Operational (",(null===(g=L[0])||void 0===g?void 0:g.webhook_health)||"healthy",")"]})]}),(0,c.jsxs)("div",{style:{padding:"12px",background:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"11px",fontWeight:"700",textTransform:"uppercase",color:"#64748b"}
1,className:"jsx-d52c1ba2e6fc146b",children:"Quick Navigation"}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",marginTop:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("button",{type:"button",style:{flex:1,padding:"6px 8px",fontSize:"11.5px"},onClick:()=>B("products"),className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:["Catalog (",H.length,")"]}),(0,c.jsx)("button",{type:"button",style:{flex:1,padding:"6px 8px",fontSize:"11.5px"},onClick:()=>B("automations"),className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:"Automations"})]})]})]})]})]})]}),"stores"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storesPanel",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard formCard",children:[(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{ak("shopify"),aD("")},style:{flex:1,padding:"10px",borderRadius:"6px",fontWeight:"bold",cursor:"pointer",fontSize:"13px",border:"shopify"===av?"2px solid #0070f3":"1px solid #d1d5db",background:"shopify"===av?"#e8f4fd":"#fff",color:"shopify"===av?"#0070f3":"#374151"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDED2 Shopify (OAuth)"}),(0,c.jsx)("button",{type:"button",onClick:()=>{ak("woocommerce"),aD("")},style:{flex:1,padding:"10px",borderRadius:"6px",fontWeight:"bold",cursor:"pointer",fontSize:"13px",border:"woocommerce"===av?"2px solid #7f54b3":"1px solid #d1d5db",background:"woocommerce"===av?"#f3e8ff":"#fff",color:"woocommerce"===av?"#7f54b3":"#374151"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDECD️ WooCommerce (API & Webhook)"}),(0,c.jsx)("button",{type:"button",onClick:()=>{ak("opencart"),aD("")},style:{flex:1,padding:"10px",borderRadius:"6px",fontWeight:"bold",cursor:"pointer",fontSize:"13px",border:"opencart"===av?"2px solid #23a1d1":"1px solid #d1d5db",background:"opencart"===av?"#e0f2fe":"#fff",color:"opencart"===av?"#0369a1":"#374151"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE6 OpenCart Store"})]}),"shopify"===av?(0,c.jsxs)("form",{action:"".concat(f,"/shopify/auth"),method:"GET",onSubmit:function(e){e&&e.preventDefault&&e.preventDefault();let a=String(eN||"").trim().toLowerCase();if(!a){eR("Shopify domain is required.");return}(a=a.replace(/^https?:\/\//,"").split("/")[0].replace(/\s+/g,".")).includes(".")||(a="".concat(a,".myshopify.com")),eR(""),eC("Redirecting to Shopify authorization...");let s=(0,p.LP)()||"";window.location.href="".concat(f,"/shopify/auth?shop=").concat(encodeURIComponent(a),"&redirect=true&token=").concat(encodeURIComponent(s))},className:"jsx-d52c1ba2e6fc146b connectForm",children:[(0,c.jsx)("input",{type:"hidden",name:"redirect",value:"true",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("input",{type:"hidden",name:"token",value:(0,p.LP)()||"",className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("h3",{style:{margin:"0 0 10px"},className:"jsx-d52c1ba2e6fc146b",children:"Connect Shopify Store"}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{htmlFor:"shopDomain",className:"jsx-d52c1ba2e6fc146b",children:"Shopify Domain"}),(0,c.jsx)("input",{type:"text",id:"shopDomain",name:"shop",placeholder:"my-brand-store.myshopify.com",value:eN,onChange:e=>ev(e.target.value),className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("small",{className:"jsx-d52c1ba2e6fc146b",children:"Enter your myshopify.com store address."})]}),(0,c.jsx)("button",{type:"submit",style:{marginTop:"10px"},className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:"Authorize & Install Shopify"})]}):(0,c.jsxs)("form",{onSubmit:aC,className:"jsx-d52c1ba2e6fc146b connectForm",children:[(0,c.jsxs)("h3",{style:{margin:"0 0 10px"},className:"jsx-d52c1ba2e6fc146b",children:["Connect ","opencart"===av?"OpenCart":"WooCommerce"," Store"]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Store Domain / Address"}),(0,c.jsx)("input",{type:"text",placeholder:"mywoostore.com or https://mywoostore.com",value:eN,onChange:e=>ev(e.target.value),required:!0,className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("small",{className:"jsx-d52c1ba2e6fc146b",children:["Enter your ","opencart"===av?"OpenCart":"WooCommerce"," store domain or URL."]})]}),(0,c.jsxs)("div",{style:{marginTop:"10px"},className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Store Title (Optional)"}),(0,c.jsx)("input",{type:"text",placeholder:"e.g. My Organic Brand Store",value:aw,onChange:e=>aS(e.target.value),className:"jsx-d52c1ba2e6fc146b"})]}
1),(0,c.jsxs)("button",{type:"submit",style:{marginTop:"15px",background:"woocommerce"===av?"#7f54b3":"#0369a1",borderColor:"woocommerce"===av?"#7f54b3":"#0369a1"},className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:["⚡ Authorize & Connect ","opencart"===av?"OpenCart":"WooCommerce"," Store (1-Click Auto)"]}),a_&&(0,c.jsxs)("div",{style:{marginTop:"15px",padding:"12px",background:"#f8f9fa",borderRadius:"8px",border:"1px solid #d1d5db"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"13px",color:"#111827"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCCC Your WooCommerce Webhook Delivery URL:"}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",marginTop:"6px",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"text",readOnly:!0,value:a_,style:{flex:1,padding:"6px 10px",fontSize:"12px",fontFamily:"monospace",borderRadius:"4px",border:"1px solid #ccc",background:"#fff"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(a_),alert("Webhook URL copied to clipboard!")},style:{padding:"6px 12px",background:"#2563eb",color:"#fff",border:"none",borderRadius:"4px",fontWeight:"bold",fontSize:"12px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCCB Copy"})]}),(0,c.jsxs)("div",{style:{fontSize:"11px",color:"#4b5563",marginTop:"6px",lineHeight:"1.4"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"How to setup in WooCommerce:"})," Go to ",(0,c.jsx)("em",{className:"jsx-d52c1ba2e6fc146b",children:"WooCommerce Settings → Advanced → Webhooks → Add Webhook"}),". Set Topic to ",(0,c.jsx)("code",{className:"jsx-d52c1ba2e6fc146b",children:"Order Created"})," or ",(0,c.jsx)("code",{className:"jsx-d52c1ba2e6fc146b",children:"Order Updated"})," and paste this Delivery URL!"]})]})]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsx)("h3",{className:"jsx-d52c1ba2e6fc146b",children:"Your Active Store Connections"}),P?(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b loadingText",children:"Loading stores..."}):(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storeList",children:[L.map(e=>(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storeRow",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storeMeta",children:[(0,c.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{textTransform:"capitalize"},className:"jsx-d52c1ba2e6fc146b "+"platformBadge ".concat("woocommerce"===e.platform_key?"completed":"opencart"===e.platform_key?"running":"shopify"),children:e.platform_name||e.platform_key||"Shopify"}),(0,c.jsxs)("span",{style:{marginLeft:0},className:"jsx-d52c1ba2e6fc146b "+"platformBadge ".concat("healthy"===e.webhook_health?"completed":"failed"===e.webhook_health?"failed":"running"),children:["Webhook: ",e.webhook_health||"healthy"]})]}),(0,c.jsx)("h4",{className:"jsx-d52c1ba2e6fc146b",children:e.shop_title||e.shop_name}),(0,c.jsx)("p",{className:"jsx-d52c1ba2e6fc146b",children:e.shop_name}),(0,c.jsxs)("small",{className:"jsx-d52c1ba2e6fc146b syncTimestamp",children:["Last Sync: ",e.last_sync_at?new Date(e.last_sync_at).toLocaleString():"Never"]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storeActions",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b syncControls",children:[(0,c.jsxs)("select",{value:ek,onChange:e=>ew(e.target.value),className:"jsx-d52c1ba2e6fc146b syncSelect",children:[(0,c.jsx)("option",{value:"7",className:"jsx-d52c1ba2e6fc146b",children:"Last 7 Days"}),(0,c.jsx)("option",{value:"30",className:"jsx-d52c1ba2e6fc146b",children:"Last 30 Days"}),(0,c.jsx)("option",{value:"90",className:"jsx-d52c1ba2e6fc146b",children:"Last 90 Days"}),(0,c.jsx)("option",{value:"all",className:"jsx-d52c1ba2e6fc146b",children:"All Time"})]}),(0,c.jsxs)("select",{value:eS,onChange:e=>e_(e.target.value),className:"jsx-d52c1ba2e6fc146b syncSelect",children:[(0,c.jsx)("option",{value:"all",className:"jsx-d52c1ba2e6fc146b",children:"Sync All (Customers, Orders, Products, Inventory)"}),(0,c.jsx)("option",{value:"customers",className:"jsx-d52c1ba2e6fc146b",children:"Customers Only"}),(0,c.jsx)("option",{value:"orders",className:"jsx-d52c1ba2e6fc146b",children:"Orders Only"}),(0,c.jsx)("option",{value:"products",className:"jsx-d52c1ba2e6fc146b",children:"Products Only"}),(0,c.jsx)("option",{value:"inventory",className:"jsx-d52c1ba2e6fc146b",children:"Inventory Only"})]}),(0,c.jsx)("button",{onClick:()=>
1aG(e.id),disabled:eg===e.id,className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:eg===e.id?"Syncing...":"Sync Now"})]}),(0,c.jsx)("button",{onClick:()=>aH(e.id),className:"jsx-d52c1ba2e6fc146b btn btnDanger",children:"Disconnect"})]})]},e.id)),0===L.length&&(0,c.jsxs)("div",{style:{textAlign:"center",padding:"40px 20px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDFEA"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px",fontSize:"15px"},className:"jsx-d52c1ba2e6fc146b",children:"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Use the connect form above to link your Shopify, WooCommerce, or OpenCart store."})]})]})]})]}),"customers"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsx)("h3",{className:"jsx-d52c1ba2e6fc146b",children:"Synced Commerce Customers"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"ID"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Name"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Email"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Phone"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Orders Count"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Total Spent"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Tags"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:ex?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"7",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"20px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"↻"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:"Loading customers from store..."})]})}):0===M.length?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"7",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDC65"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px",fontSize:"15px"},className:"jsx-d52c1ba2e6fc146b",children:e9?"No customer profiles found":"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:e9?"Customers who register or purchase in your store will automatically sync here.":"Connect your store to sync and view customer profiles."})]})}):M.map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:["#",e.external_customer_id]}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("strong",{className:"jsx-d52c1ba2e6fc146b",children:[e.first_name," ",e.last_name]})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.email||"-"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.phone||"-"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.orders_count||0}),(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:["$",e.total_spent||"0.00"]}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.tags||"-"})]},e.id))})]})})]}),"orders"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("h3",{style:{margin:0},className:"jsx-d52c1ba2e6fc146b",children:["Commerce Orders (",V.length,")"]}),(0,c.jsx)("p",{style:{margin:"4px 0 0",color:"#64748b",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Live orders synchronized from your Shopify store"})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",fontSize:"13px",borderRadius:"8px",cursor:"pointer"}
1,onClick:aE,disabled:ep,className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:["↻ ",ep?"Loading...":"Refresh"]}),L.length>0&&(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",fontSize:"13px",borderRadius:"8px",cursor:"pointer"},onClick:()=>aG(L[0].id),disabled:eg===L[0].id,className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:["⚡ ",eg===L[0].id?"Syncing...":"Sync from Shopify"]})]})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Order Number"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Customer"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Price"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Fulfillment"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Payment Status"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Tracking Number"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Synced Date"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:ep?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"7",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"20px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"↻"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:"Loading orders from store..."})]})}):0===V.length?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"7",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"24px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE6"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:e9?"No orders placed yet":"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:e9?"When a customer places an order on your Shopify store, it will automatically sync and appear here.":"Connect your store to synchronize and manage orders."})]})}):V.map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("strong",{className:"jsx-d52c1ba2e6fc146b",children:["#",e.order_number]})}),(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:["Customer #",e.commerce_customer_id||"Guest"]}),(0,c.jsxs)("td",{className:"jsx-d52c1ba2e6fc146b",children:[eZ(e.currency),e.total_price," ",e.currency]}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("fulfilled"===e.fulfillment_status?"completed":"running"),children:e.fulfillment_status||"pending"})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("paid"===e.financial_status?"completed":"running"),children:e.financial_status||"pending"})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.tracking_number?(0,c.jsx)("code",{className:"jsx-d52c1ba2e6fc146b",children:e.tracking_number}):"-"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:new Date(e.created_at).toLocaleString()})]},e.id))})]})})]}),"products"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("h3",{style:{margin:0},className:"jsx-d52c1ba2e6fc146b",children:["Product Variant Catalog (",H.length,")"]}),(0,c.jsx)("p",{style:{margin:"4px 0 0",color:"#64748b",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Products imported from your connected Shopify store"})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",fontSize:"13px",borderRadius:"8px",cursor:"pointer"}
1,onClick:aI,disabled:ei,className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:["↻ ",ei?"Loading...":"Refresh"]}),L.length>0&&(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",fontSize:"13px",borderRadius:"8px",cursor:"pointer"},onClick:()=>aG(L[0].id),disabled:eg===L[0].id,className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:["⚡ ",eg===L[0].id?"Syncing...":"Sync from Shopify"]})]})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Product Title"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Vendor"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Type"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Status"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Sync Date"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:ei?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"5",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"20px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"↻"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:"Loading products from store..."})]})}):0===H.length?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("td",{colSpan:"5",style:{textAlign:"center",padding:"40px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"24px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDFF7️"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:e9?"No products synced yet":"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:e9?'Click "Sync from Shopify" to import all your store products into LeadsFlyer.':"Connect your store to synchronize product inventory and catalog."})]})}):H.map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:e.title})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.vendor||"-"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.product_type||"-"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("active"===e.status?"completed":"running"),children:e.status})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:new Date(e.created_at).toLocaleDateString()})]},e.id))})]})})]}),"storefront"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b storefrontStudio",children:[(0,c.jsxs)("div",{style:{background:"linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%)",borderRadius:"16px",padding:"24px 28px",color:"#ffffff",marginBottom:"24px",boxShadow:"0 10px 25px -5px rgba(6, 78, 59, 0.25)",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"16px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"28px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDECD️"}),(0,c.jsx)("h2",{style:{margin:0,fontSize:"22px",fontWeight:"800",letterSpacing:"-0.02em"},className:"jsx-d52c1ba2e6fc146b",children:"WhatsApp Mini-Storefront Engine"}),(0,c.jsx)("span",{style:{background:"rgba(255, 255, 255, 0.2)",color:"#fff",fontSize:"11px",fontWeight:"700",padding:"3px 10px",borderRadius:"999px",backdropFilter:"blur(4px)"},className:"jsx-d52c1ba2e6fc146b",children:"LIVE IN-APP BROWSER"})]}),(0,c.jsx)("p",{style:{margin:0,fontSize:"14px",color:"rgba(255, 255, 255, 0.85)",maxWidth:"680px",lineHeight:1.5},className:"jsx-d52c1ba2e6fc146b",children:"Enable your customers to browse your complete catalog, select sizes and colors with real-time stock sync, and checkout directly inside WhatsApp with zero app download friction."})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[L.length>1&&(0,c.jsx)("select",{value:eT||"",onChange:e=>{let a=Number(e.target.value);eB(a),az(a)},style:{background:"rgba(255, 255, 255, 0.15)",color:"#fff",border:"1px solid rgba(255, 255, 255, 0.3)",borderRadius:"8px",padding:"8px 12px",fontSize:"13px",fontWeight:"600",outline:"none"},className:"jsx-d52c1ba2e6fc146b",children:L.map(e=>(0,c.jsxs)("option",{value:e.id,style:{color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:[e.shop_title||e.shop_name," (ID #",e.id,")"]},e.id))}),eT&&(0,c.jsxs)("button",{type:"button",onClick:()=>aG(eT),disabled:eg===eT,style:{background:"#ffffff",color:"#065f46",border:"none",borderRadius:"8px",padding:"8px 16px",fontSize:"13px",fontWeight:"700",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},className:"jsx-d52c1ba2e6fc146b",children:["⚡ ",eg===eT?"Syncing...":"Sync Products"]})]})]}),eV&&(0,c.jsx)("div",{style:{background:"#ecfdf5",border:"1px solid #10b981",color:"#065f46",padding:"12px 18px",borderRadius:"10px",fontSize:"14px",fontWeight:"600",marginBottom:"20px",display:"flex",alignItems:"center",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:eV}),eH&&(0,c.jsxs)("div",{style:{background:"#fef2f2",border:"1px solid #ef4444",color:"#991b1b",padding:"12px 18px",borderRadius:"10px",fontSize:"14px",fontWeight:"600",marginBottom:"20px",display:"flex",alignItems:"center",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:["⚠️ ",eH]}),0===L.length?(0,c.jsxs)("div",{style:{background:"#fff",borderRadius:"16px",padding:"60px 20px",textAlign:"center",border:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"48px",marginBottom:"16
1px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDFEA"}),(0,c.jsx)("h3",{style:{fontSize:"20px",color:"#0f172a",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"No Store Connected"}),(0,c.jsxs)("p",{style:{color:"#64748b",maxWidth:"450px",margin:"0 auto 20px"},className:"jsx-d52c1ba2e6fc146b",children:["Connect your Shopify or WooCommerce store under the ",(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Stores"})," tab to automatically launch your WhatsApp mini storefront."]}),(0,c.jsx)("button",{type:"button",onClick:()=>B("stores"),className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:"Connect Store Now →"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"14px",border:"1px solid #e2e8f0",padding:"18px 24px",marginBottom:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"16px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",minWidth:"280px",flex:1},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{width:"42px",height:"42px",borderRadius:"10px",background:"#ecfdf5",color:"#10b981",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",flexShrink:0},className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDF10"}),(0,c.jsxs)("div",{style:{overflow:"hidden"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"11px",fontWeight:"700",textTransform:"uppercase",color:"#64748b",letterSpacing:"0.05em"},className:"jsx-d52c1ba2e6fc146b",children:"Live WhatsApp Store Link"}),(0,c.jsx)("div",{style:{fontSize:"15px",fontWeight:"600",color:"#0f172a",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},className:"jsx-d52c1ba2e6fc146b",children:"https://leadsflyer.com/shop/".concat(eT||(null===(y=L[0])||void 0===y?void 0:y.id)||18)})]})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{var e;let a="https://leadsflyer.com/shop/".concat(eT||(null===(e=L[0])||void 0===e?void 0:e.id)||18);"undefined"!=typeof navigator&&(navigator.clipboard.writeText(a),eY(!0),setTimeout(()=>eY(!1),2500))},style:{background:eJ?"#10b981":"#f1f5f9",color:eJ?"#fff":"#0f172a",border:"none",borderRadius:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:"600",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px",transition:"all 0.2s ease"},className:"jsx-d52c1ba2e6fc146b",children:eJ?"✓ Copied!":"\uD83D\uDCCB Copy Link"}),(0,c.jsx)("a",{href:"https://leadsflyer.com/shop/".concat(eT||(null===(N=L[0])||void 0===N?void 0:N.id)||18),target:"_blank",rel:"noopener noreferrer",style:{background:"#088494",color:"#ffffff",textDecoration:"none",borderRadius:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD17 Open Store ↗"}),(0,c.jsx)("button",{type:"button",onClick:()=>e$(!0),style:{background:"#f1f5f9",color:"#0f172a",border:"none",borderRadius:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:"600",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCF1 QR Code"}),(0,c.jsx)("a",{href:"https://wa.me/?text=".concat(encodeURIComponent("Check out our official WhatsApp store: https://leadsflyer.com/shop/".concat(eT||(null===(v=L[0])||void 0===v?void 0:v.id)||18))),target:"_blank",rel:"noopener noreferrer",style:{background:"#25D366",color:"#ffffff",textDecoration:"none",borderRadius:"8px",padding:"8px 14px",fontSize:"13px",fontWeight:"700",display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCAC Share on WhatsApp"})]})]}),eQ&&(0,c.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(15, 23, 42, 0.75)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999,padding:"20px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{background:"#fff",borderRadius:"20px",padding:"32px",maxWidth:"420px",width:"100%",textAlign:"center",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCF1"}),(0,c.jsx)("h3",{style:{margin:"0 0 6px",fontSize:"20px",fontWeight:"800",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:"Scan to Open WhatsApp Store"}),(0,c.jsx)("p",{style:{margin:"0 0 20px",fontSize:"13px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Point any phone camera or WhatsApp scanner to instantly launch your mini storefront."}),(0,c.jsx)("div",{style:{background:"#f8fafc",padding:"20px",borderRadius:"16px",display:"inline-block",border:"1px solid #e2e8f0",marginBottom:"20px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("img",{src:"https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=10&data=".concat(encodeURIComponent("https://leadsflyer.com/shop/".concat(eT||(null===(k=L[0])||void 0===k?void 0:k.id)||18))),alt:"Storefront QR Code",style:{width:"220px",height:"220px",display:"block"},className:"jsx-d52c1ba2e6fc146b"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#059669",fontWeight:"600",marginBottom:"20px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDFE2 Ready for packaging, flyers, social media & WhatsApp status!"}),(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",justifyContent:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>e$(!1),style:{background:"#f1f5f9",color:"#334155",border:"none",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:"600",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"Close"}),(0,c.jsx)("a",{href:"https://api.qrserver.com/v1/create-qr-code/?size=600x600&margin=20&data=".concat(encodeURIComponent("https://leadsflyer.com/shop/".concat(eT||(null===(w=L[0])||void 0===w?void 0:w.id)||18))),download:"leadsflyer-whatsapp-store-qr.png",target:"_blank",rel:"noopener noreferrer",style:{background:"#088494",color:"#fff",textDecoration:"none",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:"700"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE5 Download High-Res"})]})]})}),(0,c.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(360px, 1fr))",gap:"24px",marginBottom:"32px",alignItems:"start"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"16px",border:"1px solid #e2e8f0",padding:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)",marginBottom:"24px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"18px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"20px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDFA8"}),(0,c.jsx)("h3",{style:{margin:0,fontSize:"17px",fontWeight:"700",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:"Storefront Branding & Checkout Settings"})]}),(0,c.jsxs)("form",{onSubmit:aR,className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{marginBottom:"18px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"13px",fontWeight:"600",color:"#334155",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE2 Announcement Banner Text"}),(0,c.jsx)("input",{type:"text",value:eP.announcement,onChange:e=>eO(a=>({...a,announcement:e.target.value})),placeholder:"e.g. ⚡ Free Express Delivery on all orders | 100% Quality Guaranteed",style:{width:"100%",padding:"10px 14px",border:"1px solid #cbd5e1",borderRadius:"8px",fontSize:"14px",color:"#0f172a",outline:"none"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#64748b",marginTop:"4px"},className:"jsx-d52c1ba2e6fc146b",children:"Displayed at the very top of your mobile store inside WhatsApp."})]}),(0,c.jsxs)("div",{style:{marginBottom:"18px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"13px",fontWeight:"600",color:"#334155",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDC8E Brand Accent Color"}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center",flexWrap:"wrap",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[[{name:"Emerald",hex:"#10b981"},{name:"Sapphire",hex:"#2563eb"},{name:"Violet",hex:"#7c3aed"},{name:"Sunset",hex:"#f97316"},{name:"Crimson",hex:"#ef4444"},{name:"Dark Slate",hex:"#0f172a"}].map(e=>(0,c.jsx)("button",{type:"button",onClick:()=>eO(a=>({...a,brand_color:e.hex})),style:{width:"32px",height:"32px",borderRadius:"8px",background:e.hex,border:eP.brand_color.toLowerCase()===e.hex.toLowerCase()?"3px solid #000":"2px solid rgba(0,0,0,0.1)",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},title:e.name,className:"jsx-d52c1ba2e6fc146b"},e.hex)),(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginLeft:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"color",value:eP.brand_color,onChange:e=>eO(a=>({...a,brand_color:e.target.value})),style:{width:"36px",height:"36px",border:"none",borderRadius:"8px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("input",{type:"text",value:eP.brand_color,onChange:e=>eO(a=>({...a,brand_color:e.target.value})),style:{width:"90px",padding:"6px 10px",border:"1px solid #cbd5e1",borderRadius:"6px",fontSize:"13px",fontWeight:"600",fontFamily:"monospace"},className:"jsx-d52c1ba2e6fc146b"})]})]})]}),(0,c.jsxs)("div",{style:{marginBottom:"18px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"13px",fontWeight:"600",color:"#334155",marginBottom:"10px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCB3 Payment & Checkout Options"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",fontSize:"13px",color:"#1e293b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"checkbox",checked:eP.enable_cod,onChange:e=>eO(a=>({...a,enable_cod:e.target.checked})),style:{width:"18px",height:"18px",accentColor:"#10b981"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("span",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Cash on Delivery (COD)"})," — Let customers pay when delivery arrives"]})]}),(0,c.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",fontSize:"13px",color:"#1e293b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"checkbox",checked:eP.enable_online_payment,onChange:e=>eO(a=>({...a,enable_online_payment:e.target.checked})),style:{width:"18px",height:"18px",accentColor:"#10b981"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("span",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Online Payment (UPI / Cards / Netbanking)"})," — Direct digital checkout"]})]}),(0,c.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",fontSize:"13px",color:"#1e293b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"checkbox",checked:eP.enable_whatsapp_order,onChange:e=>eO(a=>({...a,enable_whatsapp_order:e.target.checked})),style:{width:"18px",height:"18px",accentColor:"#10b981"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("span",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Direct WhatsApp Order"})," — Dispatches cart summary to your WhatsApp chat"]})]})]})]}),(0,c.jsxs)("div",{style:{marginBottom:"22px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"13px",fontWeight:"600",color:"#334155",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCAC Customer Support WhatsApp Phone"}),(0,c.jsx)("input",{type:"text",value:eP.support_phone,onChange:e=>eO(a=>({...a,support_phone:e.target.value})),placeholder:"e.g. +91 98765 43210 (include country code)",style:{width:"100%",padding:"10px 14px",border:"1px solid #cbd5e1",borderRadius:"8px",fontSize:"14px",color:"#0f172a",outline:"none"},className:"jsx-d52c1ba2e6fc146b"})]}),(0,c.jsx)("button",{type:"submit",disabled:eM,style:{background:"linear-gradient(135deg, #10b981 0%, #059669 100%)",color:"#ffffff",border:"none",borderRadius:"10px",padding:"12px 24px",fontSize:"14px",fontWeight:"700",cursor:"pointer",width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 12px rgba(16, 185, 129, 0.3)"},className:"jsx-d52c1ba2e6fc146b",children:eM?"Saving Settings...":"\uD83D\uDCBE Save Storefront Settings"})]})]}),(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"16px",border:"1px solid #e2e8f0",padding:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"14px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"20px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDE80"}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0,fontSize:"17px",fontWeight:"700",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:"Instant WhatsApp Campaign Templates"}),(0,c.jsx)("p",{style:{margin:"2px 0 0",fontSize:"12px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"1-Click ready-to-send promotional messages to blast to your customer lists"})]})]}),(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[{title:"\uD83C\uDF1F New Collection Launch",text:"Hey there! \uD83D\uDC4B\n\nOur new collection has just arrived at ".concat((null===(S=L.find(e=>e.id===eT))||void 0===S?void 0:S.shop_title)||"our store","! \uD83D\uDC57✨\n\nYou can now browse sizes, colors, and place your order directly inside WhatsApp:\n\uD83D\uDC49 https://leadsflyer.com/shop/").concat(eT||(null===(_=L[0])||void 0===_?void 0:_.id)||18,"\n\nEnjoy Cash on Delivery & Free Shipping today!")},{title:"\uD83D\uDD25 Exclusive Flash Sale",text:"⚡ FLASH SALE ALERT! ⚡\n\nGet up to 40% OFF across our top items for the next 24 hours only! \uD83D\uDECD️\n\nTap below to explore the catalog & checkout directly in WhatsApp:\n\uD83D\uDC49 https://leadsflyer.com/shop/".concat(eT||(null===(D=L[0])||void 0===D?void 0:D.id)||18,"\n\nLimited stock available. Hurry!")},{title:"\uD83D\uDCAC Quick Catalog Share",text:"Hi! Looking to order from us? \uD83D\uDECD️\n\nExplore our interactive WhatsApp catalog here:\n\uD83D\uDC49 https://leadsflyer.com/shop/".concat(eT||(null===(C=L[0])||void 0===C?void 0:C.id)||18,"\n\nPick your favorite size & color in just 2 
1clicks!")}].map((e,a)=>(0,c.jsxs)("div",{style:{background:"#f8fafc",border:"1px solid #e2e8f0",borderRadius:"12px",padding:"14px",position:"relative"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"13px",color:"#1e293b"},className:"jsx-d52c1ba2e6fc146b",children:e.title}),(0,c.jsxs)("div",{style:{display:"flex",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&(navigator.clipboard.writeText(e.text),eX(a),setTimeout(()=>eX(null),2500))},style:{background:eK===a?"#10b981":"#ffffff",color:eK===a?"#fff":"#334155",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"4px 8px",fontSize:"11px",fontWeight:"600",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:eK===a?"✓ Copied!":"\uD83D\uDCCB Copy"}),(0,c.jsx)("a",{href:"https://wa.me/?text=".concat(encodeURIComponent(e.text)),target:"_blank",rel:"noopener noreferrer",style:{background:"#25D366",color:"#fff",textDecoration:"none",borderRadius:"6px",padding:"4px 8px",fontSize:"11px",fontWeight:"700"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCAC Send"})]})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#475569",whiteSpace:"pre-wrap",fontFamily:"inherit",lineHeight:1.4,background:"#fff",padding:"8px 10px",borderRadius:"6px",border:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:e.text})]},a))})]})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"16px",border:"1px solid #e2e8f0",padding:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0,fontSize:"16px",fontWeight:"700",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCF1 Real-Time WhatsApp Webview Preview"}),(0,c.jsx)("p",{style:{margin:"2px 0 0",fontSize:"12px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Exactly what your customer experiences inside WhatsApp"})]}),(0,c.jsx)("span",{style:{fontSize:"11px",fontWeight:"700",color:"#10b981",background:"#ecfdf5",padding:"3px 8px",borderRadius:"999px"},className:"jsx-d52c1ba2e6fc146b",children:"Live Interactive"})]}),(0,c.jsx)("div",{style:{width:"320px",margin:"0 auto",background:"#0f172a",borderRadius:"44px",padding:"12px",boxShadow:"0 25px 60px -15px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255,255,255,0.1)",position:"relative"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{background:"#f8fafc",borderRadius:"34px",overflow:"hidden",height:"640px",display:"flex",flexDirection:"column",position:"relative"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{background:"#075e54",color:"#ffffff",padding:"10px 14px 8px",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",fontWeight:"600"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"✕ Done"}),(0,c.jsxs)("span",{style:{fontSize:"11px",opacity:.9},className:"jsx-d52c1ba2e6fc146b",children:["leadsflyer.com/shop/",eT||(null===(z=L[0])||void 0===z?void 0:z.id)||18]}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"⋮"})]}),(0,c.jsx)("div",{style:{background:eP.brand_color||"#10b981",color:"#ffffff",padding:"6px 10px",fontSize:"10px",fontWeight:"700",textAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},className:"jsx-d52c1ba2e6fc146b",children:eP.announcement||"⚡ Free Express Delivery on all orders"}),(0,c.jsxs)("div",{style:{background:"#ffffff",padding:"10px 14px",borderBottom:"1px solid #e2e8f0",display:"flex",alignItems:"center",justifyContent:"space-between"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:eP.brand_color||"#10b981",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"13px",fontWeight:"800"},className:"jsx-d52c1ba2e6fc146b",children:((null===(R=L.find(e=>e.id===eT))||void 0===R?void 0:R.shop_title)||"L")[0].toUpperCase()}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{fontSize:"12px",fontWeight:"700",color:"#0f172a",display:"flex",alignItems:"center",gap:"4px"},className:"jsx-d52c1ba2e6fc146b",children:[(null===(W=L.find(e=>e.id===eT))||void 0===W?void 0:W.shop_title)||"LeadsFlyer Store",(0,c.jsx)("span",{style:{color:"#10b981",fontSize:"11px"},className:"jsx-d52c1ba2e6fc146b",children:"✓"})]}),(0,c.jsx)("div",{style:{fontSize:"9px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Official WhatsApp Store"})]})]}),(0,c.jsx)("div",{style:{background:"#f1f5f9",padding:"3px 8px",borderRadius:"999px",fontSize:"10px",fontWeight:"700",color:"#334155"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDECD️ 1"})]}),(0,c.jsxs)("div",{style:{padding:"8px 12px 4px",background:"#f8fafc"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"4px 8px",fontSize:"10px",color:"#94a3b8",display:"flex",alignItems:"center",gap:"4px",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD0D Search products, sizes..."}),(0,c.jsx)("div",{style:{display:"flex",gap:"4px",overflowX:"auto"},className:"jsx-d52c1ba2e6fc146b",children:["All","Popular","New","Sale"].map((e,a)=>(0,c.jsx)("span",{style:{fontSize:"9px",fontWeight:"600",padding:"2px 8px",borderRadius:"999px",background:0===a?eP.brand_color||"#10b981":"#ffffff",color:0===a?"#ffffff"
1:"#475569",border:"1px solid rgba(0,0,0,0.06)",whiteSpace:"nowrap"},className:"jsx-d52c1ba2e6fc146b",children:e},a))})]}),(0,c.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"8px 12px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:(H.slice(0,4).length>0?H.slice(0,4):[{id:1,title:"Classic Snowboard",price:699.95,image_url:"https://images.unsplash.com/photo-1521572267360-ee0c2909d518?w=300"},{id:2,title:"Winter Ski Wax",price:9.95,image_url:"https://images.unsplash.com/photo-1551698618-1dfe5d97d256?w=300"},{id:3,title:"Hydrogen Board",price:600,image_url:"https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=300"},{id:4,title:"Oxygen Board",price:1025,image_url:"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300"}]).map((e,a)=>(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"10px",border:"1px solid #e2e8f0",overflow:"hidden",display:"flex",flexDirection:"column"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{height:"90px",background:"#f1f5f9",backgroundImage:"url(".concat(e.image_url||"https://images.unsplash.com/photo-1521572267360-ee0c2909d518?w=300",")"),backgroundSize:"cover",backgroundPosition:"center"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("div",{style:{padding:"6px 8px",flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"10px",fontWeight:"700",color:"#0f172a",lineHeight:1.2,height:"24px",overflow:"hidden"},className:"jsx-d52c1ba2e6fc146b",children:e.title}),(0,c.jsxs)("div",{style:{fontSize:"11px",fontWeight:"800",color:eP.brand_color||"#10b981",marginTop:"2px"},className:"jsx-d52c1ba2e6fc146b",children:["$",Number(e.price||0).toFixed(2)]})]}),(0,c.jsx)("div",{style:{marginTop:"4px",background:eP.brand_color||"#10b981",color:"#ffffff",fontSize:"9px",fontWeight:"700",padding:"4px",borderRadius:"4px",textAlign:"center"},className:"jsx-d52c1ba2e6fc146b",children:"Select Options ▾"})]})]},a))}),(0,c.jsx)("div",{style:{padding:"8px 12px 10px",background:"#ffffff",borderTop:"1px solid #e2e8f0"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{background:eP.brand_color||"#10b981",color:"#ffffff",borderRadius:"10px",padding:"8px 12px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"11px",fontWeight:"700",boxShadow:"0 4px 10px rgba(0,0,0,0.15)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDECD️ 1 Item • $699.95"}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"View Cart & Checkout →"})]})})]})})]})})]}),(0,c.jsxs)("div",{style:{background:"#ffffff",borderRadius:"16px",border:"1px solid #e2e8f0",padding:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("h3",{style:{margin:0,fontSize:"17px",fontWeight:"700",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:["\uD83D\uDCE6 Synced WhatsApp Catalog & Variants (",H.length,")"]}),(0,c.jsx)("p",{style:{margin:"2px 0 0",fontSize:"12px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"These products and their size/color variants are available in real-time in your WhatsApp store."})]}),(0,c.jsx)("div",{style:{display:"flex",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("button",{type:"button",onClick:aI,style:{fontSize:"12px",padding:"6px 12px"},className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:"↻ Refresh Catalog"})})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Product"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Category"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Price"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Stock Status"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Action"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:0===H.length?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("td",{colSpan:"5",style:{textAlign:"center",padding:"30px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:'No products synced yet. Click "Sync Products" to import from Shopify.'})}):H.map(e=>{var a,s;return(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[e.image_url&&(0,c.jsx)("img",{src:e.image_url,alt:"",style:{width:"36px",height:"36px",borderRadius:"6px",objectFit:"cover"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:e.title}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:e.vendor||"Default Vendor"})]})]})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.product_type||"General"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("strong",{className:"jsx-d52c1ba2e6fc146b",children:[eZ(null===(a=L.find(e=>e.id===eT))||void 0===a?void 0:a.currency),Number(e.price||0).toFixed(2)]})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b statusBadge completed",children:"\uD83D\uDFE2 In Storefront"})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("a",{href:"https://leadsflyer.com/shop/".concat(eT||(null===(s=L[0])||void 0===s?void 0:s.id)||18,"?search=").concat(encodeURIComponent(e.title)),target:"_blank",rel:"noopener noreferrer",style:{fontSize:"12px",color:"#088494",fontWeight:"600",textDecoration:"none"},className:"jsx-d52c1ba2e6fc146b",children:"Preview in Store ↗"})})]},e.id)})})]})})]})]})]}),"automations"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0},className:"jsx-d52c1ba2e6fc146b",children:"⚡ Universal E-Commerce Automation Studio"}),(0,c.jsx)("p",{style:{margin:"5px 0 0",color:"#666",fontSize:"14px"},className:"jsx-d52c1ba2e6fc146b",children:"Configure high-converting wait delays, product recommendations, COD verification, and WhatsApp/Email triggers."})]}),L.length>0&&(0,c.jsxs)("div",{style:{padding:"8px 15px",background:"#f8f9fa",borderRadius:"8px",border:"1px solid #e9ecef"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{fontWeight:"600",marginRight:"10px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Store:"}),(0,c.jsx)("select",{value:ad,onChange:e=>ax(e.target.value),style:{padding:"6px",borderRadius:"4px",border:"1px solid #ccc",minWidth:"180px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:L.map(e=>(0,c.jsxs)("option",{value:e.id,className:"jsx-d52c1ba2e6fc146b",children:[e.shop_title||e.shop_name," (",e.platform_key,")"]},e.id))})]})]}),ad?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h4",{style:{margin:"20px 0 10px",color:"#111"},className:"jsx-d52c1ba2e6fc146b",children:"1-Click E-Commerce Automation Recipes"}),(0,c.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"15p
1x",marginBottom:"30px"},className:"jsx-d52c1ba2e6fc146b",children:af.map(e=>{let a=!!e.meta_template_name,s=a?an.find(a=>a.name===e.meta_template_name):null,t=s?s.status||"APPROVED":a?"APPROVED":null,r="paused"===e.status,o="\uD83D\uDFE2 ACTIVE",l={padding:"3px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#dcfce7",color:"#166534",border:"1px solid #86efac"},n="1px solid #bbf7d0";return a?"REJECTED"===t?(o="\uD83D\uDD34 REJECTED",l={padding:"3px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#fee2e2",color:"#991b1b",border:"1px solid #fca5a5"},n="1px solid #fca5a5"):"PENDING"===t?(o="\uD83D\uDFE1 IN REVIEW",l={padding:"3px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#fffbeb",color:"#92400e",border:"1px solid #fde68a"},n="1px solid #fde68a"):r&&(o="⏸ PAUSED",l={padding:"3px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#f1f5f9",color:"#64748b",border:"1px solid #cbd5e1"},n="1px dashed #cbd5e1"):(o="⚠️ SETUP REQUIRED",l={padding:"3px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#fffbeb",color:"#b45309",border:"1px solid #fde68a"},n="1px solid #fde68a"),(0,c.jsxs)("div",{style:{padding:"16px",borderRadius:"8px",border:n,background:r?"#fafafa":"#fff",boxShadow:"0 2px 4px rgba(0,0,0,0.04)",display:"flex",flexDirection:"column",justify:"space-between"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px",gap:"8px",flexWrap:"wrap"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontWeight:"bold",fontSize:"15px",color:"#111"},className:"jsx-d52c1ba2e6fc146b",children:e.name}),(0,c.jsx)("span",{style:l,className:"jsx-d52c1ba2e6fc146b",children:o})]}),(0,c.jsxs)("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Trigger:"})," ",(0,c.jsx)("code",{className:"jsx-d52c1ba2e6fc146b",children:e.trigger_event})," \xa0|\xa0 ",(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Wait Delay:"})," ",0===e.wait_delay_minutes?"Instant":"".concat(e.wait_delay_minutes," mins")]}),!a&&(0,c.jsxs)("div",{style:{marginBottom:"10px",padding:"7px 10px",background:"#fffbeb",border:"1px solid #fde68a",borderRadius:"6px",fontSize:"11.5px",color:"#92400e",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"⚠️ No Meta template linked yet."}),(0,c.jsx)("span",{style:{fontSize:"11px",color:"#b45309",fontWeight:"bold"},className:"jsx-d52c1ba2e6fc146b",children:"Needs Setup"})]}),a&&"REJECTED"===t&&(0,c.jsxs)("div",{style:{marginBottom:"10px",padding:"7px 10px",background:"#fef2f2",border:"1px solid #fca5a5",borderRadius:"6px",fontSize:"11.5px",color:"#991b1b",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("span",{className:"jsx-d52c1ba2e6fc146b",children:['❌ Template "',e.meta_template_name,'" was rejected by Meta.']}),(0,c.jsx)("span",{style:{fontSize:"11px",fontWeight:"bold"},className:"jsx-d52c1ba2e6fc146b",children:"Action Needed"})]}),a&&"PENDING"===t&&(0,c.jsx)("div",{style:{marginBottom:"10px",padding:"7px 10px",background:"#fffbeb",border:"1px solid #fde68a",borderRadius:"6px",fontSize:"11.5px",color:"#92400e",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("span",{className:"jsx-d52c1ba2e6fc146b",children:['⏳ Template "',e.meta_template_name,'" pending Meta review.']})}),a&&"APPROVED"===t&&(0,c.jsxs)("div",{style:{marginBottom:"10px",padding:"6px 10px",background:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"6px",fontSize:"11.5px",color:"#166534",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"✅ Official Meta Template:"}),(0,c.jsx)("code",{style:{fontWeight:"bold",background:"#dcfce7",padding:"1px 5px",borderRadius:"3px"},className:"jsx-d52c1ba2e6fc146b",children:e.meta_template_name})]}),(0,c.jsx)("div",{style:{background:"#f8f9fa",padding:"10px",borderRadius:"6px",fontSize:"12px",fontFamily:"sans-serif",borderLeft:"3px solid #0284c7",marginBottom:"12px",color:"#333"},className:"jsx-d52c1ba2e6fc146b",children:e.message_template})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"8px",marginTop:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[a?"REJECTED"===t?(0,c.jsx)("button",{onClick:()=>{ag({...e}),et(!0),eo(e.meta_template_name||"")},style:{flex:1,padding:"7px 12px",borderRadius:"4px",border:"none",background:"#ea580c",color:"#fff",fontWeight:"bold",fontSize:"12px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD04 Retry Approval"})}):(0,c.jsx)("button",{onClick:()=>aV({rule_id:e.id,status:r?"active":"paused"}),style:{flex:1,padding:"6px 12px",borderRadius:"4px",border:"none",background:r?"#28a745":"#ff9800",color:"#fff",fontWeight:"600",fontSize:"12px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:r?"▶ Activate":"⏸ Pause"}):(0,c.jsx)("button",{onClick:()=>{let a={...e};a.message_template&&a.message_template.includes("stocks run out: {{cart_url}}")&&(a.message_template=a.message_template.replace("stocks run out: {{cart_url}}","Click {{cart_url}}
1 to complete your order before stocks run out.")),ag(a),et(!0),eo(String(e.meta_template_name||e.rule_key||e.name||"template").toLowerCase().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").slice(0,45)),en((e.rule_key||"").includes("abandoned")||(e.rule_key||"").includes("welcome")||"cart.abandoned"===(e.trigger_event||"")?"MARKETING":"UTILITY")},style:{flex:1,padding:"7px 12px",borderRadius:"4px",border:"none",background:"#0284c7",color:"#fff",fontWeight:"bold",fontSize:"12px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",boxShadow:"0 1px 2px rgba(2,132,199,0.3)"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"⚡ Setup Template"})}),(0,c.jsx)("button",{onClick:()=>{let a={...e};a.message_template&&a.message_template.includes("stocks run out: {{cart_url}}")&&(a.message_template=a.message_template.replace("stocks run out: {{cart_url}}","Click {{cart_url}} to complete your order before stocks run out.")),ag(a)},style:{padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",background:"#fff",color:"#334155",fontWeight:"600",fontSize:"12px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"✏️ Edit Delay & Template"})]})]},e.id)})}),(0,c.jsx)("h4",{style:{margin:"20px 0 10px",color:"#111"},className:"jsx-d52c1ba2e6fc146b",children:"Live Scheduled Automation Queue"}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Rule Name"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Recipient"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Scheduled At"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Status"})]})}),(0,c.jsx)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:0===au.length?(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("td",{colSpan:"4",style:{textAlign:"center",color:"#888",padding:"20px"},className:"jsx-d52c1ba2e6fc146b",children:"No scheduled automation entries pending. Queue updates in real-time as store webhooks fire."})}):au.map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:e.rule_name||"Rule #".concat(e.rule_id)})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.recipient_phone||e.recipient_email||"Customer"}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:new Date(e.scheduled_at).toLocaleString()}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat("executed"===e.status?"completed":"pending"===e.status?"running":"failed"),children:e.status})})]},e.id))})]})})]}):(0,c.jsx)("div",{style:{color:"#d9534f",margin:"20px 0"},className:"jsx-d52c1ba2e6fc146b",children:"Please connect a store connection profile first before setting up automations."}),ah&&(0,c.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.6)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{style:{background:"#fff",borderRadius:"12px",maxWidth:"620px",width:"100%",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 40px rgba(0,0,0,0.3)",overflow:"hidden"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{padding:"16px 24px",borderBottom:"1px solid #e9ecef",display:"flex",justifyContent:"space-between",alignItems:"center",background:"#f8f9fa"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("h3",{style:{margin:0,fontSize:"18px",color:"#111827",fontWeight:"bold"},className:"jsx-d52c1ba2e6fc146b",children:["Configure ",ah.name]}),(0,c.jsx)("button",{type:"button",onClick:()=>ag(null),style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"0 4px"},className:"jsx-d52c1ba2e6fc146b",children:"✕"})]}),(0,c.jsxs)("div",{style:{padding:"20px 24px",overflowY:"auto",flex:1},className:"jsx-d52c1ba2e6fc146b",children:[(()=>{let e=ah.trigger_event||"order.created",a=ah.rule_key||"",s={title:"\uD83D\uDCA1 How Order Status Automation Works:",trigger:"Triggers automatically when customers perform store actions or order updates.",delay:"Message dispatches after your set wait delay (0m = Instant, 30m, 1440m = 24 hours).",variables:"Useful tags: {{customer_first_name}}, {{order_number}}, {{total_price}}, {{currency}}, {{tracking_url}}",color:"#084298",bg:"#e8f4fd",border:"#b6e0fe"};return"cart.abandoned"===e||a.includes("abandoned")?s={title:"\uD83D\uDED2 How Abandoned Cart Recovery Works:",trigger:"Triggers automatically when a shopper adds items to cart but leaves before completing checkout.",delay:"Set wait delay (e.g. 30m or 1440m / 24h) to send recovery reminders with their saved cart link.",variables:"Useful tags: {{customer_first_name}}, {{cart_url}}, {{recommended_product_name}}, {{total_price}}",color:"#084298",bg:"#e8f4fd",border:"#b6e0fe"}:"customer.created"===e||a.includes("welcome")?s={title:"\uD83D\uDC64 How New Customer Welcome Works:",trigger:"Triggers when a new customer registers on your store or makes their first purchase.",delay:"Set a short delay (e.g. 60m) to welcome new buyers with a coupon code or intro guide.",variables:"Useful tags: {{customer_first_name}}, {{store_title}}, {{store_url}}",color:"#0f5132",bg:"#d1e7dd",border:"#badbcc"}:"order.cancelled"===e||a.includes("cancelled")?s={title:"❌ How Order Cancelled & Refund Notification Works:",trigger:"Triggers immediately when an order is cancelled or marked refunded in your store.",delay:"Recommended 0 minutes (instant) so customers receive real-time refund & cancellation status updates.",variables:"Useful tags: {{customer_first_name}}, {{order_number}}, {{total_price}}, {{currency}}, {{financial_status}}",color:"#842029",bg:"#f8d7da",border:"#f5c6cb"}:"order.fulfilled"===e||a.includes("shipped")?s={title:"\uD83D\uDE9A How Order Shipped & Tracking Alert Works:",trigger:"Triggers when order status changes to Shipped/Fulfilled and courier tracking details are added.",delay:"Recommended 0 minutes (instant) to instantly send live tracking details to customer's WhatsApp.",variables:"Useful tags: {{customer_first_name}}, {{order_number}}, {{fulfillment_status}}, {{tracking_number}}, {{tracking_url}}",color:"#664d03",bg:"#fff3cd",border:"#ffeeba"}:"order.delivered"===e||a.includes("delivered")||a.includes("review")||a.includes("cross_sell")?s={title:"\uD83C\uDF81 How Post-Delivery Automation Works:",trigger:"Triggers after an order package is successfully delivered to the customer's address.",delay:"Set delay to 3 days (4320m) for rating collector or 7 days (10080m) for cross-sell recommendations.",variables:"Useful tags: {{customer_first_name}}, {{order_number}}, {{purchased_item}}, {{recommended_product_name}}, {{recommended_product_url}}",color:"#084298",bg:"#e8f4fd",border:"#b6e0fe"}:(a.includes("cod")||a.includes("payment"))&&(s={title:"\uD83D\uDCB3 How COD Order Verification Works:",trigger:"Triggers instantly when a customer places a Cash on Delivery (COD) order.",delay:"Set to 0 minutes for instant order confirmation and 1-click confirmation reply.",variables:"Useful tags: {{customer_first_name}}, {{order_number}}, {{currency}}, {{total_price}}",color:"#0f5132",bg:"#d1e7dd",border:"#badbcc"}),(0,c.jsxs)("div",{style:{padding:"12px 16px",marginBottom:"15px",background:s.bg,border:"1px solid ".concat(s.border),borderRadius:"8px",color:s.color,fontSize:"12px",lineHeight:"1.4"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:s.title}),(0,c.jsxs)("ul",{style:{margin:"6px 0 0 16px",padding:0},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("li",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Trigger Event:"})," ",s.trigger]}),(0,c.jsxs)("li",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Wait Delay:"})," ",s.delay]}),(0,c.jsxs)("li",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"Variables:"})," ",s.variables]})]})]})})(),(0,c.jsxs)("div",{style:{marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Trigger Store Event:"}),(0,c.jsxs)("select",{value:ah.trigger_event||"order.created",onChange:e=>ag({...ah,trigger_event:e.target.value}),style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ccc",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("option",{value:"cart.abandoned",className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDED2 Abandoned Cart (Recovery)"}),(0,c.jsx)("option",{value:"order.created",className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDECD️ New Order Placed"}),(0,c.jsx)("option",{value:"order.updated",className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCE6 Order Status Changed / Updated"}),(0,c.jsx)("option",{value:"order.fulfilled",className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDE9A Order Shipped / Tracking Info Added"}),(0,c.jsx)("option",{value:"order.delivered",className:"jsx-d52c1ba2e6fc146b",children:"\uD83C\uDF81 Order Delivered Confirmation"}),(0,c.jsx)("option",{value:"order.cancelled",className:"jsx-d52c1ba2e6fc146b",children:"❌ Order Cancelled / Refunded"}),(0,c.jsx)("option",{value:"customer.created",className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDC64 New Customer Account Registered"})]})]}),(0,c.jsxs)("div",{style:{marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Wait Delay (Minutes):"}),(0,c.jsx)("input",{type:"number",value:ah.wait_delay_minutes,onChange:e=>ag({...ah,wait_delay_minutes:Number(e.target.value)}),style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ccc"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("span",{style:{fontSize:"11px",color:"#777"},className:"jsx-d52c1ba2e6fc146b",children:"Enter 0 for instant, 30 for 30m, 1440 for 24h, 10080 for 7 days."})]}),(0,c.jsxs)("div",{style:{marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Channel:"}),(0,c.jsxs)("select",{value:ah.action_channel,onChange:e=>ag({...ah,action_channel:e.target.value}),style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ccc"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("option",{value:"whatsapp",className:"jsx-d52c1ba2e6fc146b",children:"WhatsApp Message"}),(0,c.jsx)("option",{value:"email",className:"jsx-d52c1ba2e6fc146b",children:"Email"}),(0,c.jsx)("option",{value:"both",className:"jsx-d52c1ba2e6fc146b",children:"Both (WhatsApp + Email)"})]})]}),("whatsapp"===ah.action_channel||"both"===ah.action_channel)&&(0,c.jsxs)(c.Fragment,{children:[ao&&(ao.official_connected||ao.device_connected||ao.sessions&&0!==ao.sessions.length)?(0,c.jsxs)("div",{style:{padding:"8px 12px",background:"#d4edda",borderRadius:"6px",color:"#155724",fontSize:"12px",marginBottom:"15px",display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"✅ WhatsApp API Connected & Active"}),(0,c.jsx)("span",{style:{fontSize:"11px",color:"#166534",fontWeight:"600"},className:"jsx-d52c1ba2e6fc146b",children:(null==ao?void 0:ao.official_connected)?"Official Meta Cloud API":"Device Session (0 Approvals Needed)"})]}):(0,c.jsxs)("div",{style:{padding:"12px 15px",marginBottom:"15px",borderRadius:"6px",background:"#fff3cd",border:"1px solid #ffeeba",color:"#856404",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:"⚠️ WhatsApp API Not Connected!"}),(0,c.jsx)("p",{style:{margin:"4px 0 8px",fontSize:"12px"},className:"jsx-d52c1ba2e6fc146b",children:"Your WhatsApp API is currently disconnected. Connect your account in settings before WhatsApp messages can be sent automatically."}),(0,c.jsx)("a",{href:"/whatsapp",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"6px 12px",background:"#25d366",color:"#fff",fontWeight:"bold",borderRadius:"4px",textDecoration:"none",fontSize:"12px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD17 Connect WhatsApp API & Settings ↗"})]}),(0,c.jsxs)("div",{style:{marginBottom:"20px",padding:"16px",borderRadius:"10px",background:"#f8fafc",border:"1px solid #e2e8f0",boxShadow:"0 1px 3px rgba(0,0,0,0.03)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px",flexWrap:"wrap",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{fontWeight:"bold",fontSize:"13px",color:"#0f172a"},className:"jsx-d52c1ba2e6fc146b",children:"Official Meta WhatsApp Template (Required):"}),(0,c.jsx)("span",{style:{display:"block",fontSize:"11.5px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"Official Meta API strictly requires pre-approved templates for all outbound store notifications"})]}),(()=>{let e=an.find(e=>e.name===ah.meta_template_name),a=e?e.status||"APPROVED":ah.selected_template_status||(ah.meta_template_name?"APPROVED":null);return ah.meta_template_name?(0,c.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"APPROVED"===a?"#d4edda":"PENDING"===a?"#fef3c7":"#fee2e2",color:"APPROVED"===a?"#155724":"PENDING"===a?"#92400e":"#991b1b",border:"1px solid ".concat("APPROVED"===a?"#86efac":"PENDING"===a?"#fde68a":"#fca5a5")},className:"jsx-d52c1ba2e6fc146b",children:"APPROVED"===a?"✅ APPROVED BY META":"PENDING"===a?"\uD83D\uDFE1 PENDING META APPROVAL":"\uD83D\uDD34 REJECTED BY META"}):(0,c.jsx)("span",{style:{padding:"3px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"bold",background:"#fef2f2",color:"#991b1b",border:"1px solid #fca5a5"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD34 Template Required (Official Meta API)"})})()]}),(0,c.jsxs)("select",{value:ah.meta_template_name||"",onChange:e=>{let a=e.target.value;if(a){let e=an.find(e=>e.name===a);if(e){var s,c,t;let a=e.body_text&&e.body_text.trim()?e.body_text.trim():(null===(c=e.components)||void 0===c?void 0:null===(s=c.find(e=>"BODY"===String(e.type||"").toUpperCase()))||void 0===s?void 0:s.text)||e.name,r=e.sample_media_url||e.media_url||"",o=String(e.header_type||"NONE").toUpperCase(),l=null===(t=e.components)||void 0===t?void 0:t.find(e=>"HEADER"===String(e.type||"").toUpperCase()),n=l?String(l.format||"").toUpperCase():"NONE",i=["IMAGE","VIDEO","DOCUMENT"].includes("NONE"!==o?o:n);ag({...ah,meta_template_name:e.name,message_template:a,media_url:i&&(r||ah.media_url)||"",has_media_header:i,selected_template_status:e.status||"APPROVED"})}}else ag({...ah,meta_template_name:"",has_media_header:!1,selected_template_status:""})},style:{width:"100%",padding:"9px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"13px",background:"#fff",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("option",{value:"",className:"jsx-d52c1ba2e6fc146b",children:"-- Select Approved Meta Template (Required for Official API) --"}),an.map(e=>(0,c.jsxs)("option",{value:e.name,className:"jsx-d52c1ba2e6fc146b",children:[e.name," (",e.language||e.language_code||"en",") — ","APPROVED"!==e.status&&e.status?"PENDING"===e.status?"\uD83D\uDFE1 Pending Approval":"\uD83D\uDD34 Rejected":"✅ Approved"]},e.id||e.name))]}),Z&&(()=>{let e=an.find(e=>e.name===ah.meta_template_name);return"REJECTED"===(e?e.status||"APP
1ROVED":ah.selected_template_status)?null:(0,c.jsx)("div",{style:{padding:"8px 12px",borderRadius:"6px",background:"#ecfdf5",border:"1px solid #a7f3d0",color:"#065f46",fontSize:"12px",marginBottom:"10px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:Z})})})(),ea&&(0,c.jsx)("div",{style:{padding:"8px 12px",borderRadius:"6px",background:"#fef2f2",border:"1px solid #fecaca",color:"#991b1b",fontSize:"12px",marginBottom:"10px",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:ea})}),(()=>{let e=an.find(e=>e.name===ah.meta_template_name);return"PENDING"!==(e?e.status||"APPROVED":ah.selected_template_status)?null:(0,c.jsxs)("div",{style:{padding:"10px 14px",borderRadius:"8px",background:"#fffbeb",border:"1px solid #fde68a",marginBottom:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"12.5px",color:"#92400e",display:"block"},className:"jsx-d52c1ba2e6fc146b",children:"⏳ Under Review by Meta"}),(0,c.jsx)("span",{style:{fontSize:"11.5px",color:"#b45309"},className:"jsx-d52c1ba2e6fc146b",children:"Meta typically reviews within 1–15 minutes. Once approved, it will be automatically selected."})]}),(0,c.jsxs)("button",{type:"button",onClick:aU,disabled:K,style:{padding:"6px 14px",borderRadius:"6px",background:"#d97706",color:"#fff",border:"none",fontSize:"12px",fontWeight:"bold",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px",boxShadow:"0 1px 2px rgba(0,0,0,0.1)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{display:"inline-block",transform:K?"rotate(360deg)":"none",transition:"transform 0.5s"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD04"}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:K?"Checking Meta...":"Check Approval Status"})]})]})})(),(()=>{let e=an.find(e=>e.name===ah.meta_template_name);return"APPROVED"===(e?e.status||"APPROVED":ah.selected_template_status)&&ah.meta_template_name?(0,c.jsx)("div",{style:{padding:"10px 14px",borderRadius:"8px",background:"#f0fdf4",border:"1px solid #bbf7d0",marginBottom:"12px",display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"12.5px",color:"#166534",display:"block"},className:"jsx-d52c1ba2e6fc146b",children:"✅ Meta Approved & Active"}),(0,c.jsx)("span",{style:{fontSize:"11.5px",color:"#15803d"},className:"jsx-d52c1ba2e6fc146b",children:"This official template is approved by Meta and ready for automated sending."})]})}):null})(),(()=>{let e=an.find(e=>e.name===ah.meta_template_name);return"REJECTED"!==(e?e.status||"APPROVED":ah.selected_template_status)?null:(0,c.jsxs)("div",{style:{padding:"12px 14px",borderRadius:"8px",background:"#fef2f2",border:"1px solid #fca5a5",marginBottom:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"3px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("strong",{style:{fontSize:"13px",color:"#991b1b"},className:"jsx-d52c1ba2e6fc146b",children:"❌ Meta Approval Failed"}),(null==e?void 0:e.rejected_reason)&&(0,c.jsxs)("span",{style:{fontSize:"11px",background:"#fee2e2",color:"#b91c1c",padding:"2px 8px",borderRadius:"4px",fontWeight:"bold",border:"1px solid #f87171"},className:"jsx-d52c1ba2e6fc146b",children:["Reason: ",e.rejected_reason]})]}),(0,c.jsxs)("span",{style:{fontSize:"12px",color:"#7f1d1d"},className:"jsx-d52c1ba2e6fc146b",children:["Template was rejected by Meta. Please review the template and click ",(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:'"Retry Meta Approval"'})," below to re-submit."]})]}),(0,c.jsx)("button",{type:"button",onClick:()=>{et(!0),eo(ah.meta_template_name||er),en((ah.rule_key||"").includes("abandoned")||(ah.rule_key||"").includes("welcome")||"cart.abandoned"===(ah.trigger_event||"")?"MARKETING":"UTILITY")},style:{padding:"7px 14px",borderRadius:"6px",background:"#dc2626",color:"#fff",border:"none",fontSize:"12px",fontWeight:"bold",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px",boxShadow:"0 1px 2px rgba(0,0,0,0.1)"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD04 Retry Meta Approval"})})]})})(),(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{et(!ec),er||(eo(String(ah.rule_key||ah.name||"template").toLowerCase().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").slice(0,45)),en((ah.rule_key||"").includes("abandoned")||(ah.rule_key||"").includes("welcome")||"cart.abandoned"===(ah.trigger_event||"")?"MARKETING":"UTILITY"))},style:{padding:"7px 14px",borderRadius:"6px",background:ec?"#e2e8f0":"#0284c7",color:ec?"#334155":"#ffffff",border:"none",fontSize:"12px",fontWeight:"bold",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:ec?"✕ Cancel Submission":(()=>{let e=an.find(e=>e.name===ah.meta_template_name);return"REJECTED"===(e?e.status||"APPROVED":ah.selected_template_status)?"\uD83D\uDD04 Retry Meta Approval":"\uD83D\uDCE4 Send for Official Meta Approval"})()})}),(0,c.jsxs)("button",{type:"button",onClick:aU,disabled:K,style:{padding:"7px 12px",borderRadius:"6px",background:"#ffffff",color:"#475569",border:"1px solid #cbd5e1",fontSize:"12px",fontWeight:"600",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"5px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{display:"inline-block",transform:K?"rotate(360deg)":"none",transition:"transform 0.5s"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDD04"}),(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:K?"Syncing...":"Sync from Meta"})]})]}),ec&&(0,c.jsxs)("div",{style:{marginTop:"14px",padding:"14px",borderRadius:"8px",background:"#ffffff",border:"1px solid #93c5fd",boxShadow:"0 2px 8px rgba(2,132,199,0.08)"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h4",{style:{margin:"0 0 10px",fontSize:"13.5px",color:"#0369a1",display:"flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDE80 Submit Template to Meta Graph API"})}),(0,c.jsx)("p",{style:{margin:"0 0 12px",fontSize:"12px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:"This submits your message text below directly to Meta for review. Once Meta approves, it will be automatically selected for this automation!"}),(0,c.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px",marginBottom:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"11.5px",fontWeight:"bold",color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:"Meta Template Name:"}
1),(0,c.jsx)("input",{type:"text",value:er,onChange:e=>eo(e.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"e.g. order_shipped_alert",style:{width:"100%",padding:"7px 10px",borderRadius:"4px",border:"1px solid #cbd5e1",fontSize:"12px",fontFamily:"monospace"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("small",{style:{color:"#94a3b8",fontSize:"10.5px"},className:"jsx-d52c1ba2e6fc146b",children:"Only lowercase letters, numbers, and underscores."})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontSize:"11.5px",fontWeight:"bold",color:"#334155",marginBottom:"4px"},className:"jsx-d52c1ba2e6fc146b",children:"Category:"}),(0,c.jsxs)("select",{value:el,onChange:e=>en(e.target.value),style:{width:"100%",padding:"7px 10px",borderRadius:"4px",border:"1px solid #cbd5e1",fontSize:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("option",{value:"UTILITY",className:"jsx-d52c1ba2e6fc146b",children:"UTILITY (Order, Shipping, COD Alerts)"}),(0,c.jsx)("option",{value:"MARKETING",className:"jsx-d52c1ba2e6fc146b",children:"MARKETING (Abandoned Cart, Offers, Welcome)"})]}),(0,c.jsx)("small",{style:{color:"#94a3b8",fontSize:"10.5px"},className:"jsx-d52c1ba2e6fc146b",children:"Utility templates review fastest."})]})]}),(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>et(!1),style:{padding:"7px 14px",borderRadius:"4px",border:"1px solid #cbd5e1",background:"#ffffff",color:"#334155",fontWeight:"600",fontSize:"12px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"✕ Cancel"}),(0,c.jsx)("button",{type:"button",onClick:aM,disabled:Q,style:{padding:"7px 16px",borderRadius:"4px",border:"none",background:"#0284c7",color:"#fff",fontSize:"12px",fontWeight:"bold",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:Q?"Submitting to Meta...":"Submit to Meta for Approval Now"})})]})]})]})]}),(!ah.meta_template_name||ah.has_media_header||ah.media_url)&&(0,c.jsxs)("div",{style:{marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:ah.has_media_header?"\uD83D\uDCCE Required Template Media Header Attachment:":"Header Media / Attachment File (Optional):"}),(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("input",{type:"file",id:"automationMediaFileInput",accept:"image/*,video/*,application/pdf",style:{display:"none"},onChange:async e=>{let a=e.target.files[0];if(a){aN(!0);try{let e=new FormData;e.append("file",a);let s=await (0,b.S)("/shopify/automation-rules/upload-attachment",{method:"POST",body:e});s.url&&(ag({...ah,media_url:s.url}),eC("File attachment uploaded successfully!"))}catch(e){eR(e.message||"Failed to upload file attachment.")}finally{aN(!1)}}},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("button",{type:"button",onClick:()=>document.getElementById("automationMediaFileInput").click(),disabled:ay,style:{padding:"8px 14px",background:"#0070f3",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer",fontWeight:"600",fontSize:"12px"},className:"jsx-d52c1ba2e6fc146b",children:ay?"Uploading File...":"\uD83D\uDCC1 Upload Image / Video / PDF Attachment"})]}),ah.media_url&&(0,c.jsxs)("div",{style:{marginTop:"8px",padding:"8px",background:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef",display:"flex",alignItems:"center",gap:"10px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{style:{fontSize:"12px",fontWeight:"bold"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCCE Attachment:"}),ah.media_url.match(/\.(jpeg|jpg|gif|png|webp)$/i)?(0,c.jsx)("img",{src:ah.media_url,alt:"Attachment Preview",style:{maxHeight:"50px",borderRadius:"4px",objectFit:"cover"},className:"jsx-d52c1ba2e6fc146b"}):(0,c.jsx)("a",{href:ah.media_url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"12px",color:"#0070f3"},className:"jsx-d52c1ba2e6fc146b",children:"View File Attachment ↗"}),(0,c.jsx)("button",{type:"button",onClick:()=>ag({...ah,media_url:""}),style:{marginLeft:"auto",padding:"2px 6px",fontSize:"11px",background:"#ff4d4f",color:"#fff",border:"none",borderRadius:"3px",cursor:"pointer"},className:"jsx-d52c1ba2e6fc146b",children:"Remove"})]})]}),(0,c.jsxs)("div",{style:{marginBottom:"15px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("label",{style:{display:"block",fontWeight:"bold",marginBottom:"5px",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Message Content / Template Text:"}),(0,c.jsx)("textarea",{id:"automationTemplateTextarea",rows:4,value:ah.message_template,onChange:e=>ag({...ah,message_template:e.target.value}),style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ccc",fontSize:"13px",fontFamily:"inherit"},className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsxs)("div",{style:{marginTop:"8px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"11.5px",fontWeight:"bold",color:"#334155",marginBottom:"2px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCA1 Click any variable tag to insert into message:"}),(0,c.jsxs)("div",{style:{fontSize:"11px",color:"#64748b",marginBottom:"6px"},className:"jsx-d52c1ba2e6fc146b",children:["Meta rule: Variables cannot be at the very beginning or end of text. Always surround with words (e.g. ",(0,c.jsx)("code",{className:"jsx-d52c1ba2e6fc146b",children:"Click {{cart_url}} to complete order"}),")."]}),(0,c.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"5px"}
1,className:"jsx-d52c1ba2e6fc146b",children:["{{1}}","{{2}}","{{3}}","{{customer_first_name}}","{{customer_name}}","{{store_title}}","{{order_number}}","{{total_price}}","{{currency}}","{{financial_status}}","{{fulfillment_status}}","{{tracking_number}}","{{tracking_url}}","{{cart_url}}","{{store_url}}","{{purchased_item}}","{{recommended_product_name}}","{{recommended_product_url}}"].map(e=>(0,c.jsxs)("button",{type:"button",onClick:()=>{ag({...ah,message_template:(ah.message_template||"")+" "+e})},style:{padding:"3px 7px",borderRadius:"4px",border:"1px solid #cbd5e1",background:"#f1f5f9",color:"#0f172a",fontSize:"11px",fontFamily:"monospace",cursor:"pointer",fontWeight:"500"},title:"Click to insert ".concat(e),className:"jsx-d52c1ba2e6fc146b",children:["+ ",e]},e))})]})]}),(0,c.jsxs)("div",{style:{marginBottom:"15px",padding:"12px",background:"#efeae2",borderRadius:"8px",border:"1px solid #dcd6cd"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("div",{style:{fontSize:"11px",fontWeight:"bold",color:"#075e54",marginBottom:"6px",textTransform:"uppercase",display:"flex",justifyContent:"space-between",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCAC Live WhatsApp Customer Message Preview"}),(0,c.jsx)("span",{style:{fontSize:"10px",color:"#666",textTransform:"none",fontWeight:"normal"},className:"jsx-d52c1ba2e6fc146b",children:"(Populated with store values)"})]}),(0,c.jsxs)("div",{style:{background:"#dcf8c6",padding:"10px 14px",borderRadius:"7px 7px 0 7px",fontSize:"13px",lineHeight:"1.4",color:"#333",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},className:"jsx-d52c1ba2e6fc146b",children:[ah.media_url&&(0,c.jsx)("div",{style:{marginBottom:"6px",fontWeight:"bold",fontSize:"11px",color:"#075e54"},className:"jsx-d52c1ba2e6fc146b",children:"[ \uD83D\uDCCE Attached Media Header ]"}),(0,c.jsx)("div",{style:{whiteSpace:"pre-wrap"},className:"jsx-d52c1ba2e6fc146b",children:(()=>{let e=ah.message_template||"Template message preview will appear here...";for(let[a,s]of Object.entries({"{{customer_first_name}}":"John","{{customer_name}}":"John Doe","{{store_title}}":"My Store","{{order_number}}":"1008","{{total_price}}":"149.00","{{currency}}":"USD","{{financial_status}}":"paid","{{fulfillment_status}}":"shipped","{{tracking_number}}":"TRK987654321","{{tracking_url}}":"https://mystore.com/track/1008","{{cart_url}}":"https://mystore.com/cart/ab123","{{store_url}}":"https://mystore.com","{{purchased_item}}":"Wireless Bluetooth Headphones","{{recommended_product_name}}":"Fast Wireless Charging Pad","{{recommended_product_price}}":"$29.99","{{recommended_product_url}}":"https://mystore.com/products/charger"}))e=e.replace(RegExp(a.replace(/[{}]/g,"\\$&"),"g"),s);return e})()})]})]})]}),(0,c.jsxs)("div",{style:{padding:"14px 24px",borderTop:"1px solid #e9ecef",background:"#f8f9fa",display:"flex",justifyContent:"flex-end",gap:"12px"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("button",{type:"button",onClick:()=>ag(null),style:{padding:"9px 18px",borderRadius:"6px",border:"1px solid #d1d5db",background:"#ffffff",color:"#374151",fontWeight:"600",cursor:"pointer",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Cancel"}),(0,c.jsx)("button",{onClick:()=>{if(!ah.meta_template_name){es("Official Meta WhatsApp API requires an approved template. Please select an approved template or click 'Send for Official Meta Approval' below.");return}aV({rule_id:ah.id,trigger_event:ah.trigger_event,wait_delay_minutes:ah.wait_delay_minutes,action_channel:ah.action_channel,message_template:ah.message_template,media_url:ah.media_url,meta_template_name:ah.meta_template_name})},style:{padding:"9px 20px",borderRadius:"6px",border:"none",background:"#0070f3",color:"#fff",fontWeight:"bold",cursor:"pointer",fontSize:"13px",boxShadow:"0 2px 4px rgba(0,112,243,0.3)"},className:"jsx-d52c1ba2e6fc146b",children:"Save Changes"})]})]})})]}),"analytics"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16
1px"},className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0},className:"jsx-d52c1ba2e6fc146b",children:"Sales Performance Conversions"}),(0,c.jsx)("p",{style:{margin:"4px 0 0",color:"#64748b",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Real-time conversion tracking across connected storefronts"})]})}),e9?(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b overviewStats",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b analyticsMetric",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b analyticsTitle",children:"Total Sales Orders Mapped"}),(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b analyticsNum",children:V.length})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b analyticsMetric",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b analyticsTitle",children:"WhatsApp Broadcast Conversions"}),(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b analyticsNum",children:V.length>0?"42.8%":"0%"})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b analyticsMetric",children:[(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b analyticsTitle",children:"Failed Checkouts Recovered"}),(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b analyticsNum",children:V.length>0?"16.4%":"0%"})]})]}):(0,c.jsxs)("div",{style:{textAlign:"center",padding:"40px 20px",color:"#64748b"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("div",{style:{fontSize:"28px",marginBottom:"8px"},className:"jsx-d52c1ba2e6fc146b",children:"\uD83D\uDCCA"}),(0,c.jsx)("div",{style:{fontWeight:600,color:"#334155",marginBottom:"4px",fontSize:"15px"},className:"jsx-d52c1ba2e6fc146b",children:"No store connected"}),(0,c.jsx)("div",{style:{fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Connect your store to start tracking sales metrics, conversion rates, and checkout recoveries."})]})]}),"logs"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"12px"},className:"jsx-d52c1ba2e6fc146b logsHeader",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("h3",{style:{margin:0},className:"jsx-d52c1ba2e6fc146b",children:"Sync Logs History"}),(0,c.jsx)("p",{style:{margin:"4px 0 0",color:"#64748b",fontSize:"13px"},className:"jsx-d52c1ba2e6fc146b",children:"Audit record of all manual and automatic background sync tasks"})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:"10px",alignItems:"center"},className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",cursor:"pointer",padding:"8px 16px",borderRadius:"8px",fontWeight:"600",fontSize:"13px"},onClick:async()=>{eh(!0),await aT(),setTimeout(()=>eh(!1),500)},disabled:ej||em,className:"jsx-d52c1ba2e6fc146b btn btnSecondary",children:[(0,c.jsx)("span",{style:{display:"inline-block",transform:ej?"rotate(360deg)":"none",transition:"transform 0.5s ease"},className:"jsx-d52c1ba2e6fc146b",children:"↻"}),ej||em?"Refreshing...":"Refresh Logs"]}),L.length>0&&(0,c.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",cursor:"pointer",padding:"8px 16px",borderRadius:"8px",fontWeight:"600",fontSize:"13px"},onClick:()=>aG(L[0].id),disabled:eg===L[0].id,className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:["⚡ ",eg===L[0].id?"Syncing Store...":"Sync Store Now"]})]})]}),(0,c.jsx)("div",{className:"jsx-d52c1ba2e6fc146b tableContainer",children:(0,c.jsxs)("table",{className:"jsx-d52c1ba2e6fc146b logsTable",children:[(0,c.jsx)("thead",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Store"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Sync Type"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Source"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Success"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Failed"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Status"}),(0,c.jsx)("th",{className:"jsx-d52c1ba2e6fc146b",children:"Timestamp"})]})}),(0,c.jsxs)("tbody",{className:"jsx-d52c1ba2e6fc146b",children:[J.map(e=>(0,c.jsxs)("tr",{className:"jsx-d52c1ba2e6fc146b",children:[(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("strong",{className:"jsx-d52c1ba2e6fc146b",children:e.shop_title})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b capitalize",children:e.sync_type}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b capitalize",children:e.sync_source}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.records_processed}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:e.records_failed}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("span",{className:"jsx-d52c1ba2e6fc146b "+"statusBadge ".concat(e.status),children:e.status})}),(0,c.jsx)("td",{className:"jsx-d52c1ba2e6fc146b",children:new Date(e.created_at).toLocaleStr
1ing()})]},e.id)),0===J.length&&(0,c.jsx)("tr",{className:"jsx-d52c1ba2e6fc146b",children:(0,c.jsx)("td",{colSpan:"7",className:"jsx-d52c1ba2e6fc146b emptyState",children:e9?"No sync logs recorded yet. Run a manual sync to populate.":"No store connected. Connect a store to view sync history."})})]})]})})]}),"settings"===T&&(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b panelCard",children:[(0,c.jsx)("h3",{className:"jsx-d52c1ba2e6fc146b",children:"Commerce Settings"}),(0,c.jsxs)("form",{onSubmit:function(e){e.preventDefault(),localStorage.setItem("leadsflyer_commerce_settings",JSON.stringify(e8)),eC("Settings saved successfully.")},className:"jsx-d52c1ba2e6fc146b settingsForm",children:[(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Default Currency"}),(0,c.jsxs)("select",{value:e8.currency,onChange:e=>e3(a=>({...a,currency:e.target.value})),className:"jsx-d52c1ba2e6fc146b syncSelect",children:[(0,c.jsx)("option",{value:"USD",className:"jsx-d52c1ba2e6fc146b",children:"USD ($)"}),(0,c.jsx)("option",{value:"INR",className:"jsx-d52c1ba2e6fc146b",children:"INR (₹)"}),(0,c.jsx)("option",{value:"EUR",className:"jsx-d52c1ba2e6fc146b",children:"EUR (€)"}),(0,c.jsx)("option",{value:"GBP",className:"jsx-d52c1ba2e6fc146b",children:"GBP (\xa3)"})]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Language Locale"}),(0,c.jsxs)("select",{value:e8.language,onChange:e=>e3(a=>({...a,language:e.target.value})),className:"jsx-d52c1ba2e6fc146b syncSelect",children:[(0,c.jsx)("option",{value:"en_US",className:"jsx-d52c1ba2e6fc146b",children:"English (United States)"}),(0,c.jsx)("option",{value:"en_GB",className:"jsx-d52c1ba2e6fc146b",children:"English (United Kingdom)"}),(0,c.jsx)("option",{value:"hi_IN",className:"jsx-d52c1ba2e6fc146b",children:"Hindi (India)"})]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Timezone"}),(0,c.jsxs)("select",{value:e8.timezone,onChange:e=>e3(a=>({...a,timezone:e.target.value})),className:"jsx-d52c1ba2e6fc146b syncSelect",children:[(0,c.jsx)("option",{value:"America/New_York",className:"jsx-d52c1ba2e6fc146b",children:"Eastern Time (EST)"}),(0,c.jsx)("option",{value:"Asia/Kolkata",className:"jsx-d52c1ba2e6fc146b",children:"India Standard Time (IST)"}),(0,c.jsx)("option",{value:"UTC",className:"jsx-d52c1ba2e6fc146b",children:"Coordinated Universal Time (UTC)"})]})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup",children:[(0,c.jsx)("label",{className:"jsx-d52c1ba2e6fc146b",children:"Default Dispatch WhatsApp Number"}),(0,c.jsx)("input",{type:"text",value:e8.defaultWhatsAppNumber,placeholder:"e.g. +1 555 123 4567",onChange:e=>e3(a=>({...a,defaultWhatsAppNumber:e.target.value})),style:{padding:"10px",borderRadius:"8px",border:"1px solid #cbd5e1"},className:"jsx-d52c1ba2e6fc146b"})]}),(0,c.jsxs)("div",{className:"jsx-d52c1ba2e6fc146b formGroup checkGroup",children:[(0,c.jsx)("input",{type:"checkbox",id:"enableEvents",checked:e8.enableEvents,onChange:e=>e3(a=>({...a,enableEvents:e.target.checked})),className:"jsx-d52c1ba2e6fc146b"}),(0,c.jsx)("label",{htmlFor:"enableEvents",className:"jsx-d52c1ba2e6fc146b",children:"Globally enable active integration events execution"})]}),(0,c.jsx)("button",{type:"submit",className:"jsx-d52c1ba2e6fc146b btn btnPrimary",children:"Save Settings"})]})]})]})]})]}),(0,c.jsx)(r(),{id:"d52c1ba2e6fc146b",children:'.commerceContainer.jsx-d52c1ba2e6fc146b{padding:24px;max-width:1400px;margin:0 auto}.commerceHeader.jsx-d52c1ba2e6fc146b{margin-bottom:24px}.commerceTitle.jsx-d52c1ba2e6fc146b h1.jsx-d52c1ba2e6fc146b{font-size:28px;font-weight:800;color:#0f172a;margin:0 0 6px}.commerceTitle.jsx-d52c1ba2e6fc146b p.jsx-d52c1ba2e6fc146b{color:#64748b;font-size:14px;margin:0}.statusAlert.jsx-d52c1ba2e6fc146b{padding:14px 18px;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;margin-bottom:20px;font-size:14px;font-weight:600}.statusAlert.success.jsx-d52c1ba2e6fc146b{background:rgba(16,185,129,.08);border:1px solid rgba(16,185,129,.16);color:#10b981}.statusAlert.error.jsx-d52c1ba2e6fc146b{background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.16);color:#ef4444}.emptyStoreBanner.jsx-d52c1ba2e6fc146b{background:-webkit-linear-gradient(315deg,#f8fafc 0%,#f1f5f9 100%);background:-moz-linear-gradient(315deg,#f8fafc 0%,#f1f5f9 100%);background:-o-linear-gradient(315deg,#f8fafc 0%,#f1f5f9 100%);background:linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);border:1px dashed#cbd5e1;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;padding:18px 24px;margin-bottom:24px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;
1-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}.emptyStoreContent.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:16px}.emptyStoreIcon.jsx-d52c1ba2e6fc146b{width:44px;height:44px;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;background:#fff;border:1px solid#e2e8f0;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#088494;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.04);-moz-box-shadow:0 2px 4px rgba(0,0,0,.04);box-shadow:0 2px 4px rgba(0,0,0,.04);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0}.emptyStoreContent.jsx-d52c1ba2e6fc146b h4.jsx-d52c1ba2e6fc146b{margin:0 0 3px;font-size:15px;font-weight:700;color:#0f172a}.emptyStoreContent.jsx-d52c1ba2e6fc146b p.jsx-d52c1ba2e6fc146b{margin:0;font-size:13px;color:#64748b;max-width:600px}.dashboardGrid.jsx-d52c1ba2e6fc146b{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:28px}@media(max-width:1100px){.dashboardGrid.jsx-d52c1ba2e6fc146b{grid-template-columns:repeat(2,1fr)}}@media(max-width:640px){.dashboardGrid.jsx-d52c1ba2e6fc146b{grid-template-columns:1fr}}.metricCard.jsx-d52c1ba2e6fc146b{background:#fff;border:1px solid#e2e8f0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;padding:20px 22px;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.04),0 1px 2px -1px rgba(0,0,0,.04);-moz-box-shadow:0 1px 3px 0 rgba(0,0,0,.04),0 1px 2px -1px rgba(0,0,0,.04);box-shadow:0 1px 3px 0 rgba(0,0,0,.04),0 1px 2px -1px rgba(0,0,0,.04);-webkit-transition:all.2s cubic-bezier(.16,1,.3,1);-moz-transition:all.2s cubic-bezier(.16,1,.3,1);-o-transition:all.2s cubic-bezier(.16,1,.3,1);transition:all.2s cubic-bezier(.16,1,.3,1);display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;position:relative;overflow:hidden}.metricCard.jsx-d52c1ba2e6fc146b:hover{-webkit-transform:translatey(-2px);-moz-transform:translatey(-2px);-ms-transform:translatey(-2px);-o-transform:translatey(-2px);transform:translatey(-2px);border-color:#cbd5e1;-webkit-box-shadow:0 10px 15px -3px rgba(0,0,0,.06),0 4px 6px -4px rgba(0,0,0,.04);-moz-box-shadow:0 10px 15px -3px rgba(0,0,0,.06),0 4px 6px -4px rgba(0,0,0,.04);box-shadow:0 10px 15px -3px rgba(0,0,0,.06),0 4px 6px -4px rgba(0,0,0,.04)}.metricHeader.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:12px}.metricTitle.jsx-d52c1ba2e6fc146b{font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#64748b}.metricIconBadge.jsx-d52c1ba2e6fc146b{width:36px;height:36px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;
1-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:-webkit-transform.2s ease;-moz-transition:-moz-transform.2s ease;-o-transition:-o-transform.2s ease;transition:-webkit-transform.2s ease;transition:-moz-transform.2s ease;transition:-o-transform.2s ease;transition:transform.2s ease}.metricCard.jsx-d52c1ba2e6fc146b:hover .metricIconBadge.jsx-d52c1ba2e6fc146b{-webkit-transform:scale(1.05);-moz-transform:scale(1.05);-ms-transform:scale(1.05);-o-transform:scale(1.05);transform:scale(1.05)}.metricValue.jsx-d52c1ba2e6fc146b{font-size:28px;font-weight:800;color:#0f172a;letter-spacing:-.02em;line-height:1.2;margin-bottom:6px}.metricLabel.jsx-d52c1ba2e6fc146b{font-size:12.5px;color:#64748b;font-weight:500;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:6px}.tabBadge.jsx-d52c1ba2e6fc146b{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:2px 7px;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;font-size:11px;font-weight:700;background:#e2e8f0;color:#475569;margin-left:6px}.tab.active.jsx-d52c1ba2e6fc146b .tabBadge.jsx-d52c1ba2e6fc146b{background:#0284c7;color:#fff}.dashboardTabContent.jsx-d52c1ba2e6fc146b{margin-top:6px}.tabs.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:8px;border-bottom:1px solid#e2e8f0;margin-bottom:24px;overflow-x:auto;scrollbar-width:none}.tabs.jsx-d52c1ba2e6fc146b::-webkit-scrollbar{display:none}.tab.jsx-d52c1ba2e6fc146b{background:transparent;border:none;border-bottom:2px solid transparent;padding:10px 16px;font-size:14px;font-weight:600;color:#64748b;cursor:pointer;-webkit-transition:all.18s ease;-moz-transition:all.18s ease;-o-transition:all.18s ease;transition:all.18s ease;white-space:nowrap}.tab.jsx-d52c1ba2e6fc146b:hover{color:#088494}.tab.active.jsx-d52c1ba2e6fc146b{color:#088494;border-bottom-color:#088494}.panelCard.jsx-d52c1ba2e6fc146b{background:#fff;border:1px solid#e2e8f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;padding:24px;-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.05);-moz-box-shadow:0 4px 6px -1px rgba(0,0,0,.05);box-shadow:0 4px 6px -1px rgba(0,0,0,.05);margin-bottom:20px}.panelCard.jsx-d52c1ba2e6fc146b h3.jsx-d52c1ba2e6fc146b{margin:0 0 16px;font-size:18px;font-weight:800;color:#0f172a}.storesPanel.jsx-d52c1ba2e6fc146b{display:grid;grid-template-columns:1fr;gap:20px}@media(min-width:900px){.storesPanel.jsx-d52c1ba2e6fc146b{grid-template-columns:320px 1fr}}.connectForm.jsx-d52c1ba2e6fc146b,.settingsForm.jsx-d52c1ba2e6fc146b{display:grid;gap:16px}.formGroup.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:6px}.formGroup.jsx-d52c1ba2e6fc146b label.jsx-d52c1ba2e6fc146b{font-size:12px;font-weight:700;color:#475569}.formGroup.jsx-d52c1ba2e6fc146b input[type="text"].jsx-d52c1ba2e6fc146b{padding:10px 14px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;border:1px solid#cbd5e1;font-size:14px;outline:none}.formGroup.jsx-d52c1ba2e6fc146b input[type="text"].jsx-d52c1ba2e6fc146b:focus{border-color:#088494}.formGroup.jsx-d52c1ba2e6fc146b small.jsx-d52c1ba2e6fc146b{color:#64748b;font-size:11px}.checkGroup.jsx-d52c1ba2e6fc146b{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;gap:10px;margin-bottom:12px}.checkGroup.jsx-d52c1ba2e6fc146b input.jsx-d52c1ba2e6fc146b{width:18px;height:18px;accent-color:#088494}.btn.jsx-d52c1ba2e6fc146b{padding:10px 16px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;font-size:14px;font-weight:600;border:1px solid transparent;cursor:pointer;-webkit-transition:all.18s ease;-moz-transition:all.18s ease;-o-transition:all.18s ease;transition:all.18s ease;display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;
1-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center}.btnPrimary.jsx-d52c1ba2e6fc146b{background:#088494;color:#fff}.btnPrimary.jsx-d52c1ba2e6fc146b:hover{background:#066a77}.btnSecondary.jsx-d52c1ba2e6fc146b{background:#f1f5f9;border-color:#e2e8f0;color:#334155}.btnSecondary.jsx-d52c1ba2e6fc146b:hover{background:#e2e8f0}.btnDanger.jsx-d52c1ba2e6fc146b{background:#ef4444;color:#fff}.btnDanger.jsx-d52c1ba2e6fc146b:hover{background:#dc2626}.btnLink.jsx-d52c1ba2e6fc146b{background:transparent;color:#088494;padding:0;border:none;text-decoration:underline}.storeList.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:16px}.storeRow.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:16px;padding:16px;border:1px solid#f1f5f9;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;background:#fafafa}@media(min-width:600px){.storeRow.jsx-d52c1ba2e6fc146b{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}}.storeMeta.jsx-d52c1ba2e6fc146b h4.jsx-d52c1ba2e6fc146b{margin:4px 0;font-size:16px;font-weight:700;color:#1e293b}.storeMeta.jsx-d52c1ba2e6fc146b p.jsx-d52c1ba2e6fc146b{margin:0 0 6px;font-size:13px;color:#64748b}.syncTimestamp.jsx-d52c1ba2e6fc146b{font-size:11px;color:#94a3b8;display:block}.platformBadge.jsx-d52c1ba2e6fc146b{padding:2px 8px;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;font-size:10px;font-weight:800;text-transform:uppercase}.platformBadge.shopify.jsx-d52c1ba2e6fc146b{background:rgba(149,191,71,.12);color:#95bf47}.storeActions.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px}.syncControls.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:8px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.syncSelect.jsx-d52c1ba2e6fc146b{padding:8px 12px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;border:1px solid#cbd5e1;background:#fff;font-size:12px;outline:none}.logsHeader.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:16px}.logsHeader.jsx-d52c1ba2e6fc146b h3.jsx-d52c1ba2e6fc146b{margin:0}.tableContainer.jsx-d52c1ba2e6fc146b{overflow-x:auto}.logsTable.jsx-d52c1ba2e6fc146b{width:100%;border-collapse:collapse;font-size:13px}.logsTable.jsx-d52c1ba2e6fc146b th.jsx-d52c1ba2e6fc146b{text-align:left;padding:10px;background:#f8fafc;border-bottom:1px solid#e2e8f0;color:#64748b;font-weight:700}.logsTable.jsx-d52c1ba2e6fc146b td.jsx-d52c1ba2e6fc146b{padding:12px 10px;border-bottom:1px solid#f1f5f9}.capitalize.jsx-d52c1ba2e6fc146b{text-transform:capitalize}.statusBadge.jsx-d52c1ba2e6fc146b{padding:2px 8px;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;font-size:10px;font-weight:700;text-transform:uppercase}.statusBadge.running.jsx-d52c1ba2e6fc146b{background:rgba(245,158,11,.12);color:#f59e0b}.statusBadge.completed.jsx-d52c1ba2e6fc146b{background:rgba(16,185,129,.12);color:#10b981}.statusBadge.failed.jsx-d52c1ba2e6fc146b{background:rgba(239,68,68,.12);color:#ef4444}.emptyState.jsx-d52c1ba2e6fc146b{text-align:center;padding:40px;color:#94a3b8;font-size:14px}.loadingText.jsx-d52c1ba2e6fc146b{text-align:center;padding:20px;color:#64748b}.automationGrid.jsx-d52c1ba2e6fc146b{display:grid;gap:12px;max-width:600px;margin-top:14px}.automationRow.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;
1-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:12px;border:1px solid#f1f5f9;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.topicLabel.jsx-d52c1ba2e6fc146b code.jsx-d52c1ba2e6fc146b{background:#f1f5f9;padding:4px 8px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;color:#be185d}.switch.jsx-d52c1ba2e6fc146b{position:relative;display:inline-block;width:44px;height:24px}.switch.jsx-d52c1ba2e6fc146b input.jsx-d52c1ba2e6fc146b{opacity:0;width:0;height:0}.slider.jsx-d52c1ba2e6fc146b{position:absolute;cursor:pointer;inset:0;background-color:#cbd5e1;-webkit-transition:.3s;-moz-transition:.3s;-o-transition:.3s;transition:.3s}.slider.jsx-d52c1ba2e6fc146b:before{position:absolute;content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;-moz-transition:.3s;-o-transition:.3s;transition:.3s}input.jsx-d52c1ba2e6fc146b:checked+.slider.jsx-d52c1ba2e6fc146b{background-color:#088494}input.jsx-d52c1ba2e6fc146b:checked+.slider.jsx-d52c1ba2e6fc146b:before{-webkit-transform:translatex(20px);-moz-transform:translatex(20px);-ms-transform:translatex(20px);-o-transform:translatex(20px);transform:translatex(20px)}.slider.round.jsx-d52c1ba2e6fc146b{-webkit-border-radius:34px;-moz-border-radius:34px;border-radius:34px}.slider.round.jsx-d52c1ba2e6fc146b:before{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%}.overviewStats.jsx-d52c1ba2e6fc146b{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;gap:20px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:14px}.analyticsMetric.jsx-d52c1ba2e6fc146b{background:#f8fafc;border:1px solid#e2e8f0;padding:16px;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;-webkit-box-flex:1;-webkit-flex:1 1 200px;-moz-box-flex:1;-ms-flex:1 1 200px;flex:1 1 200px;text-align:center}.analyticsTitle.jsx-d52c1ba2e6fc146b{display:block;font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase}.analyticsNum.jsx-d52c1ba2e6fc146b{display:block;font-size:24px;font-weight:800;color:#088494;margin-top:8px}'})]}):null}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=3133)}),_N_E=e.O()}]);

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.