1import{a as te}from"./chunk-TSYHOV3S.js";import{a as oe}from"./chunk-UQSLP2DL.js";import{a as V}from"./chunk-DHPRCWEB.js";import{F as z,ba as U,f as T,i as j,l as R,o as L,p as N,s as G}from"./chunk-KTNK7AE4.js";import"./chunk-HJKTJ6DS.js";import{b as k,c as v}from"./chunk-BUENOTLL.js";import"./chunk-QOZAOZPZ.js";import{b as I}from"./chunk-ICASKQ42.js";import{a as m,h as E,i as F}from"./chunk-FY4VNLWN.js";import"./chunk-UYKR5T7O.js";import"./chunk-XUEVMHFQ.js";import{$ as D,q as w}from"./chunk-MEUDJAM7.js";import{$b as M,Ka as C,Nb as b,Ob as P,Rb as y,Sb as S,Tb as g,Ub as c,Vb as i,Wb as A,bd as O,dc as u,fa as n,fb as l,fc as p,la as _,ma as h,tc as f,ub as x,ya as s}from"./chunk-HJVSYVYZ.js";import"./chunk-LSIHGRHO.js";function W(e){if(e.length===0)return null;let o=e[0].path,t=e[1]?.path??"";if(e.length===2){let a=t.includes(" ")||/%20/i.test(t),r=/[A-Za-z]/.test(t),d=/\d/.test(t),H=/^\d+$/.test(t),Z=t.includes("-");if(H&&t.length>=6||r&&d&&!a&&!Z||a&&r)return null}if(e.length>=2){let a=e.slice(1).map(r=>r.path);return{consumed:e,posParams:{categoria:new m(o,{}),filtros:new m(a.join("/"),{})}}}return{consumed:e,posParams:{categoria:new m(o,{})}}}var q=new Set(["anillos","matrimonio","aretes","dijes","cadenas","pulseras","collares","relojes","regalos","bebe","el","ella","abuela","amigos","pareja","ninos","sale","flores","suenos","forza","venezia","preciosaslaboratorio","suenos-de-amor"]),$=e=>{let o=n(E),t=e.params.categoria?.toLowerCase();return!t||!q.has(t)?(o.navigate(["/"]),!1):!0};var me=[{matcher:W,canActivate:[$],data:{manejaScrollPropio:!0},loadComponent:()=>import("./chunk-ZKGZNQI2.js").then(e=>e.CategoriaPage)},{path:":categoria/:articulo",loadComponent:()=>import("./chunk-MIIQ3VAK.js").then(e=>e.DetallePage)}];var J=(e,o)=>o.idProducto;function K(e,o){e&1&&A(0,"app-page-loading")}function Q(e,o){e&1&&(c(0,"div",2)(1,"h2",4),f(2,"A\xFAn no tienes favoritos"),i(),c(3,"a",5),f(4,"Explorar cat\xE1logo"),i()())}function X(e,o){if(e&1){let t=M();c(0,"app-tarjeta-producto",7),u("agregarAlCarrito",function(r){_(t);let d=p(2);return h(d.onAgregarAlCarrito(r))}),i()}if(e&2){let t=o.$implicit,a=p(2);g("producto",t)("variante",a.disenoCuadrado?"landing":"catalogo")}}function Y(e,o){if(e&1&&(c(0,"div",3),y(1,X,1,2,"app-tarjeta-producto",6,J),i()),e&2){let t=p();l(),S(t.productos())}}var B=class e{platformId=n(C);cdr=n(O);catalogService=n(V);analytics=n(L);authStore=n(I);carritoStore=n(T);favoritosStore=n(j);disenoCuadrado=n(D,{optional:!0})??!1;productos=s([]);cargando=s(!0);orden=s("DESC");ngOnInit(){w(this.platformId)&&this.cargar()}onOrdenCambiado(o){this.orden.set(o),this.cargar()}onAgregarAlCarrito({producto:o,talla:t}){let a={idProducto:o.idProducto,cantidad:1,imagen:k(o),descWeb:o.descripcionWeb,tallaId:t?.idTalla??v,descTalla:t?.talla??String(v),habilitado:!0};this.carritoStore.addItem(a,{correoElectronico:this.authStore.usuario()?.correoElectronico});let r=N(o,{cantidad:1,talla:t?.talla});this.analytics.trackEcommerce("add_to_cart",G([r],{value:r.price}))}cargar(){let o=this.favoritosStore.items(),a=(o.length>0?o:this.favoritosStore.favoritosInvitado()).map(r=>({idProducto:r.idProducto,peso:r.peso,esGia:r.esGia,referenciaProveedor:r.referenciaProveedor}));if(a.length===0){this.productos.set([]),this.cargando.set(!1);return}this.cargando.set(!0),this.catalogService.obtenerProductosFavoritos(a,this.orden()).subscribe({next:({productos:r})=>{this.productos.set(r),this.cargando.set(!1),this.cdr.markForCheck()},error:()=>{this.cargando.set(!1),this.cdr.markForCheck()}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=x({type:e,selectors:[["app-favoritos-page"]],decls:5,vars:2,consts:[[1,"fav"],["categoriaSlug","favoritos","nombreCategoria","Favoritos",3,"ordenCambiado","orden"],[1,"fav__vacio"],[1,"fav__grid"],[1,"fav__vacio-titulo"],["routerLink","/",1,"fav__vacio-cta"],[3,"producto","variante"],[3,"agregarAlCarrito","producto","variante"]],template:function(t,a){t&1&&(c(0,"section",0)(1,"app-menu-catalogo",1),u("ordenCambiado",function(d){return a.onOrdenCambiado(d)}),i(),b(2,K,1,0,"app-page-loading")(3,Q,5,0,"div",2)(4,Y,3,0,"div",3),i()),t&2&&(l(),g("orden",a.orden()),l(),P(a.cargando()?2:a.productos().length===0?3:4))},dependencies:[R,U,z,F],styles:[".fav[_ngcontent-%COMP%]{min-height:60vh;padding-bottom:4rem;background:var(--colorWeb)}@media(min-width:500px){.fav[_ngcontent-%COMP%]{padding-top:3px}}.fav__spinner-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:5rem 0}.fav__spinner[_ngcontent-%COMP%]{display:inline-block;width:40px;height:40px;border:3px solid #e8e8e8;border-top-color:var(--color-primario, #8b7355);border-radius:50%;animation:_ngcontent-%COMP%_fav-spin .7s linear infinite}.fav__vacio[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem;margin:12px 12px 45px;padding:3rem 1rem;border:1px solid #E0E0E0;box-shadow:0 4px 4px #00000040;border-radius:20px;background:#fff;text-align:center}.fav__vacio-titulo[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:400;color:#333;margin:0}.fav__vacio-cta[_ngcontent-%COMP%]{display:inline-block;padding:12px 32px;background:var(--color1, #21211D);color:#fff;border-radius:25px;font-size:17px;font-weight:500;text-decoration:none;transition:background .2s}.fav__vacio-cta[_ngcontent-%COMP%]:hover{background:var(--color-dorado, #E3C55E)}.fav__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,1fr);gap:17px;margin:12px 12px 45px;width:98%}@keyframes _ngcontent-%COMP%_fav-spin{to{transform:rotate(360deg)}}@media(min-width:1701px){.fav__grid[_ngcontent-%COMP%]{padding:0 3%}}@media(max-width:1200px){.fav__grid[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)}}@media(max-width:1000px){.fav__grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)}}@media(max-width:750px){.fav__grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr);width:96%}}@media(max-width:500px){.fav__grid[_ngcontent-%COMP%]{width:auto;margin:1rem}}"],changeDetection:0})};export{V as CatalogService,te as CatalogoStore,oe as DetalleStore,B as FavoritosPage,me as catalogRoutes};
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.