1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72840,e=>{"use strict";let t=(0,e.i(11041).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],72840)},44424,28199,e=>{"use strict";var t=e.i(8720),r=e.i(13268),i=e.i(69485),a=e.i(75248),n=e.i(7426);function o(e){let o=e+"CollectionProvider",[s,l]=(0,r.createContextScope)(o),[u,c]=s(o,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:i}=e,a=t.default.useRef(null),o=t.default.useRef(new Map).current;return(0,n.jsx)(u,{scope:r,itemMap:o,collectionRef:a,children:i})};d.displayName=o;let p=e+"CollectionSlot",f=(0,a.createSlot)(p),m=t.default.forwardRef((e,t)=>{let{scope:r,children:a}=e,o=c(p,r),s=(0,i.useComposedRefs)(t,o.collectionRef);return(0,n.jsx)(f,{ref:s,children:a})});m.displayName=p;let h=e+"CollectionItemSlot",g="data-radix-collection-item",y=(0,a.createSlot)(h),v=t.default.forwardRef((e,r)=>{let{scope:a,children:o,...s}=e,l=t.default.useRef(null),u=(0,i.useComposedRefs)(r,l),d=c(h,a);return t.default.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>void d.itemMap.delete(l))),(0,n.jsx)(y,{...{[g]:""},ref:u,children:o})});return v.displayName=h,[{Provider:d,Slot:m,ItemSlot:v},function(r){let i=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=i.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(i.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[i.collectionRef,i.itemMap])},l]}var s=new WeakMap;function l(e,t){var r,i;let a,n,o;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let s=(r=e,i=t,a=r.length,(o=(n=u(i))>=0?n:a+n)<0||o>=a?-1:o);return -1===s?void 0:e[s]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],s.set(this,!0)}set(e,t){return s.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let i,a=this.has(t),n=this.#e.length,o=u(e),s=o>=0?o:n+o,l=s<0||s>=n?-1:s;if(l===this.size||a&&l===this.size-1||-1===l)return this.set(t,r),this;let c=this.size+ +!a;o<0&&s++;let d=[...this.#e],p=!1;for(let e=s;e<c;e++)if(s===e){let n=d[e];d[e]===t&&(n=d[e+1]),a&&this.delete(t),i=this.get(n),this.set(t,r)}else{p||d[e-1]!==t||(p=!0);let r=d[p?e:e-1],a=i;i=this.get(r),this.delete(r),this.set(r,a)}return this}with(t,r,i){let a=new e(this);return a.insert(t,r,i),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let i=r+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let i=r+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return i;r++}}findIndex(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return r;r++}return -1}filter(t,r){let i=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&i.push(e),a++;return new e(i)}map(t,r){let i=[],a=0;for(let e of this)i.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(i)}reduce(...e){let[t,r]=e,i=0,a=r??this.at(0);for(let r of this)a=0===i&&1===e.length?r:Reflect.apply(t,this,[a,r,i,this]),i++;return a}reduceRight(...e){let[t,r]=e,i=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);i=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[i,a,r,this])}return i}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let i=new e,a=this.size-1;if(void 0===t)return i;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),r=this.get(t);i.set(t,r)}return i}every(e,t){let r=0;for(let i of this){if(!Reflect.apply(e,t,[i,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>o],44424);var c=e.i(35879),d=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),p=t.forwardRef((e,t)=>
1(0,n.jsx)(c.Primitive.span,{...e,ref:t,style:{...d,...e.style}}));p.displayName="VisuallyHidden",e.s(["VISUALLY_HIDDEN_STYLES",()=>d,"VisuallyHidden",()=>p],28199)},41517,e=>{"use strict";let t=(0,e.i(11041).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",()=>t],41517)},13478,e=>{"use strict";let t=(0,e.i(11041).default)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckCircle",()=>t],13478)},4460,e=>{"use strict";var t=e.i(7426),r=e.i(21060),i=e.i(5308),a=e.i(8720);function n({href:e,onMouseEnter:n,onTouchStart:o,prefetch:s,...l}){let u=(0,i.useRouter)(),c=(0,a.useRef)(!1),d=()=>{if(c.current)return;let t="string"==typeof e?e:e&&"object"==typeof e&&"pathname"in e&&e.pathname?e.pathname:null;t&&"#"!==t&&(c.current=!0,u.prefetch(t))};return(0,t.jsx)(r.default,{...l,href:e,prefetch:!1,onMouseEnter:e=>{n?.(e),d()},onTouchStart:e=>{o?.(e),d()}})}e.s(["PrefetchOnHoverLink",()=>n])},79231,e=>{"use strict";let t=(0,e.i(11041).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],79231)},80491,e=>{"use strict";let t=(0,e.i(11041).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],80491)},88070,e=>{"use strict";var t=e.i(7284),r=e.i(67245);function i(...e){return(0,r.twMerge)((0,t.clsx)(e))}e.i(47163),e.s(["cn",()=>i])},59781,e=>{"use strict";let t=(0,e.i(11041).default)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",()=>t],59781)},34119,e=>{"use strict";var t=e.i(7426),r=e.i(8720),i=e.i(59781),a=e.i(33742),n=e.i(67881);function o({quantity:e,onQuantityChange:o,disabled:s=!1,minQuantity:l=1,maxQuantity:u=999,step:c=1,size:d="md",className:p=""}){let[f,m]=(0,r.useState)(e.toString()),h=Math.floor(u/c)*c;(0,r.useEffect)(()=>{m(e.toString())},[e]);let g={sm:{button:"h-6 w-6",input:"w-12 h-6 text-xs",icon:"h-3 w-3"},md:{button:"h-7 w-7",input:"w-12 h-7 text-sm",icon:"h-3 w-3"},lg:{button:"h-8 w-8",input:"w-14 h-8 text-sm",icon:"h-4 w-4"}}[d];return(0,t.jsxs)("div",{className:`flex items-center ${p}`,children:[(0,t.jsxs)(n.Button,{variant:"outline",size:"icon",className:`${g.button} rounded-none border-gray-200 bg-transparent`,onClick:()=>{e-c>=l&&o(e-c)},disabled:e-c<l||s,children:[(0,t.jsx)(i.Minus,{className:g.icon}),(0,t.jsx)("span",{className:"sr-only",children:"Disminuir cantidad"})]}),(0,t.jsx)("input",{type:"number",inputMode:"numeric",step:c,min:l,max:h,value:f,onChange:e=>{m(e.target.value)},onBlur:t=>(t=>{let r=Number(t);if(Number.isNaN(r))return void m(e.toString());let i=Math.max(l,Math.min(h,c>1?Math.ceil(r/c)*c:r));i===e||o(i),m(i.toString())})(t.target.value),disabled:s,className:`${g.input} text-center outline-none bg-transparent border-y border-gray-200 appearance-none 2 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none 3 disabled:opacity-50 disabled:cursor-not-allowed`}),(0,t.jsxs)(n.Button,{variant:"outline",size:"icon",className:`${g.button} rounded-none border-gray-200 bg-transparent`,onClick:()=>{e+c<=h&&o(e+c)},disabled:e+c>h||s,children:[(0,t.jsx)(a.Plus,{className:g.icon}),(0,t.jsx)("span",{className:"sr-only",children:"Aumentar cantidad"})]})]})}e.s(["default",()=>o])},28948,e=>{"use strict";function t(e){return e&&e>1?Math.floor(e):1}function r(e,r){let i=t(r);return Math.floor(Math.max(0,e)/i)*i}function i(e,i,a){let n=t(a),o=r(i,n);return 0===o?0:Math.min(Math.ceil(Math.max(e,1)/n)*n,o)}function a(e,t){return`${e.trim()} ${t} unidades`}e.s(["formatIncrementText",()=>a,"maxQuantityForStock",()=>r,"normalizeIncrement",()=>t,"roundToIncrement",()=>i])},33742,e=>{"use strict";let t=(0,e.i(11041).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],33742)},37634,e=>{"use strict";let t=(0,e.i(11041).default)("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);e.s(["ShoppingBag",()=>t],37634)},54952,e=>{"use strict";let t=(0,e.i(11041).default)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.
3172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",()=>t],54952)},86388,13523,82561,e=>{"use strict";var t,r,i=e.i(7426),a=e.i(8720),n=e.i(35263),o=e.i(45752);class s extends o.BaseService{constructor(){super("/promotions")}async getPromotions(){return this.fetchData(`${this.fullEndpoint}`)}}var l=((t={})[t.GetX_PayY=1]="GetX_PayY",t[t.PriceDiscount=2]="PriceDiscount",t[t.ProgressiveByQuantity=3]="ProgressiveByQuantity",t[t.ProgressiveByTotal=4]="ProgressiveByTotal",t),u=((r={})[r.AllStore=0]="AllStore",r[r.Categories=1]="Categories",r[r.Products=2]="Products",r[r.Tags=3]="Tags",r);e.s(["PromotionTargetType",()=>u,"PromotionType",()=>l],13523);var c=e.i(47163);function d(e,t=new Date){return e.filter(e=>!(!e.isEnabled||!e.isActive||e.fromDate&&new Date(e.fromDate)>t||e.toDate&&new Date(e.toDate)<t))}function p(e,t){let r=m(e,t),i=t.filter(e=>e.promotionType===l.PriceDiscount&&!0===e.combinesWithOtherPromotions),a=t.filter(e=>e.promotionType!==l.PriceDiscount);if(0===i.length||0===a.length)return r;let n=r;for(let t of i)for(let r of a){let i=function(e,t,r){let i=m(e,[t]);if(i.totalPromotionDiscount<=0)return;let a=m(e.map(e=>{let t=i.itemPromotions.get(e.id),r=t?.discountedTotal??e.total;return{...e,price:e.quantity>0?r/e.quantity:e.price,total:r}}),[r]);if(a.totalPromotionDiscount<=0)return;let n=new Map;for(let t of e){let e=i.itemPromotions.get(t.id),r=a.itemPromotions.get(t.id),o=[...e?.appliedPromotions??[],...r?.appliedPromotions??[]];if(0===o.length)continue;let s=e?.discountedTotal??t.total,l=r?.discountedTotal??s,u=t.total-l,c={promotion:e?.bestPromotion?.promotion??r.bestPromotion.promotion,originalPrice:t.total,discountedPrice:l,discount:u,label:o.map(e=>e.label).join(" + "),currentTier:r?.bestPromotion?.currentTier??e?.bestPromotion?.currentTier};n.set(t.id,{itemId:t.id,originalTotal:t.total,discountedTotal:l,discount:u,applicablePromotions:[...e?.applicablePromotions??[],...r?.applicablePromotions??[]],appliedPromotions:o,bestPromotion:c})}let o=e.reduce((e,t)=>e+t.total,0),s=a.totalDiscountedPrice;return{itemPromotions:n,totalOriginalPrice:o,totalDiscountedPrice:s,totalPromotionDiscount:o-s,nextTierSuggestions:a.nextTierSuggestions}}(e,t,r);i&&i.totalDiscountedPrice<n.totalDiscountedPrice&&(n=i)}return n}function f(e){return Array.from(new Set((Array.isArray(e)?e:e?.split(",")??[]).map(e=>e.trim().toLocaleLowerCase()).filter(Boolean)))}function m(e,t){if(0===e.length||0===t.length){let t=e.reduce((e,t)=>e+t.total,0);return{itemPromotions:new Map,totalOriginalPrice:t,totalDiscountedPrice:t,totalPromotionDiscount:0,nextTierSuggestions:[]}}let r=new Map,i=[];for(let a of t){let t=function(e,t){return e.filter(e=>h(e,t))}(e,a);if(0!==t.length)switch(a.promotionType){case l.GetX_PayY:!function(e,t,r){if(!e.buyX||!e.getY)return;let i=e.labelText||`${e.buyX}x${e.getY}`;if(e.applySameItem){let a=new Map;for(let e of t){let t=a.get(e.productId)??[];t.push(e),a.set(e.productId,t)}for(let[,t]of a){let a=Math.floor(t.reduce((e,t)=>e+t.quantity,0)/e.buyX);if(0===a)continue;let n=[...t].sort((e,t)=>e.price-t.price),o=a*(e.buyX-e.getY);for(let t of n){if(o<=0)break;let a=Math.min(t.quantity,o),n=t.quantity-a,s=t.total,l=t.price*n,u=s-l;g(t.id,e,s,l,u,i,r),o-=a}}return}let a=Math.floor(t.reduce((e,t)=>e+t.quantity,0)/e.buyX);if(0===a)return;let n=[...t].sort((e,t)=>e.price-t.price),o=a*(e.buyX-e.getY);for(let t of n){if(o<=0)break;let a=Math.min(t.quantity,o),n=t.quantity-a,s=t.total,l=t.price*n,u=s-l;g(t.id,e,s,l,u,i,r),o-=a}}(a,t,r);break;case l.PriceDiscount:!function(e,t,r){let i=e.labelText||"";for(let a of(!i&&(e.percentageDiscount?i=`${e.percentageDiscount}% OFF`:e.valueDiscount&&(i=`${(0,c.formatCurrency)(e.valueDiscount)} OFF`)),t)){let t=0;e.percentageDiscount?t=a.price*(e.percentageDiscount/100):e.valueDiscount&&(t=Math.min(e.valueDiscount,a.price));let n=a.total,o=(a.price-t)*a.quantity,s=n-o;s>0&&g(a.id,e,n,o,s,i,r)}}(a,t,r);break;case l.ProgressiveByQuantity:let n=function(e,t,r){let i,a;if(!e.tiers||0===e.tiers.length)return{};if(e.applySameItem){let i=[...e.tiers].filter(e=>e.isActive&&null!=e.minUnits).sort((e,t)=>
3(t.minUnits||0)-(e.minUnits||0));if(0===i.length)return{};let a=new Map;for(let e of t){let t=a.get(e.productId)??[];t.push(e),a.set(e.productId,t)}for(let[,t]of a){let a,n=t.reduce((e,t)=>e+t.quantity,0);for(let e=0;e<i.length;e++){let t=i[e];if(n>=(t.minUnits||0)){a=t;break}}if(!a)continue;let o=e.labelText||`${a.percentageDiscount}% OFF x${a.minUnits}`;for(let i of t){let t=0;a.percentageDiscount?t=i.price*(a.percentageDiscount/100):a.valueDiscount&&(t=Math.min(a.valueDiscount,i.price));let n=i.total,s=(i.price-t)*i.quantity,l=n-s;g(i.id,e,n,s,l,o,r,a)}}return{}}let n=t.reduce((e,t)=>e+t.quantity,0),o=[...e.tiers].filter(e=>e.isActive&&null!=e.minUnits).sort((e,t)=>(t.minUnits||0)-(e.minUnits||0));for(let e=0;e<o.length;e++){let t=o[e];if(n>=(t.minUnits||0)){i=t,e>0&&(a=o[e-1]);break}a=t}if(i){let a=e.labelText||`${i.percentageDiscount}% OFF x${i.minUnits}`;for(let n of t){let t=0;i.percentageDiscount?t=n.price*(i.percentageDiscount/100):i.valueDiscount&&(t=Math.min(i.valueDiscount,n.price));let o=n.total,s=(n.price-t)*n.quantity,l=o-s;g(n.id,e,o,s,l,a,r,i)}}if(a){let t=(a.minUnits||0)-n,r=i?`Agrega ${t} unidad${1!==t?"es":""} m\xe1s para ${a.percentageDiscount}% OFF`:`Agrega ${t} unidad${1!==t?"es":""} para obtener ${a.percentageDiscount}% OFF`;return{suggestion:{promotion:e,currentTier:i,nextTier:a,itemsNeeded:t,message:r}}}return{}}(a,t,r);n.suggestion&&i.push(n.suggestion);break;case l.ProgressiveByTotal:let o=function(e,t,r){let i,a;if(!e.tiers||0===e.tiers.length)return{};let n=t.reduce((e,t)=>e+t.total,0),o=[...e.tiers].filter(e=>e.isActive&&null!=e.minValue).sort((e,t)=>(t.minValue||0)-(e.minValue||0));for(let e=0;e<o.length;e++){let t=o[e];if(n>=(t.minValue||0)){i=t,e>0&&(a=o[e-1]);break}a=t}if(i){let a=e.labelText||`${i.percentageDiscount}% OFF`;for(let n of t){let t=0;i.percentageDiscount?t=n.price*(i.percentageDiscount/100):i.valueDiscount&&(t=Math.min(i.valueDiscount,n.price));let o=n.total,s=(n.price-t)*n.quantity,l=o-s;g(n.id,e,o,s,l,a,r,i)}}if(a){let t=(a.minValue||0)-n,r=i?`Agrega ${(0,c.formatCurrency)(t)} m\xe1s para ${a.percentageDiscount}% OFF`:`Agrega ${(0,c.formatCurrency)(t)} para obtener ${a.percentageDiscount}% OFF`;return{suggestion:{promotion:e,currentTier:i,nextTier:a,amountNeeded:t,message:r}}}return{}}(a,t,r);o.suggestion&&i.push(o.suggestion)}}let a=0,n=0;for(let t of e){a+=t.total;let e=r.get(t.id);e&&e.bestPromotion?n+=e.discountedTotal:n+=t.total}let o=a-n;return{itemPromotions:r,totalOriginalPrice:a,totalDiscountedPrice:n,totalPromotionDiscount:o,nextTierSuggestions:i}}function h(e,t){if(!1===t.combinesWithOtherDiscounts&&!0===e.hasPromotionalPrice)return!1;switch(t.targetType){case u.AllStore:return!0;case u.Categories:return t.categories?.some(t=>null!=e.categoryId?t.categoryId===e.categoryId:!!e.categoryIds&&e.categoryIds.length>0&&e.categoryIds.includes(t.categoryId))??!1;case u.Products:return t.products?.some(t=>t.productId===e.productId)??!1;case u.Tags:{let r=f(t.tags);if(0===r.length)return!1;let i=new Set(f(e.tags));return r.some(e=>i.has(e))}default:return!1}}function g(e,t,r,i,a,n,o,s){let l={promotion:t,originalPrice:r,discountedPrice:i,discount:a,label:n,currentTier:s};o.has(e)||o.set(e,{itemId:e,originalTotal:r,discountedTotal:r,discount:0,applicablePromotions:[],appliedPromotions:[]});let u=o.get(e);u.applicablePromotions.push(l),(!u.bestPromotion||a>u.bestPromotion.discount)&&(u.bestPromotion=l,u.appliedPromotions=[l],u.discountedTotal=i,u.discount=a)}e.s(["calculatePromotions",()=>p,"filterActivePromotions",()=>d,"isItemEligibleForPromotion",()=>h,"normalizePromotionTags",()=>f],82561);let y=(0,a.createContext)(void 0);function v({children:e}){let t,{data:r,isLoading:o,error:l}=(t=new s,(0,n.useQuery)({queryKey:["promotions"],queryFn:()=>t.getPromotions(),staleTime:3e5,gcTime:6e5,retry:2,retryDelay:e=>Math.min(1e3*2**e,3e4)})),[u,c]=(0,a.useState)(new Date);(0,a.useEffect)(()=>{if(!r?.some(e=>e.fromDate||e.toDate))return;let e=setInterval(()=>{c(new Date)},6e4);return()=>clearInterval(e)},[r]);let p=(0,a.useMemo)(()=>d(r||[],u),[r,u]);return(0,i.jsx)(y.Provider,{value:{promotions:r||[],activePromotions:p,isLoading:o,error:l},children:e})}function x(){let e=(0,a.useContext)(y);if(void 0===e)throw Error("usePromotionsContext must be used within a PromotionsProvider");return e}e.s(["PromotionsProvider",()=>v,"usePromotionsContext",()=>x],86388)},99170,e=>{"use strict";var t=e.i(8720);let r="anon_id",i=e=>`site_visit_sent:${e}`,a=e=>`site_visit_eventId:${e}`;function n(e){let t=localStorage.getItem(i(e));if(!t)return null;try{let{eventId:r,ts:n}=JSON.parse(t);if(Date.now()-n<864e5)return{eventId:r,ts:n};return localStorage.removeItem(i(e)),localStorage.removeItem(a(e)),null}catch{return localStorage.removeItem(i(e)),localStorage.removeItem(a(e)),null}}let o="analytics:last_anon_id";function s(){let e,t,i=((e=function(e){if("undefined"==typeof document)return null;let t=document.cookie.match(RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}(r))||!function(e,t,r){if("undefined"==typeof document)return;let i=new Date(Date.now()+864e5).toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; expires=${i}; path=/; SameSite=Lax`}(r,e=Math.random().toString(36).slice(2)+Date.now().toString(36),0),e),a=localStorage.getItem(o);return a&&a!==i&&(t=[`site_visit_sent:${a}`,`site_visit_eventId:${a}`,`category_view_once:${a}:`,`product_view_once:${a}
3:`],Object.keys(localStorage).forEach(e=>{t.some(t=>e.startsWith(t))&&localStorage.removeItem(e)})),localStorage.setItem(o,i),i}let l=(e,t)=>`product_view_once:${e}:${t}`,u=(e,t)=>`category_view_once:${e}:${t}`;function c(e){let r=(0,t.useCallback)(async()=>{let t;t=Date.now(),Object.keys(localStorage).forEach(e=>{if(e.startsWith("site_visit_"))try{let r=localStorage.getItem(e);if(!r)return;let i="string"==typeof r&&r.startsWith("{")?JSON.parse(r).ts:Number(r);i&&t-i>1728e5&&localStorage.removeItem(e)}catch{localStorage.removeItem(e)}});let r=s();if(n(r))return;let o=function(e){let t=n(e);if(t?.eventId)return t.eventId;let r=crypto?.randomUUID?.()??`${Math.random().toString(36).slice(2)}${Date.now()}`;return localStorage.setItem(a(e),r),r}(r),l=new Blob([JSON.stringify({eventId:o,anonId:r,customerId:e??null})],{type:"application/json"}),u=navigator.sendBeacon?.("/api/analytics/NavigationEvents/site-visit",l),c=()=>{let e;return e=JSON.stringify({eventId:o,ts:Date.now()}),void(localStorage.setItem(i(r),e),localStorage.setItem(a(r),o))};if(u)c();else try{await fetch("/api/analytics/NavigationEvents/site-visit",{method:"POST",body:l,keepalive:!0}),c()}catch{}},[e]);return{trackSiteVisit:r,trackCategoryView:(0,t.useCallback)(async t=>{var r;let i=s(),a=null!=(r={id:t.categoryId??null,slug:t.categorySlug??null,name:t.categoryName}).id&&Number.isFinite(Number(r.id))?String(r.id):r.slug?String(r.slug).trim().toLowerCase():String(r.name||"").trim().toLowerCase().replace(/\s+/g,"-");if("1"===localStorage.getItem(u(i,a)))return;let n=new Blob([JSON.stringify({eventType:3,referenceId:Number.isFinite(t.categoryId)?t.categoryId:0,anonId:i,eventData:JSON.stringify({categoryName:t.categoryName,categorySlug:t.categorySlug??null}),customerId:e??null})],{type:"application/json"}),o=navigator.sendBeacon?.("/api/analytics/NavigationEvents/content-view",n),l=()=>{localStorage.setItem(u(i,a),"1")};if(o)l();else try{await fetch("/api/analytics/NavigationEvents/content-view",{method:"POST",body:n,keepalive:!0}),l()}catch{}},[e]),trackProductView:(0,t.useCallback)(async t=>{var r;let i=s();if(r=t.productId,"1"===localStorage.getItem(l(i,r)))return;let a=new Blob([JSON.stringify({eventType:2,referenceId:t.productId,anonId:i,customerId:e??null})],{type:"application/json"}),n=navigator.sendBeacon?.("/api/analytics/NavigationEvents/content-view",a),o=()=>{var e;return e=t.productId,void localStorage.setItem(l(i,e),"1")};if(n)o();else try{await fetch("/api/analytics/NavigationEvents/content-view",{method:"POST",body:a,keepalive:!0}),o()}catch{}},[e])}}e.s(["useAnalyticsEvents",()=>c],99170)},52917,72658,e=>{"use strict";var t=e.i(7426),r=e.i(8720),i=e.i(59926),a=e.i(94237),n=e.i(52640),o=e.i(47163);let s=i.Root,l=i.Trigger,u=i.Close,c=i.Portal,d=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(i.Overlay,{className:(0,o.cn)("fixed inset-0 z-50 bg-[#0000009c] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:a}));d.displayName=i.Overlay.displayName;let p=(0,a.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),f=r.forwardRef(({side:e="right",className:r,children:a,hideClose:s=!1,...l},u)=>(0,t.jsxs)(c,{children:[(0,t.jsx)(d,{}),(0,t.jsxs)(i.Content,{ref:u,className:(0,o.cn)(p({side:e}),r),...l,children:[a,!s&&(0,t.jsxs)(i.Close,{className:"absolute right-4 top-4 roun
3ded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,t.jsx)(n.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));f.displayName=i.Content.displayName;let m=({className:e,...r})=>(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...r});m.displayName="SheetHeader";let h=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(i.Title,{ref:a,className:(0,o.cn)("text-lg font-semibold text-foreground",e),...r}));h.displayName=i.Title.displayName,r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(i.Description,{ref:a,className:(0,o.cn)("text-sm text-muted-foreground",e),...r})).displayName=i.Description.displayName,e.s(["Sheet",()=>s,"SheetClose",()=>u,"SheetContent",()=>f,"SheetHeader",()=>m,"SheetTitle",()=>h,"SheetTrigger",()=>l],52917),e.i(3104);var g=e.i(69485),y=Symbol.for("react.lazy"),v=r[" use ".trim().toString()];function x(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===y&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var w=Symbol("radix.slottable");function b(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===w}var P=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var a,n;let o,s,l,u=(n=a=`Primitive.${i}`,(o=r.forwardRef((e,t)=>{let{children:i,...a}=e;if(x(i)&&"function"==typeof v&&(i=v(i._payload)),r.isValidElement(i)){var n;let e,o,s=(n=i,(o=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.ref:(o=(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.props.ref:n.props.ref||n.ref),l=function(e,t){let r={...t};for(let i in t){let a=e[i],n=t[i];/^on[A-Z]/.test(i)?a&&n?r[i]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(r[i]=a):"style"===i?r[i]={...a,...n}:"className"===i&&(r[i]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}(a,i.props);return i.type!==r.Fragment&&(l.ref=t?(0,g.composeRefs)(t,s):s),r.cloneElement(i,l)}return r.Children.count(i)>1?r.Children.only(null):null})).displayName=`${n}.SlotClone`,s=o,(l=r.forwardRef((e,i)=>{let{children:a,...n}=e;x(a)&&"function"==typeof v&&(a=v(a._payload));let o=r.Children.toArray(a),l=o.find(b);if(l){let e=l.props.children,a=o.map(t=>t!==l?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(s,{...n,ref:i,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return(0,t.jsx)(s,{...n,ref:i,children:a})})).displayName=`${a}.Slot`,l),c=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?u:i,{...n,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),N=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),T=r.forwardRef((e,r)=>(0,t.jsx)(P.span,{...e,ref:r,style:{...N,...e.style}}));T.displayName="VisuallyHidden",e.s(["VisuallyHidden",()=>T],72658)},34317,e=>{"use strict";let t=(0,e.i(11041).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],34317)},85091,e=>{"use strict";var t=e.i(7426),r=e.i(21060),i=e.i(47163),a=e.i(62234),n=e.i(52678);function o({store:e,pathname:o,isTransparentPage:s,scrolled:l,sizeOverride:u}){let c=a.visualConfig.theme.styles.base,d=a.visualConfig.home.features.base,p=a.visualConfig.wholesale.features.base,f=a.visualConfig.wholesale.behavior.base,m=(0,a.shouldInvertHeaderColors)(o),h="/"===o||"/home"===o||p.enabled&&p.useHomeHeaderBehavior&&o===f.path,g=u||c.logoSize;return(0,t.jsx)(r.default,{href:d.showLanding?"/home":"/",prefetch:!1,className:"shrink-0 flex items-center",children:(0,t.jsx)(n.default,{src:e.logo||"/images/logo.png",alt:e.name||"Logo",width:"big"===g?300:"medium"===g?200:"small"===g?80:120,height:80,fixedSize:!0,cloudSize:"big"===g?1024:640,className:(0,i.cn)("h-auto object-contain transition-all duration-500 ease-in-out",{small:"w-18 md:w-22",default:"w-30 md:w-34",medium:"w-40 md:w-48",big:"w-52 md:w-64"}[g],c.logoClassName,{"invert brightness-0":s&&m&&!l}),preload:h})})}e.s(["Logo",()=>o])},3613,e=>{"use strict";e.i(44968);var t=e.i(23479);let r="t6q1z9k4p8m2d7v5n3";class i{fullEndpoint;endpoint;constructor(e){this.endpoint=e,this.fullEndpoint=`https://analytics-api-v1.nextcommerce.com.ar${e}`}async getHeadersWithToken(){let e=await this.getToken();return{"Content-Type":"application/json","NC-TOKEN":e?`${e}`:""}}async getToken(){return r}async fetchData(e,t={}){let r=await this.getHeadersWithToken(),i=await fetch(e,{...t,headers:{...r,...t.headers}});if(!i.ok){let e=`HTTP error! status: ${i.status}`;try{let t=await i.json();t.message?e=t.message:t.error?e=t.error:t.title&&(e=t.title),409===i.status?e=t.message||"Ya existe un cliente registrado con este correo electrónico":400===i.status?e=t.message||"Datos inválidos":401===i.status?e="No autorizado":403===i.status?e="Acce
3so denegado":404===i.status?e="Recurso no encontrado":500===i.status&&(e="Error interno del servidor")}catch(t){console.warn("No se pudo parsear el error del servidor:",t),409===i.status&&(e="Ya existe un cliente registrado con este correo electrónico")}throw Error(e)}if(204===i.status)return;let a=await i.text();if(a.trim())return JSON.parse(a)}async fetchText(e,t={}){let r=await this.getHeadersWithToken(),i=await fetch(e,{...t,headers:{...r,...t.headers}});if(!i.ok){let e=await i.text().catch(()=>"");throw Error(`HTTP error! status: ${i.status} ${e}`)}return i.text()}useGetAll(){return(0,t.useGenericQuery)({endpoint:this.endpoint,queryKey:[this.endpoint,"getAll"],ncToken:r})}async getAll(){return this.fetchData(this.fullEndpoint)}async getById(e){return this.fetchData(`${this.fullEndpoint}/${e}`)}async create(e){return this.fetchData(this.fullEndpoint,{method:"POST",body:JSON.stringify(e)})}async update(e,t){return this.fetchData(`${this.fullEndpoint}/${e}`,{method:"PUT",body:JSON.stringify(t)})}async delete(e){return await fetch(`${this.fullEndpoint}/${e}`,{method:"DELETE",headers:await this.getHeadersWithToken()}),!0}}class a extends i{constructor(){super("/attribution")}captureTouch(e){return this.fetchData(`${this.fullEndpoint}/touches`,{method:"POST",body:JSON.stringify(e)})}associateCart(e,t){return this.fetchData(`${this.fullEndpoint}/associate-cart`,{method:"POST",body:JSON.stringify({cartGuid:e,touchIds:t})})}recordRecoveryClick(e,t){return this.fetchData(`${this.fullEndpoint}/recovery/${encodeURIComponent(e)}/click`,{method:"POST",body:JSON.stringify(t)})}}e.s(["AttributionService",()=>a],3613)},69035,e=>{"use strict";var t=e.i(7426),r=e.i(8720),i=e.i(35879),a="horizontal",n=["horizontal","vertical"],o=r.forwardRef((e,r)=>{var o;let{decorative:s,orientation:l=a,...u}=e,c=(o=l,n.includes(o))?l:a;return(0,t.jsx)(i.Primitive.div,{"data-orientation":c,...s?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...u,ref:r})});o.displayName="Separator";var s=e.i(47163);let l=r.forwardRef(({className:e,orientation:r="horizontal",decorative:i=!0,...a},n)=>(0,t.jsx)(o,{ref:n,decorative:i,orientation:r,className:(0,s.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",e),...a}));l.displayName=o.displayName,e.s(["Separator",()=>l],69035)},73433,654,e=>{"use strict";let t=(0,e.i(11041).default)("TicketPercent",[["path",{d:"M2 9a3 3 0 1 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 1 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"1l48ns"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]);e.s(["TicketPercent",()=>t],73433);var r=e.i(73866),i=e.i(41434),a=e.i(8720),n=e.i(47163);e.s(["useMinimumOrder",0,()=>{let{store:e}=(0,r.useStore)(),{cart:t}=(0,i.useCartContext)();return(0,a.useMemo)(()=>{let r=e?.minOrderValue||0,i=t?.subtotal||0,a=e?.minOrderQuantity||0,o=t?.items?.reduce((e,t)=>e+t.quantity,0)||0,s=r>0,l=a>0,u=!s||i>=r,c=!l||o>=a,d=u&&c,p=u?0:r-i,f=c?0:a-o,m="";return d?m="Requisitos de compra mÃnima alcanzados.":u||c?u?c||(m=`Faltan ${f} unidades para alcanzar la cantidad m\xednima de ${a}.`):m=`Faltan ${(0,n.formatCurrency)(p)} para alcanzar la compra m\xednima de ${(0,n.formatCurrency)(r)}.`:m=`Faltan ${f} unidades y ${(0,n.formatCurrency)(p)} para la compra m\xednima.`,{isValid:d,minimumAmount:r,currentAmount:i,remainingAmount:p,hasMinimumAmount:s,minimumUnits:a,currentUnits:o,remainingUnits:f,hasMinimumUnits:l,hasMinimumOrder:s||l,message:m}},[e?.minOrderValue,e?.minOrderQuantity,t?.subtotal,t?.items])}],654)},44057,e=>{"use strict";let t=(0,e.i(11041).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],44057)},81355,92635,e=>{"use strict";var t,r=e.i(8720),i=e.i(41434),a=e.i(86388),n=e.i(82561);let o=new Map;function s(){let{cart:e,isLoading:t}=(0,i.useCartContext)(),{activePromotions:s,isLoading:l}=(0,a.usePromotionsContext)(),u=JSON.stringify(e?.items.map(e=>({id:e.id,productId:e.productId,categoryIds:e.productCategories,tags:(0,n.normalizePromotionTags)(e.productTags),quantity:e.quantity,price:e.salePrice||e.price,total:e.total,hasPromotionalPrice
3:e.hasPromotionalPrice}))??[]),c=JSON.stringify(s);return{...(0,r.useMemo)(()=>{if(t||l||!e||0===e.items.length)return{itemPromotions:new Map,totalOriginalPrice:0,totalDiscountedPrice:0,totalPromotionDiscount:0,nextTierSuggestions:[]};let r=JSON.stringify({items:u,promotions:c}),i=o.get(r);if(i)return i;let a=e.items.map(e=>({id:e.id,productId:e.productId,categoryIds:e.productCategories,tags:(0,n.normalizePromotionTags)(e.productTags),hasPromotionalPrice:e.hasPromotionalPrice,quantity:e.quantity,price:e.salePrice||e.price,total:e.total})),d=(0,n.calculatePromotions)(a,s);if(o.set(r,d),o.size>10){let e=o.keys().next().value;void 0!==e&&o.delete(e)}return d},[t,l,u,c]),isLoading:l||t}}e.s(["useCartPromotions",()=>s],81355);var l=((t=l||{})[t.Percentage=1]="Percentage",t[t.Absolute=2]="Absolute",t[t.Shipping=3]="Shipping",t);function u(e,t){if(!t||!e||3===t.type)return!1;let r=t.categoryIds&&t.categoryIds.length>0,i=t.productIds&&t.productIds.length>0;if(!r&&!i)return!0;let a=!!i&&(t.productIds?.includes(e.productId)??!1),n=!!r&&(e.productCategories||[]).some(e=>t.categoryIds?.includes(e)??!1);return a||n}function c(){let{cart:e,couponData:t,isLoading:a,validateExistingCoupon:n}=(0,i.useCartContext)();return(0,r.useEffect)(()=>{e?.couponCode&&n()},[e?.couponCode,e?.subtotal,e?.items.length]),{...(0,r.useMemo)(()=>{if(!e||!t||0===e.items.length)return{discount:0,hasDiscount:!1,applicableItemsCount:0,applicableItemIds:[],hasFreeShippingCoupon:!1,isItemApplicable:()=>!1};let r=3===t.type;if(r)return{discount:0,hasDiscount:!1,applicableItemsCount:0,applicableItemIds:[],hasFreeShippingCoupon:r,isItemApplicable:()=>!1};let i=function(e,t){if(!e||!t||!e.items.length||3===t.type)return 0;let r=0;for(let i of e.items)u(i,t)&&(r+=i.price*i.quantity);if(0===r)return 0;let i=0;switch(t.type){case 1:i=r*((t.value??0)/100);break;case 2:i=Math.min(t.value??0,r);break;default:i=0}return Math.round(100*i)/100}(e,t),a=e.items.filter(e=>u(e,t)),n=new Set(a.map(e=>e.id));return{discount:i,hasDiscount:i>0,applicableItemsCount:a.length,applicableItemIds:Array.from(n),hasFreeShippingCoupon:r,isItemApplicable:e=>n.has(e)}},[e,t]),couponData:t,isLoading:a}}e.s(["useCartCoupons",()=>c],92635)},61195,e=>{"use strict";let t=(0,e.i(11041).default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",()=>t],61195)},76168,e=>{"use strict";var t=e.i(7426),r=e.i(44057),i=e.i(13478);let a=(0,e.i(11041).default)("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);var n=e.i(8720),o=e.i(94237),s=e.i(47163);let l=(0,o.cva)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),u=n.forwardRef(({className:e,variant:r,...i},a)=>(0,t.jsx)("div",{ref:a,role:"alert",className:(0,s.cn)(l({variant:r}),e),...i}));u.displayName="Alert",n.forwardRef(({className:e,...r},i)=>(0,t.jsx)("h5",{ref:i,className:(0,s.cn)("mb-1 font-medium leading-none tracking-tight",e),...r})).displayName="AlertTitle";let c=n.forwardRef(({className:e,...r},i)=>(0,t.jsx)("div",{ref:i,className:(0,s.cn)("text-sm [&_p]:leading-relaxed",e),...r}));c.displayName="AlertDescription";var d=e.i(13268),p=e.i(35879),f="Progress",[m,h]=(0,d.createContextScope)(f),[g,y]=m(f),v=n.forwardRef((e,r)=>{var i,a;let{__scopeProgress:n,value:o=null,max:s,getValueLabel:l=b,...u}=e;(s||0===s)&&!T(s)&&console.error((i=`${s}`,`Invalid prop \`max\` of value \`${i}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let c=T(s)?s:100;null===o||C(o,c)||console.error((a=`${o}`,`Invalid prop \`value\` of value \`${a}\` supplied to \`Progress\`. The \`value\` prop must be: 4 - a positive number 5 - less than the value passed to \`max\` (or 100 if no \`max\` prop is set) 6 - \`null\` or \`undefined\` if the progress is indeterminate. 7 8Defaulting to \`null\`.`));
8let d=C(o,c)?o:null,f=N(d)?l(d,c):void 0;return(0,t.jsx)(g,{scope:n,value:d,max:c,children:(0,t.jsx)(p.Primitive.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":N(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":P(d,c),"data-value":d??void 0,"data-max":c,...u,ref:r})})});v.displayName=f;var x="ProgressIndicator",w=n.forwardRef((e,r)=>{let{__scopeProgress:i,...a}=e,n=y(x,i);return(0,t.jsx)(p.Primitive.div,{"data-state":P(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...a,ref:r})});function b(e,t){return`${Math.round(e/t*100)}%`}function P(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function N(e){return"number"==typeof e}function T(e){return N(e)&&!isNaN(e)&&e>0}function C(e,t){return N(e)&&!isNaN(e)&&e<=t&&e>=0}w.displayName=x;let S=n.forwardRef(({className:e,value:r,...i},a)=>(0,t.jsx)(v,{ref:a,className:(0,s.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...i,children:(0,t.jsx)(w,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));S.displayName=v.displayName;var k=e.i(654);function E({className:e="",showProgress:n=!0,variant:o="default"}){let l=(0,k.useMinimumOrder)();if(!l.hasMinimumOrder)return null;let d=l.hasMinimumAmount?Math.min(l.currentAmount/l.minimumAmount*100,100):100,p=l.hasMinimumUnits?Math.min(l.currentUnits/l.minimumUnits*100,100):100;return"compact"===o?(0,t.jsx)("div",{className:`flex items-center gap-2 text-sm ${e}`,children:l.isValid?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.CheckCircle,{className:"h-4 w-4 text-green-600"}),(0,t.jsx)("span",{className:"text-green-600",children:"Compra mÃnima alcanzada"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.AlertCircle,{className:"h-4 w-4 text-amber-600"}),(0,t.jsx)("span",{className:"text-amber-600",children:l.message})]})}):(0,t.jsx)(u,{className:`${l.isValid?"border-green-200 bg-green-50":"border-amber-200 bg-amber-50"} ${e}`,children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[l.isValid?(0,t.jsx)(i.CheckCircle,{className:"h-5 w-5 text-green-600 mt-0.5"}):(0,t.jsx)(a,{className:"h-5 w-5 text-amber-600 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)(c,{className:l.isValid?"text-green-800":"text-amber-800",children:l.message}),n&&!l.isValid&&(0,t.jsxs)("div",{className:"space-y-3",children:[l.hasMinimumAmount&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Monto: ",(0,s.formatCurrency)(l.currentAmount)," / ",(0,s.formatCurrency)(l.minimumAmount)]}),(0,t.jsx)(S,{value:d,className:"h-2 bg-amber-100"})]}),l.hasMinimumUnits&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Unidades: ",l.currentUnits," / ",l.minimumUnits]}),(0,t.jsx)(S,{value:p,className:"h-2 bg-amber-100"})]})]})]})]})})}e.s(["default",()=>E],76168)},6799,e=>{"use strict";var t=e.i(7426),r=e.i(8720),i=e.i(3104),a=e.i(75453),n=e.i(69485),o=e.i(44424),s=e.i(13268),l=e.i(58562),u=e.i(60348),c=e.i(1058),d=e.i(35879),p=e.i(63261),f=e.i(81610),m=e.i(51677),h=e.i(28199),g="ToastProvider",[y,v,x]=(0,o.createCollection)("Toast"),[w,b]=(0,s.createContextScope)("Toast",[x]),[P,N]=w(g),T=e=>{let{__scopeToast:i,label:a="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:l}=e,[u,c]=r.useState(null),[d,p]=r.useState(0),f=r.useRef(!1),m=r.useRef(!1);return a.trim()||console.error(`Invalid prop \`label\` supplied to \`${g}\`. Expected non-empty \`string\`.`),(0,t.jsx)(y.Provider,{scope:i,children:(0,t.jsx)(P,{scope:i,label:a,duration:n,swipeDirection:o,swipeThreshold:s,toastCount:d,viewport:u,onViewportChange:c,onToastAdd:r.useCallback(()=>p(e=>e+1),[]),onToastRemove:r.useCallback(()=>p(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:l})})};T.displayName=g;var C="ToastViewport",S=["F8"],k="toast.viewportPause",E="toast.viewportResume",j=r.forwardRef((e,i)=>{let{__scopeToast:a,hotkey:o=S,label:s="Notifications ({hotkey})",...u}=e,c=N(C,a),p=v(a),f=r.useRef(null),m=r.useRef(null),h=r.useRef(null),g=r.useRef(null),x=(0,n.useComposedRefs)(i,g,c.onViewportChange),w=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;r.useEffect(()=>{let e=e=>{0!==o.length&&o.every(t=>e[t]||e.code===t)&&g.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),r.useEffect(()=>{let e=f.current,t=g.current;if(b&&e&&t){let r=()=>{if(!c.isClosePausedRef.current){let e=new CustomEvent(k);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},i=()=>
8{if(c.isClosePausedRef.current){let e=new CustomEvent(E);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},a=t=>{e.contains(t.relatedTarget)||i()},n=()=>{e.contains(document.activeElement)||i()};return e.addEventListener("focusin",r),e.addEventListener("focusout",a),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",n),window.addEventListener("blur",r),window.addEventListener("focus",i),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",a),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",n),window.removeEventListener("blur",r),window.removeEventListener("focus",i)}}},[b,c.isClosePausedRef]);let P=r.useCallback(({tabbingDirection:e})=>{let t=p().map(t=>{let r=t.ref.current,i=[r,...function(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}(r)];return"forwards"===e?i:i.reverse()});return("forwards"===e?t.reverse():t).flat()},[p]);return r.useEffect(()=>{let e=g.current;if(e){let t=t=>{let r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){let r=document.activeElement,i=t.shiftKey;if(t.target===e&&i)return void m.current?.focus();let a=P({tabbingDirection:i?"backwards":"forwards"}),n=a.findIndex(e=>e===r);W(a.slice(n+1))?t.preventDefault():i?m.current?.focus():h.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[p,P]),(0,t.jsxs)(l.Branch,{ref:f,role:"region","aria-label":s.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&(0,t.jsx)(I,{ref:m,onFocusFromOutsideViewport:()=>{W(P({tabbingDirection:"forwards"}))}}),(0,t.jsx)(y.Slot,{scope:a,children:(0,t.jsx)(d.Primitive.ol,{tabIndex:-1,...u,ref:x})}),b&&(0,t.jsx)(I,{ref:h,onFocusFromOutsideViewport:()=>{W(P({tabbingDirection:"backwards"}))}})]})});j.displayName=C;var D="ToastFocusProxy",I=r.forwardRef((e,r)=>{let{__scopeToast:i,onFocusFromOutsideViewport:a,...n}=e,o=N(D,i);return(0,t.jsx)(h.VisuallyHidden,{"aria-hidden":!0,tabIndex:0,...n,ref:r,style:{position:"fixed"},onFocus:e=>{let t=e.relatedTarget;o.viewport?.contains(t)||a()}})});I.displayName=D;var R="Toast",M=r.forwardRef((e,r)=>{let{forceMount:i,open:n,defaultOpen:o,onOpenChange:s,...l}=e,[u,d]=(0,f.useControllableState)({prop:n,defaultProp:o??!0,onChange:s,caller:R});return(0,t.jsx)(c.Presence,{present:i||u,children:(0,t.jsx)(O,{open:u,...l,ref:r,onClose:()=>d(!1),onPause:(0,p.useCallbackRef)(e.onPause),onResume:(0,p.useCallbackRef)(e.onResume),onSwipeStart:(0,a.composeEventHandlers)(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:(0,a.composeEventHandlers)(e.onSwipeMove,e=>{let{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:(0,a.composeEventHandlers)(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:(0,a.composeEventHandlers)(e.onSwipeEnd,e=>{let{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),d(!1)})})})});M.displayName=R;var[$,A]=w(R,{onClose(){}}),O=r.forwardRef((e,o)=>{let{__scopeToast:s,type:u="foreground",duration:c,open:f,onClose:m,onEscapeKeyDown:h,onPause:g,onResume:v,onSwipeStart:x,onSwipeMove:w,onSwipeCancel:b,onSwipeEnd:P,...T}=e,C=N(R,s),[S,j]=r.useState(null),D=(0,n.useComposedRefs)(o,e=>j(e)),I=r.useRef(null),M=r.useRef(null),A=c||C.duration,O=r.useRef(0),L=r.useRef(A),z=r.useRef(0),{onToastAdd:_,onToastRemove:V}=C,q=(0,p.useCallbackRef)(()=>
8{S?.contains(document.activeElement)&&C.viewport?.focus(),m()}),H=r.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(z.current),O.current=new Date().getTime(),z.current=window.setTimeout(q,e))},[q]);r.useEffect(()=>{let e=C.viewport;if(e){let t=()=>{H(L.current),v?.()},r=()=>{let e=new Date().getTime()-O.current;L.current=L.current-e,window.clearTimeout(z.current),g?.()};return e.addEventListener(k,r),e.addEventListener(E,t),()=>{e.removeEventListener(k,r),e.removeEventListener(E,t)}}},[C.viewport,A,g,v,H]),r.useEffect(()=>{f&&!C.isClosePausedRef.current&&H(A)},[f,A,C.isClosePausedRef,H]),r.useEffect(()=>(_(),()=>V()),[_,V]);let U=r.useMemo(()=>S?function e(t){let r=[];return Array.from(t.childNodes).forEach(t=>{var i;if(t.nodeType===t.TEXT_NODE&&t.textContent&&r.push(t.textContent),(i=t).nodeType===i.ELEMENT_NODE){let i=t.ariaHidden||t.hidden||"none"===t.style.display,a=""===t.dataset.radixToastAnnounceExclude;if(!i)if(a){let e=t.dataset.radixToastAnnounceAlt;e&&r.push(e)}else r.push(...e(t))}}),r}(S):null,[S]);return C.viewport?(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsx)(F,{__scopeToast:s,role:"status","aria-live":"foreground"===u?"assertive":"polite","aria-atomic":!0,children:U}),(0,t.jsx)($,{scope:s,onClose:q,children:i.createPortal((0,t.jsx)(y.ItemSlot,{scope:s,children:(0,t.jsx)(l.Root,{asChild:!0,onEscapeKeyDown:(0,a.composeEventHandlers)(h,()=>{C.isFocusedToastEscapeKeyDownRef.current||q(),C.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,t.jsx)(d.Primitive.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":f?"open":"closed","data-swipe-direction":C.swipeDirection,...T,ref:D,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:(0,a.composeEventHandlers)(e.onKeyDown,e=>{"Escape"===e.key&&(h?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(C.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:(0,a.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(I.current={x:e.clientX,y:e.clientY})}),onPointerMove:(0,a.composeEventHandlers)(e.onPointerMove,e=>{if(!I.current)return;let t=e.clientX-I.current.x,r=e.clientY-I.current.y,i=!!M.current,a=["left","right"].includes(C.swipeDirection),n=["left","up"].includes(C.swipeDirection)?Math.min:Math.max,o=a?n(0,t):0,s=a?0:n(0,r),l="touch"===e.pointerType?10:2,u={x:o,y:s},c={originalEvent:e,delta:u};i?(M.current=u,B("toast.swipeMove",w,c,{discrete:!1})):K(u,C.swipeDirection,l)?(M.current=u,B("toast.swipeStart",x,c,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(r)>l)&&(I.current=null)}),onPointerUp:(0,a.composeEventHandlers)(e.onPointerUp,e=>{let t=M.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),M.current=null,I.current=null,t){let r=e.currentTarget,i={originalEvent:e,delta:t};K(t,C.swipeDirection,C.swipeThreshold)?B("toast.swipeEnd",P,i,{discrete:!0}):B("toast.swipeCancel",b,i,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),C.viewport)})]}):null}),F=e=>{let{__scopeToast:i,children:a,...n}=e,o=N(R,i),[s,l]=r.useState(!1),[c,d]=r.useState(!1);return function(e=()=>{}){let t=(0,p.useCallbackRef)(e);(0,m.useLayoutEffect)(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>l(!0)),r.useEffect(()=>{let e=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(e)},[]),c?null:(0,t.jsx)(u.Portal,{asChild:!0,children:(0,t.jsx)(h.VisuallyHidden,{...n,children:s&&(0,t.jsxs)(t.Fragment,{children:[o.label," ",a]})})})},L=r.forwardRef((e,r)=>{let{__scopeToast:i,...a}=e;return(0,t.jsx)(d.Primitive.div,{...a,ref:r})});L.displayName="ToastTitle";var z=r.forwardRef((e,r)=>{let{__scopeToast:i,...a}=e;return(0,t.jsx)(d.Primitive.div,{...a,ref:r})});z.displayName="ToastDescription";var _="ToastAction",V=r.forwardRef((e,r)=>{let{altText:i,...a}=e;return i.trim()?(0,t.jsx)(U,{altText:i,asChild:!0,children:(0,t.jsx)(H,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${_}\`. Expected non-empty \`string\`.`),null)});V.displayName=_;var q="ToastClose",H=r.forwardRef((e,r)=>{let{__scopeToast:i,...n}=e,o=A(q,i);return(0,t.jsx)(U,{asChild:!0,children:(0,t.jsx)(d.Primitive.button,{type:"button",...n,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,o.onClose)})})});H.displayName=q;var U=r.forwardRef((e,r)=>{let{__scopeToast:i,altText:a,...n}=e;return(0,t.jsx)(d.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:r})});function B(e,t,r,{discrete:i}){let a=r.originalEvent.currentTarget,n=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),i?(0,d.dispatchDiscreteCustomEvent)(a,n):a.dispatchEvent(n)}var K=(e,t,r=0)=>{let i=Math.abs(e.x),a=Math.abs(e.y),n=i>a;return"left"===t||"right"===t?n&&i>r:!n&&a>r};function W(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var J=e.i(94237),X=e.i(52640),Y=e.i(47163);let Q=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(j,{ref:i,className:(0,Y.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...r}));Q.displayName=j.displayName;let G=(0,J.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Z=r.forwardRef(({className:e,variant:r,...i},a)=>(0,t.jsx)(M,{ref:a,className:(0,Y.cn)(G({variant:r}),e),...i}));Z.displayName=M.displayName;let ee=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(V,{ref:i,className:(0,Y.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...r}));ee.displayName=V.displayName;let et=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(H,{ref:i,className:(0,Y.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground
8/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...r,children:(0,t.jsx)(X.X,{className:"h-4 w-4"})}));et.displayName=H.displayName;let er=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(L,{ref:i,className:(0,Y.cn)("text-sm font-semibold",e),...r}));er.displayName=L.displayName;let ei=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(z,{ref:i,className:(0,Y.cn)("text-sm opacity-90",e),...r}));ei.displayName=z.displayName,e.s(["Toast",()=>Z,"ToastAction",()=>ee,"ToastClose",()=>et,"ToastDescription",()=>ei,"ToastProvider",()=>T,"ToastTitle",()=>er,"ToastViewport",()=>Q],6799)}]);
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.