/* Whanda v2.0.0 | Headless Catalog + WhatsApp Checkout */ (()=>{var j=Object.defineProperty;var H=(r,t)=>()=>(r&&(t=r(r=0)),t);var L=(r,t)=>{for(var e in t)j(r,e,{get:t[e],enumerable:!0})};var T={};L(T,{buildGoogleSheetsCsvUrl:()=>O,loadFromSheets:()=>g,parseCSV:()=>I});function z(r){let t=[],e="",o=!1;for(let i=0;in.trim().toLowerCase()),o=U.filter(n=>!e.includes(n));if(o.length>0)throw new Error(`Missing required columns: ${o.join(", ")}`);let i=[];for(let n=1;n{u[l]=f[p]!=null?f[p].trim():""});let h={id:u.id,name:u.name,price:parseFloat(u.price)||0,stock:parseInt(u.stock,10)||0,category:u.category,image:u.image};for(let l of W)u[l]&&u[l]!==""&&(h[l]=u[l].split(",").map(p=>p.trim()).filter(p=>p!==""));i.push(h)}return i}function O(r){let t=new URL(r);if(t.hostname.includes("docs.google.com")){if(!t.pathname.includes("/export")){let e=t.pathname.match(/\/d\/([^/]+)/);if(e){let o=e[1],i=t.searchParams.get("gid")||"0";return`https://docs.google.com/spreadsheets/d/${o}/export?format=csv&gid=${i}`}}return t.searchParams.set("format","csv"),t.toString()}return r.toString()}async function g(r,t={}){if(!t.proxyUrl&&!t.sheetUrl)throw new Error("loadFromSheets() requires either 'proxyUrl' or 'sheetUrl'");let e;t.proxyUrl?e=t.proxyUrl:e=O(t.sheetUrl);let o=t.timeout||15e3,i=new AbortController,n=setTimeout(()=>i.abort(),o),c;try{c=await fetch(e,{signal:i.signal})}catch(p){throw clearTimeout(n),p.name==="AbortError"?new Error(`Request timed out after ${o}ms`):p}if(clearTimeout(n),!c.ok)throw new Error(`Failed to fetch products: ${c.status} ${c.statusText}`);let f=c.headers.get("content-type")||"",u=await c.text(),h=u;if(f.includes("application/json")){let p;try{p=JSON.parse(u)}catch(F){throw new Error(`Invalid JSON response: ${F.message}`)}if(p.csv)h=p.csv;else if(p.products)return r.setProducts(p.products),p.products}let l=I(h);return r.setProducts(l),l}var U,W,d=H(()=>{U=["id","name","price","stock","category","image"],W=["relatedids","upsellids","crosssellids"]});var s={W001:"search() requiere un texto de b\xFAsqueda",W002:"Producto no encontrado",W003:"La cantidad debe ser un n\xFAmero entero positivo",W004:"Stock insuficiente",W005:"La cantidad debe ser un n\xFAmero entero no negativo",W006:"Producto no encontrado en el carrito",W007:"El c\xF3digo del cup\xF3n debe ser un texto",W008:"Cup\xF3n inv\xE1lido",W009:"El cup\xF3n ha expirado",W010:"El cup\xF3n alcanz\xF3 su l\xEDmite de usos",W011:"Monto m\xEDnimo de orden no alcanzado",W012:"El valor de env\xEDo debe ser un n\xFAmero no negativo",W013:"El umbral de env\xEDo gratis debe ser un n\xFAmero positivo",W014:"El env\xEDo por \xEDtem debe ser un n\xFAmero no negativo",W015:"M\xE9todo de env\xEDo inv\xE1lido",W016:"M\xE9todo de pago inv\xE1lido",W017:"M\xE9todo de entrega inv\xE1lido",W018:"El carrito est\xE1 vac\xEDo",W019:"El nombre del cliente es requerido",W020:"La direcci\xF3n del cliente es requerida",W021:"El m\xE9todo de pago es requerido",W022:"El m\xE9todo de entrega es requerido",W023:"Estado inv\xE1lido",W024:"Orden no encontrada",W025:"N\xFAmero de WhatsApp no configurado",W026:"El n\xFAmero de WhatsApp debe ser texto o n\xFAmero",W027:"El n\xFAmero de WhatsApp debe tener entre 7 y 15 d\xEDgitos",W028:"La plantilla debe ser una funci\xF3n",W029:"Plantilla no encontrada",W030:"No se puede eliminar la plantilla por defecto",W031:"El ID de la plantilla debe ser un texto no vac\xEDo",W032:"Plantilla activa no encontrada",W033:"El cup\xF3n debe tener un 'code' v\xE1lido",W034:"El cup\xF3n debe tener un 'amount' num\xE9rico",W035:"setProducts() requiere un arreglo",W036:"debe ser un n\xFAmero positivo",W037:"Moneda no soportada",W038:"Regi\xF3n no soportada",W039:"Hook cancelado",W040:"JSON inv\xE1lido en load()",W041:"load() espera un objeto JSON"};function m(r,t){let e={...r};for(let o of Object.keys(t))t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])&&r[o]&&typeof r[o]=="object"&&!Array.isArray(r[o])?e[o]=m(r[o],t[o]):e[o]=t[o];return e}function y(r){r.prototype._productProp=function(t,e,o){let i=this.getProduct(t);return i&&i[e]!=null?i[e]:o},r.prototype._resolveProductIds=function(t,e,o=null){let i=t[e];if(!i||!Array.isArray(i))return[];let n=i.map(c=>this.getProduct(c)).filter(c=>c!==null);return o&&(n=n.filter(o)),n},r.prototype._findCartItem=function(t){return this.state.cart.find(e=>e.productId===t)},r.prototype._hasCartItem=function(t){return this._findCartItem(t)!==void 0},r.prototype._freeShippingGoal=function(){let t=this.config.shipping.freeFrom;return typeof t=="number"&&t>0?t:0},r.prototype._validatePositiveNumber=function(t,e){if(typeof t!="number"||!Number.isFinite(t)||t<=0)throw new Error(`${e} ${s.W036}`)},r.prototype._stockError=function(t,e){return`${s.W004}: "${t}". Disponible: ${e}`},r.prototype._sanitizeString=function(t){return typeof t!="string"?t:t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},r.prototype._sanitizeObject=function(t){if(t===null||typeof t!="object")return typeof t=="string"?this._sanitizeString(t):t;if(Array.isArray(t))return t.map(o=>this._sanitizeObject(o));let e={};for(let[o,i]of Object.entries(t))typeof i=="string"?e[o]=this._sanitizeString(i):typeof i=="object"&&i!==null?e[o]=this._sanitizeObject(i):e[o]=i;return e},r.prototype._createRateLimiter=function(t=100,e=6e4){let o=[];return{check:()=>{let i=Date.now();for(o.push(i);o.length>0&&o[0]0&&!e.includes(t))throw new Error(`${s.W037}: "${t}". Soportadas: ${e.join(", ")}`);this.state.activeCurrency=t},r.prototype.getCurrency=function(){return this.state.activeCurrency},r.prototype.getExchangeRate=function(t){return this.config.currencies[t]?this.config.currencies[t]:1},r.prototype.convertPrice=function(t){if(typeof t!="number"||!Number.isFinite(t))return 0;let e=this.getExchangeRate(this.state.activeCurrency);return Math.round(t*e*100)/100},r.prototype.formatPrice=function(t,e){let o=e||this.state.activeCurrency;try{return new Intl.NumberFormat(this.config.locale,{style:"currency",currency:o}).format(t)}catch{return`${o} ${t.toFixed(2)}`}}}function C(r){r.prototype.setRegion=function(t){let e=Object.keys(this.config.regions);if(e.length>0&&!e.includes(t))throw new Error(`${s.W038}: "${t}". Soportadas: ${e.join(", ")}`);this.state.activeRegion=t;let o=this.config.regions[t];o&&o.currency&&(this.state.activeCurrency=o.currency)},r.prototype.getRegion=function(){return this.state.activeRegion},r.prototype.getTax=function(){let t=this.config.regions[this.state.activeRegion];return!t||!t.tax?0:typeof t.tax=="number"?t.tax:typeof t.tax=="object"&&t.tax.rate!==void 0?t.tax.rate:0},r.prototype.getTaxName=function(){let t=this.config.regions[this.state.activeRegion];return!t||!t.tax?"Tax":typeof t.tax=="object"&&t.tax.name?t.tax.name:"Tax"},r.prototype.getRegionalShippingCost=function(t){let e=this.config.regions[this.state.activeRegion];if(!e||!e.shipping)return this.config.shipping.value||0;let o=t!==void 0?t:this.getSubtotal(),i=e.shipping;return i.freeFrom&&o>=i.freeFrom?0:i.flat!==void 0?i.flat:i.type==="per_item"?this.getCartItemCount()*(i.perItem||0):0}}function v(r){r.prototype.on=function(t,e){if(!this.hooks[t]){console.warn(`Whanda: unknown hook "${t}"`);return}this.hooks[t].push(e)},r.prototype.off=function(t,e){this.hooks[t]&&(this.hooks[t]=this.hooks[t].filter(o=>o!==e))},r.prototype.runHooks=async function(t,e){if(!this.hooks[t])return e;let o=e;for(let i of this.hooks[t])try{let n=await i(o);if(n!=null&&(o=n),n&&typeof n=="object"&&n.abort===!0){let c=new Error(n.message||`${s.W039}: "${t}"`);throw c._whandaAborted=!0,c}}catch(n){if(n._whandaAborted)throw n;console.error(`Whanda: hook "${t}" error:`,n)}return o}}function b(r){r.prototype.setProducts=function(t){if(!Array.isArray(t))throw new Error(s.W035);this.state.products=this._sanitizeObject(t)},r.prototype.getProducts=function(t={}){let e=[...this.state.products];if(t.category&&(e=e.filter(o=>o.category===t.category)),t.minPrice!=null&&(e=e.filter(o=>o.price>=t.minPrice)),t.maxPrice!=null&&(e=e.filter(o=>o.price<=t.maxPrice)),t.search){let o=t.search.toLowerCase();e=e.filter(i=>i.name&&i.name.toLowerCase().includes(o)||i.category&&i.category.toLowerCase().includes(o))}if(t.sort){let o=t.order==="desc"?-1:1;e.sort((i,n)=>i[t.sort]n[t.sort]?1*o:0)}return t.limit!=null&&(e=e.slice(0,t.limit)),e},r.prototype.getProduct=function(t){return this.state.products.find(e=>e.id===t)||null},r.prototype.getPrice=function(t){return this._productProp(t,"price",0)},r.prototype.getStock=function(t){return this._productProp(t,"stock",0)},r.prototype.getImages=function(t){return this._productProp(t,"images",[])},r.prototype.getCategory=function(t){return this._productProp(t,"category",null)},r.prototype.getCategories=function(){return[...new Set(this.state.products.map(t=>t.category).filter(t=>t!=null&&t!==""))]},r.prototype.search=function(t){if(typeof t!="string")throw new Error(s.W001);return this.getProducts({search:t})},r.prototype.filterByCategory=function(t){return this.getProducts({category:t})},r.prototype.getRelatedProducts=function(t){let e=this.getProduct(t);if(!e)return[];let o=this._resolveProductIds(e,"relatedIds");return o.length>0?o:this.filterByCategory(e.category).filter(i=>i.id!==t)},r.prototype.getUpsells=function(t){let e=this.getProduct(t);if(!e)return[];let o=this._resolveProductIds(e,"upsellIds",i=>i.price>e.price);return o.length>0?o:this.filterByCategory(e.category).filter(i=>i.price>e.price&&i.id!==t)},r.prototype.getCrossSells=function(t){let e=this.getProduct(t);if(!e)return[];let o=this._resolveProductIds(e,"crossSellIds");return o.length>0?o:this.getRelatedProducts(t)},r.prototype.getForCart=function(){if(this.state.cart.length===0)return[];let t=this.state.cart.map(i=>i.productId),e=[...new Set(this.state.cart.map(i=>this.getCategory(i.productId)).filter(i=>i!=null))],o=new Set;return this.state.products.filter(i=>e.includes(i.category)&&!t.includes(i.id)&&!o.has(i.id)?(o.add(i.id),!0):!1)}}function E(r){r.prototype.getCart=function(){return[...this.state.cart]},r.prototype.addItem=async function(t,e=1){if(typeof t!="string"&&typeof t!="number")throw new Error(s.W002);if(!Number.isInteger(e)||e<=0)throw new Error(s.W003);await this.runHooks("beforeAddToCart",{productId:t,quantity:e});let o=this.getProduct(t);if(!o)throw new Error(s.W002);if(o.stock!=null&&o.stock{}),this.state.cart=[],this.runHooks("afterCartChange",this.state.cart).catch(()=>{})},r.prototype.removeCartItem=function(t){this.runHooks("onRemoveItem",{productId:t,cart:[...this.state.cart]}).catch(()=>{}),this.state.cart=this.state.cart.filter(e=>e.productId!==t),this.runHooks("afterCartChange",this.state.cart).catch(()=>{})},r.prototype.updateQuantity=function(t,e){if(!Number.isInteger(e)||e<0)throw new Error(s.W005);let o=this._findCartItem(t);if(!o)throw new Error(s.W006);if(e===0)this.removeCartItem(t);else{let i=this.getProduct(t);if(i&&i.stock!=null&&i.stock{})}},r.prototype.hasCartItem=function(t){return this._hasCartItem(t)},r.prototype.getCartItemCount=function(){return this.state.cart.reduce((t,e)=>t+e.quantity,0)}}function S(r){r.prototype.getSubtotal=function(){return this.state.cart.reduce((t,e)=>t+e.price*e.quantity,0)},r.prototype.getShippingCost=function(){let t=this.getSubtotal(),e=this._freeShippingGoal();if(e>0&&t>=e)return 0;if(this.config.shipping.type==="fixed")return this.config.shipping.value;if(this.config.shipping.type==="per_item"){let o=this.getCartItemCount();return this.config.shipping.perItem*o}return 0},r.prototype.getDiscountAmount=function(){if(!this.state.coupon)return 0;let t=this.state.coupon,e=this.getSubtotal();if(t.type==="percent"){let o=e*(t.amount/100);return t.maxDiscount!=null?Math.min(o,t.maxDiscount):o}return t.amount||0},r.prototype.getTotal=function(){let t=this.getSubtotal(),e=this.getDiscountAmount(),o=this.getShippingCost(),i=this.getTax(),n=Math.round((t-e)*i*100)/100,c=t-e+o+n;return Math.max(0,c)},r.prototype.calculate=function(){let t=this.getSubtotal(),e=this.getDiscountAmount(),o=this.getTax(),i=Math.round((t-e)*o*100)/100;return{subtotal:t,shipping:this.getShippingCost(),discount:e,tax:i,taxRate:o,total:this.getTotal()}}}function k(r){r.prototype.addCoupon=function(t){if(!t||typeof t.code!="string"||t.code.trim()==="")throw new Error(s.W033);if(t.amount==null||typeof t.amount!="number"||t.amount<=0)throw new Error(s.W034);this.state.coupons.push(t)},r.prototype.getCoupons=function(){return[...this.state.coupons]},r.prototype.validateCoupon=function(t){return typeof t!="string"?!1:this.state.coupons.some(e=>e.code===t)},r.prototype.applyCoupon=function(t){if(typeof t!="string")throw new Error(s.W007);let e=this.state.coupons.find(o=>o.code===t);if(!e)throw new Error(s.W008);if(e.expiresAt&&new Date(e.expiresAt)=e.maxUses)throw new Error(s.W010);if(e.minOrder!=null&&this.getSubtotal()n.code===this.state.coupon.code);i!==-1&&(this.state.coupons[i].usedCount=(this.state.coupons[i].usedCount||0)+1)}return this.state.orders.push(o),this.state.cart=[],this.state.coupon=null,this.state.checkout={paymentMethod:null,deliveryMethod:null},await this.runHooks("afterCheckout",o),await this.runHooks("afterCartChange",this.state.cart),o}}function M(r){r.prototype.getOrder=function(t){return this.state.orders.find(e=>e.id===t)||null},r.prototype.getLastOrder=function(){return this.state.orders[this.state.orders.length-1]||null},r.prototype.listOrders=function(){return[...this.state.orders]},r.prototype.updateOrderStatus=function(t,e){let o=["pending","confirmed","shipped","delivered","cancelled"];if(!o.includes(e))throw new Error(`${s.W023}. Debe ser uno de: ${o.join(", ")}`);let i=this.state.orders.find(n=>n.id===t);if(!i)throw new Error(s.W024);return i.status=e,i},r.prototype.cancelOrder=function(t){return this.updateOrderStatus(t,"cancelled")}}function R(r){r.prototype.save=function(){return JSON.stringify({config:this.config,state:this.state,templates:{active:this.templates.active}})},r.prototype.load=function(t){let e;try{e=JSON.parse(t)}catch(o){throw new Error(`${s.W040}: ${o.message}`)}if(e===null||typeof e!="object")throw new Error(s.W041);if(e.config){let o=["currency","locale","whatsappNumber","shipping","paymentMethods","deliveryMethods","storeName"],i={};for(let n of o)e.config[n]!==void 0&&(i[n]=e.config[n]);this.config={...this.config,...i}}if(e.state){let o=["cart","coupons","coupon","customer","checkout","orders","downsell","seasons","urgency","bundles","cro","recentlyViewed"],i={};for(let n of o)e.state[n]!==void 0&&(i[n]=e.state[n]);this.state={...this.state,...i}}e.templates&&e.templates.active&&(this.templates.active=e.templates.active)},r.prototype.reset=function(){this.state.cart=[],this.state.coupon=null,this.state.customer={name:null,address:null,notes:null},this.state.checkout={paymentMethod:null,deliveryMethod:null}}}function A(r){r.prototype.sync=async function(t){let o=await this.runHooks("beforeSync",t);return await this.runHooks("afterSync",o),o}}function N(r){r.prototype.loadFromSources=async function(t){if(this._rateLimiters.sources||(this._rateLimiters.sources=this._createRateLimiter(10,6e4)),!this._rateLimiters.sources.check())throw new Error("Demasiadas solicitudes. Intenta de nuevo en un minuto.");let e=[];for(let o of t)try{if(o.type==="json"){let i=await fetch(o.url);if(i.ok){let n=await i.json(),c=Array.isArray(n)?n:n.products||[];e.push(...c)}}else if(o.type==="sheets"){let{loadFromSheets:i}=await Promise.resolve().then(()=>(d(),T)),n=await i(this,{sheetUrl:o.url,proxyUrl:o.proxyUrl,timeout:o.timeout||15e3});e.push(...n)}else if(o.type==="cache"){let i=this._getCache("whanda_products");i&&e.push(...i)}}catch(i){console.warn(`Whanda: Failed to load from source "${o.type}":`,i.message)}return e.length>0&&this.setProducts(e),e},r.prototype._setCache=function(t,e,o=3600){let i={value:e,expires:Date.now()+o*1e3};try{localStorage.setItem(`whanda_${t}`,JSON.stringify(i))}catch{}},r.prototype._getCache=function(t){try{let e=JSON.parse(localStorage.getItem(`whanda_${t}`));return!e||Date.now()>e.expires?(localStorage.removeItem(`whanda_${t}`),null):e.value}catch{return null}},r.prototype._clearCache=function(t){t?localStorage.removeItem(`whanda_${t}`):Object.keys(localStorage).filter(o=>o.startsWith("whanda_")).forEach(o=>localStorage.removeItem(o))},r.prototype.cacheProducts=function(t=3600){this._setCache("products",this.state.products,t)},r.prototype.loadProductsFromCache=function(){let t=this._getCache("products");return t&&Array.isArray(t)?(this.state.products=this._sanitizeObject(t),!0):!1},r.prototype.getProductsPaginated=function(t=1,e=20,o={}){let i=this.getProducts(o),n=i.length,c=Math.ceil(n/e),f=(t-1)*e;return{products:i.slice(f,f+e),total:n,page:t,pageSize:e,totalPages:c,hasNext:t1}},r.prototype.createProductIterator=function(t=20){let e=0,o=this.state.products;return{getNextBatch:()=>{let i=o.slice(e,e+t);return e+=t,i},hasMore:()=>e{e=0},getTotal:()=>o.length,getLoaded:()=>e}}}function D(r){r.prototype.setWhatsAppNumber=function(t){if(typeof t!="string"&&typeof t!="number")throw new Error(s.W026);let e=String(t).replace(/[^0-9]/g,"");if(e.length<7||e.length>15)throw new Error(s.W027);this.config.whatsappNumber=e},r.prototype.registerWhatsAppTemplate=function(t,e){if(typeof t!="string"||t.trim()==="")throw new Error(s.W031);if(typeof e!="function")throw new Error(s.W028);this.templates.whatsapp[t]={id:t,fn:e}},r.prototype.setWhatsAppTemplate=function(t){if(!this.templates.whatsapp[t])throw new Error(`${s.W029}: "${t}"`);this.templates.active=t},r.prototype.listWhatsAppTemplates=function(){return Object.keys(this.templates.whatsapp)},r.prototype.getWhatsAppTemplate=function(t){return this.templates.whatsapp[t]||null},r.prototype.removeWhatsAppTemplate=function(t){if(t==="default")throw new Error(s.W030);if(!this.templates.whatsapp[t])throw new Error(`${s.W029}: "${t}"`);this.templates.active===t&&(this.templates.active="default"),delete this.templates.whatsapp[t]},r.prototype.previewWhatsAppTemplate=function(t,e){let o=this.templates.whatsapp[t];if(!o)throw new Error(s.W029);return o.fn(e)},r.prototype.generateMessage=async function(t){let e=this.templates.whatsapp[this.templates.active];if(!e)throw new Error(s.W032);let o=e.fn(t);return o=await this.runHooks("beforeGenerateWhatsApp",o),o=await this.runHooks("afterGenerateWhatsApp",o),o},r.prototype.generateLink=async function(t){if(!this.config.whatsappNumber)throw new Error(s.W025);let e=encodeURIComponent(await this.generateMessage(t));return`https://wa.me/${this.config.whatsappNumber}?text=${e}`},r.prototype.sendToWhatsApp=async function(t){return await this.runHooks("beforeWhatsAppSend",t),await this.generateLink(t)},r.prototype.getShareCatalogUrl=function(t={}){let e=this.config.storeName||"Mi Tienda",o=this.state.products.length,i=this.getCategories(),n=i.length>0?` \u{1F4E6} Categor\xEDas: ${i.join(", ")}`:"",c=t.message||`\u{1F6CD}\uFE0F *${e}* Tenemos ${o} productos disponibles${n} ${t.url?`Ver cat\xE1logo: ${t.url}`:""}`;return`https://api.whatsapp.com/send?text=${encodeURIComponent(c.trim())}`},r.prototype.getThankYouHtml=function(t={}){let{message:e="\xA1Gracias por tu compra!",showOrderSummary:o=!0,shareText:i="Compra en nuestra tienda",catalogUrl:n="#"}=t,c=this.getLastOrder(),f=this.config.storeName||"Mi Tienda",u="";o&&c&&(u=`

Resumen de tu orden

    ${c.items.map(p=>`
  • ${this._sanitizeString(p.name)} x${p.quantity} - ${this.formatPrice(p.price*p.quantity)}
  • `).join("")}

Total: ${this.formatPrice(c.total)}

`);let h=this._sanitizeString(n);return`

\u2713 ${this._sanitizeString(e)}

${this._sanitizeString(f)}

${u}
`.trim()},r.prototype._defaultWhatsAppTemplate=function(){return t=>{let e=t.items.map(c=>`- ${c.name} x${c.quantity}`).join(` `),o=t.customer.name?` \u{1F464} *Cliente:* ${t.customer.name} \u{1F4CD} *Direcci\xF3n:* ${t.customer.address}`:"",i=t.tax>0?` ${t.taxName||"Tax"} (${(t.taxRate*100).toFixed(0)}%): ${t.tax}`:"",n=t.currency&&t.currency!=="DOP"?` \u{1F4B1} Moneda: ${t.currency}`:"";return` \u{1F6D2} *Nuevo Pedido* ${o} ${e} Subtotal: ${t.subtotal} Env\xEDo: ${t.shipping} Descuento: ${t.discount}${i}${n} Total: *${t.total}* Pago: ${t.paymentMethod||"N/A"} Entrega: ${t.deliveryMethod||"N/A"} `.trim()}}}var a=class{constructor(t={}){this.config=m({currency:"DOP",locale:"es-DO",whatsappNumber:null,shipping:{type:"fixed",value:0,freeFrom:null,perItem:0},paymentMethods:["Cash","Bank Transfer"],deliveryMethods:["Home Delivery","In-store Pickup"],currencies:{},regions:{},storeName:"Mi Tienda"},t),this.state={products:[],cart:[],coupons:[],coupon:null,customer:{name:null,address:null,notes:null},checkout:{paymentMethod:null,deliveryMethod:null},orders:[],downsell:null,seasons:[],urgency:{},bundles:[],cro:{freeShippingBar:!1,freeShippingGoal:0,lowStockAlert:!1,socialProof:!1,recentlyViewed:!1,exitIntent:!1,exitMessage:"",exitDiscount:0},recentlyViewed:[],activeCurrency:t.currency||"DOP",activeRegion:null},this.hooks={beforeAddToCart:[],afterAddToCart:[],afterCartChange:[],beforeCheckout:[],afterCheckout:[],beforeWhatsAppSend:[],beforeGenerateWhatsApp:[],afterGenerateWhatsApp:[],beforeSync:[],afterSync:[],onCartEmpty:[],onRemoveItem:[]},this.templates={whatsapp:{default:{id:"default",fn:this._defaultWhatsAppTemplate()}},active:"default"},this._rateLimiters={}}};y(a);w(a);x(a);C(a);v(a);b(a);E(a);S(a);k(a);$(a);P(a);_(a);M(a);R(a);A(a);N(a);D(a);d();typeof globalThis<"u"&&(globalThis.Whanda=a,globalThis.Whanda.loadFromSheets=g);var qt=a;})();