PageSourceSearch

https://comisariatolosandes.com/chunk-JUDLDZPU.js

js comisariatolosandes.com collected 2026-10-06 10:09:01 UTC 15,050 bytes, 1 lines download raw bytes

1import{c as le,d as de,e as pe}from"./chunk-6Y4HOOML.js";import"./chunk-HKVHSUKF.js";import{l as ae,r as se}from"./chunk-GQH7PNMP.js";import"./chunk-257RRTIY.js";import"./chunk-XSPCBE7V.js";import"./chunk-I6UUX3P2.js";import{a as re}from"./chunk-WVS65QFC.js";import"./chunk-ZHAOQ6S5.js";import{a as oe}from"./chunk-STWTQYH2.js";import"./chunk-YUPXRIBG.js";import"./chunk-ACMTX4V5.js";import"./chunk-33VS244C.js";import"./chunk-7ELC3VXT.js";import"./chunk-IN52A2LN.js";import{a as ie}from"./chunk-IFPNODB3.js";import"./chunk-YCWD2U6O.js";import"./chunk-X5C67534.js";import"./chunk-UCRBBNDG.js";import"./chunk-LKVRFTES.js";import"./chunk-L6LRTIFE.js";import"./chunk-KBZVYJ6Y.js";import"./chunk-SGYCFQGT.js";import"./chunk-UV5OOC3V.js";import"./chunk-Y6J7GQ4Z.js";import{a as X,b as Y}from"./chunk-YJBZWSDC.js";import"./chunk-WHXLIIJY.js";import"./chunk-D5QQ56IQ.js";import"./chunk-MCUMSHO5.js";import"./chunk-UALGFQGO.js";import"./chunk-BYXBJQAS.js";import"./chunk-FKNN6BFI.js";import"./chunk-DYSJZLGF.js";import{a as ne}from"./chunk-GPGBUJ3S.js";import"./chunk-K72WOKQA.js";import"./chunk-V3QK7X6E.js";import"./chunk-R5OK7HKN.js";import"./chunk-VN3CQEPZ.js";import"./chunk-ZFM2HJLX.js";import{A as q,b as D,f as z,k as j}from"./chunk-QYEMEQPY.js";import"./chunk-KB6WB4GA.js";import"./chunk-KACWDGJI.js";import"./chunk-5GCI3LNY.js";import"./chunk-JY3B3KEZ.js";import{a as Q}from"./chunk-ZRX254FQ.js";import{a as Z}from"./chunk-KUU42YOX.js";import"./chunk-RJ7OGUY7.js";import"./chunk-DV4UUEJN.js";import"./chunk-PLSQJFA3.js";import"./chunk-PKTJEQ3B.js";import{i as H,k as G}from"./chunk-KB6Y7FPU.js";import"./chunk-XSPTQIFV.js";import"./chunk-CMVDC4NV.js";import"./chunk-4SKDHPB5.js";import"./chunk-A2EIOIT2.js";import"./chunk-JHDOZULW.js";import"./chunk-XPLU7MLV.js";import"./chunk-BBQA5YXX.js";import{a as ee,b as te}from"./chunk-R62TIZY3.js";import"./chunk-S2OXASVG.js";import{c as J,f as K}from"./chunk-MCOOABM4.js";import"./chunk-BGJEFN5N.js";import"./chunk-YQZ6SQIC.js";import{$b as r,Ba as B,Bc as k,Cc as L,Db as F,Dc as R,Fd as $,Ic as y,Jb as _,Ld as A,Nd as U,Oc as m,Od as N,P as M,Pc as u,Qb as C,Ra as V,Sb as w,Tb as O,Wb as p,Zb as b,_b as S,ac as s,bc as v,fc as I,g as T,hc as g,ic as c,ka as f,ob as l,ta as h,ua as x,vc as d,wc as P}from"./chunk-GJNWVSLP.js";import"./chunk-6L7FRRNE.js";var E=()=>[],W=(i,n)=>n.wishlistId;function ue(i,n){if(i&1){let e=I();r(0,"div",3)(1,"mat-icon",11),d(2,"favorite_border"),s(),r(3,"p",12),d(4,"Inicia sesi\xF3n para ver tu lista de deseos"),s(),r(5,"button",13),g("click",function(){h(e);let a=c();return x(a.goToLogin())}),r(6,"span",14)(7,"mat-icon",15),d(8,"login"),s(),d(9," Iniciar sesi\xF3n "),s()()()}}function fe(i,n){i&1&&(r(0,"div",9),v(1,"mat-spinner",25),s())}function _e(i,n){if(i&1&&(r(0,"div",22)(1,"mat-icon",26),d(2,"error_outline"),s(),r(3,"p",27),d(4),s()()),i&2){let e=c(2);l(4),P(e.errorMessage)}}function ge(i,n){i&1&&(r(0,"div",10)(1,"mat-icon",11),d(2,"favorite_border"),s(),r(3,"p",28),d(4,"Tu lista de deseos est\xE1 vac\xEDa"),s(),r(5,"span",29),d(6," Haz clic en el coraz\xF3n de cualquier producto para guardarlo aqu\xED "),s()())}function he(i,n){if(i&1&&v(0,"app-product",30),i&2){let e=n.$implicit;C("product",e.product)("showAvailability",!1)}}function xe(i,n){if(i&1&&(r(0,"div",23),b(1,he,1,2,"app-product",30,W),m(3,"async"),s()),i&2){let e,t=c(2);l(),S((e=u(3,0,t.items$))!==null&&e!==void 0?e:y(2,E))}}function ve(i,n){if(i&1&&v(0,"app-product",31),i&2){let e=n.$implicit;C("listView",!0)("product",e.product)("showAvailability",!1)}}function Ce(i,n){if(i&1&&(r(0,"div",24),b(1,ve,1,3,"app-product",31,W),m(3,"async"),s()),i&2){let e,t=c(2);l(),S((e=u(3,0,t.items$))!==null&&e!==void 0?e:y(2,E))}}function we(i,n){if(i&1){let e=I();r(0,"div",16)(1,"button",13),g("click",function(){h(e);let a=c();return x(a.copyShareUrl())}),r(2,"span",17)(3,"mat-icon",15),d(4,"share"),s(),r(5,"span",18),d(6,"Compartir mi lista"),s()()(),r(7,"div",19)(8,"button",20),g("click",function(){h(e);let a=c();return x(a.viewMode="list")}),r(9,"mat-icon"),d(10,"view_list"),s()(),r(11,"button",21),g("click",function(){h(e);let a=c();return x(a.viewMode="grid")}),r(12,"mat-icon"),d(13,"view_module"),s()()()(),_(14,fe,2,0,"div",9)(15,_e,5,1,"div",22)(16,ge,7,0,"div",10),m(1
17,"async"),_(18,xe,4,3,"div",23),m(19,"async"),_(20,Ce,4,3,"div",24),m(21,"async")}if(i&2){let e,t,a,o=c();l(8),w("view-toggle-btn--active",o.viewMode==="list"),l(3),w("view-toggle-btn--active",o.viewMode==="grid"),l(3),p(o.loading?14:-1),l(),p(!o.loading&&o.errorMessage?15:-1),l(),p(!o.loading&&!o.errorMessage&&((e=u(17,9,o.items$))==null?null:e.length)===0?16:-1),l(2),p(!o.loading&&!o.errorMessage&&((t=(t=u(19,11,o.items$))==null?null:t.length)!==null&&t!==void 0?t:0)>0&&o.viewMode==="grid"?18:-1),l(2),p(!o.loading&&!o.errorMessage&&((a=(a=u(21,13,o.items$))==null?null:a.length)!==null&&a!==void 0?a:0)>0&&o.viewMode==="list"?20:-1)}}function be(i,n){if(i&1&&(r(0,"div",8)(1,"mat-icon",32),d(2,"error_outline"),s(),r(3,"span"),d(4),s()()),i&2){let e=c();l(4),P(e.friendError)}}function Se(i,n){i&1&&(r(0,"div",9),v(1,"mat-spinner",25),s())}function ye(i,n){i&1&&(r(0,"div",10)(1,"mat-icon",11),d(2,"group"),s(),r(3,"p",28),d(4,"Ingresa el enlace de tu amigo"),s(),r(5,"span",33),d(6,' Tu amigo puede compartir su lista desde la pesta\xF1a "Mi lista" '),s()())}function Me(i,n){i&1&&(r(0,"div",22)(1,"mat-icon",11),d(2,"favorite_border"),s(),r(3,"p",28),d(4,"Esta lista est\xE1 vac\xEDa"),s()())}function Ie(i,n){if(i&1&&v(0,"app-product",30),i&2){let e=n.$implicit;C("product",e.product)("showAvailability",!1)}}function Ee(i,n){if(i&1&&(r(0,"div",23),b(1,Ie,1,2,"app-product",30,W),m(3,"async"),s()),i&2){let e,t=c(2);l(),S((e=u(3,0,t.friendItems$))!==null&&e!==void 0?e:y(2,E))}}function We(i,n){if(i&1&&v(0,"app-product",31),i&2){let e=n.$implicit;C("listView",!0)("product",e.product)("showAvailability",!1)}}function Te(i,n){if(i&1&&(r(0,"div",24),b(1,We,1,3,"app-product",31,W),m(3,"async"),s()),i&2){let e,t=c(2);l(),S((e=u(3,0,t.friendItems$))!==null&&e!==void 0?e:y(2,E))}}function Pe(i,n){if(i&1){let e=I();r(0,"div",34)(1,"div",35)(2,"button",20),g("click",function(){h(e);let a=c();return x(a.viewMode="list")}),r(3,"mat-icon"),d(4,"view_list"),s()(),r(5,"button",21),g("click",function(){h(e);let a=c();return x(a.viewMode="grid")}),r(6,"mat-icon"),d(7,"view_module"),s()()()(),_(8,Me,5,0,"div",22),m(9,"async"),_(10,Ee,4,3,"div",23),m(11,"async"),_(12,Te,4,3,"div",24),m(13,"async")}if(i&2){let e,t,a,o=c();l(2),w("view-toggle-btn--active",o.viewMode==="list"),l(3),w("view-toggle-btn--active",o.viewMode==="grid"),l(3),p(((e=u(9,7,o.friendItems$))==null?null:e.length)===0?8:-1),l(2),p(((t=(t=u(11,9,o.friendItems$))==null?null:t.length)!==null&&t!==void 0?t:0)>0&&o.viewMode==="grid"?10:-1),l(2),p(((a=(a=u(13,11,o.friendItems$))==null?null:a.length)!==null&&a!==void 0?a:0)>0&&o.viewMode==="list"?12:-1)}}var ce=class i{className="flex-1 p-0 sm:p-4 lg:p-8";platformId=f(V);destroyRef=f(B);route=f(J);router=f(K);wishlistAPIService=f(ae);wishlistStore=f(ie);customerStore=f(Z);orderConfigStore=f(Q);snackBar=f(re);get isLoggedIn(){let n=this.customerStore.authenticatedUser.value;return!!(n?.token&&n?.user&&n.user.bp_invite!=="1")}selectedTabIndex=0;viewMode="grid";items$=new T([]);loading=!1;errorMessage=null;allApiRows=[];friendUrl="";friendItems$=new T([]);friendLoading=!1;friendError=null;friendLoaded=!1;ngOnInit(){if(N(this.platformId))return;this.wishlistStore.items$.pipe(oe(this.destroyRef)).subscribe(t=>{if(this.allApiRows.length>0){let a=new Set(t.map(o=>o.code));this.items$.next(this.allApiRows.filter(o=>a.has(o.materialCode)))}});let{pickup:n,userId:e}=this.route.snapshot.params;n&&e?(this.selectedTabIndex=1,this.loadFriendByParams(Number(e),n),this.loadMyList()):this.loadMyList()}mapRawItems(n){return(n??[]).map(e=>{let t={};try{t=JSON.parse(e.material_json??"{}")}catch{}return{wishlistId:e.id,materialCode:e.material_code,price:e.price,product:t}})}syncStoreFromRows(n){this.wishlistStore.setItems(n.map(e=>({code:e.materialCode,name:e.product?.name??"",image:e.product?.images?.[0]?.fileName??"",price:e.price,url:e.materialCode,wishlistId:e.wishlistId})))}loadMyList(){let n=this.customerStore.authenticatedUser.value?.user?.id;if(!n)return;let e=this.orderConfigStore.deliveryType.value??"PD";this.loading=!0,this.errorMessage=null,this.wishlistAPIService.getWishlist(n,e).pipe(M(()=>{this.loading=!1})).subscribe({next:t=>{let a=this.mapRawItems(t);
1this.allApiRows=a,this.syncStoreFromRows(a),this.items$.next(a)},error:()=>{this.errorMessage="No se pudo cargar tu lista de deseos."}})}goToLogin(){this.router.navigate(["/iniciar-sesion"],{queryParams:{returnURL:location.href}})}copyShareUrl(){if(!U(this.platformId))return;let n=this.customerStore.authenticatedUser.value?.user?.id,e=this.orderConfigStore.deliveryType.value??"PD",t=`${window.location.origin}/cuenta/lista-deseos/${e}/${n}/`;navigator.clipboard.writeText(t).then(()=>this.snackBar.open("Enlace copiado","\xD7",{panelClass:"success",verticalPosition:"top",duration:3e3}),()=>this.snackBar.open("Error al copiar el enlace","\xD7",{panelClass:"error",verticalPosition:"top",duration:3e3}))}loadFriendByParams(n,e){this.friendLoading=!0,this.friendError=null,this.friendLoaded=!1,this.wishlistAPIService.getWishlist(n,e).pipe(M(()=>{this.friendLoading=!1})).subscribe({next:t=>{this.friendItems$.next(this.mapRawItems(t)),this.friendLoaded=!0},error:()=>{this.friendError="No se pudo cargar la lista de deseos."}})}loadFriendWishlist(){if(this.friendUrl.trim()){this.friendError=null,this.friendLoaded=!1;try{let e=new URL(this.friendUrl.trim()).pathname.split("/").filter(Boolean),t=e.indexOf("lista-deseos");if(t===-1||e.length<t+3){this.friendError="URL inv\xE1lida. Formato esperado: .../lista-deseos/{tipo}/{id}/";return}let a=e[t+1],o=Number(e[t+2]);if(!a||!o||isNaN(o)){this.friendError="No se pudieron extraer los datos de la URL.";return}this.friendLoading=!0,this.wishlistAPIService.getWishlist(o,a).pipe(M(()=>{this.friendLoading=!1})).subscribe({next:me=>{this.friendItems$.next(this.mapRawItems(me)),this.friendLoaded=!0},error:()=>{this.friendError="No se pudo cargar la lista de deseos del amigo."}})}catch{this.friendError="URL inv\xE1lida. Verifica que sea una direcci\xF3n web correcta."}}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-wishlist-section"]],hostVars:2,hostBindings:function(e,t){e&2&&O(t.className)},decls:15,vars:9,consts:[["animationDuration","200ms",1,"wishlist-tabs",3,"selectedIndexChange","selectedIndex"],["label","Mi lista"],[1,"wishlist-tab-body"],[1,"flex","flex-col","items-center","gap-4","py-16","text-center","px-4"],["label","Tus amigos"],[1,"flex","flex-col","sm:flex-row","gap-2","sm:gap-3","mb-4","sm:mb-6"],["placeholder","Pega el enlace de la lista de tu amigo...","type","url",1,"friend-url-input","flex-1",3,"keyup.enter","ngModelChange","ngModel"],["csm-btn","","type","button",3,"click","disabled"],[1,"flex","items-start","gap-2","text-[var(--danger)]","text-sm","mb-4"],[1,"flex","justify-center","py-12"],[1,"flex","flex-col","items-center","gap-3","py-12","text-center","px-4"],[1,"text-[48px]","w-12","h-12","text-gray-200"],[1,"text-sm","sm:text-base","font-semibold","text-gray-600"],["csm-btn","","type","button",3,"click"],[1,"flex","items-center","gap-[6px]","text-sm"],[2,"font-size","18px","width","18px","height","18px","line-height","18px"],[1,"flex","items-center","justify-between","gap-2","mb-3","sm:mb-4"],[1,"flex","items-center","gap-[6px]"],[1,"hidden","sm:inline","text-sm"],[1,"flex","items-center","gap-1","flex-shrink-0"],["aria-label","Vista de lista","matRipple","","type","button",1,"view-toggle-btn",3,"click"],["aria-label","Vista de cuadr\xEDcula","matRipple","","type","button",1,"view-toggle-btn",3,"click"],[1,"flex","flex-col","items-center","gap-3","py-12","text-center"],[1,"grid","grid-cols-2","sm:grid-cols-3","lg:grid-cols-4","gap-2","sm:gap-4"],[1,"flex","flex-col","gap-2","sm:gap-3"],["diameter","40","ngSkipHydration",""],[1,"text-[40px]","w-10","h-10","text-gray-300"],[1,"text-sm","text-gray-500"],[1,"text-sm","sm:text-base","font-semibold","text-gray-500"],[1,"text-xs","sm:text-sm","text-gray-400","max-w-[240px]"],[3,"product","showAvailability"],[3,"listView","product","showAvailability"],[1,"text-[16px]","w-4","h-4","flex-shrink-0","mt-[2px]"],[1,"text-xs","sm:text-sm","text-gray-400","max-w-[260px]"],[1,"flex","justify-end","mb-3","sm:mb-4"],[1,"flex","items-center","gap-1"]],template:function(e,t){e&1&&(r(0,"mat-tab-group",0),R("selectedIndexChange",function(o){return L(t.selectedTabIndex,o)||(t.selectedTabIndex=o),o}),r(1,"mat-tab",1)(2,"div",2),_(3,ue,10,0,"div",3)(4,we,22,15),s()(),r(5,"mat-tab",4)(6,"div",2)(7,"div",5)(8,"input",6),g("keyup.enter",function(){return t.loadFriendWishlist()}),R("ngModelChange",function(o){return L(t.friendUrl,o)||(t.friendUrl=o),o}),s(),r(9,"button",7),g("click",function(){return t.loadFriendWishlist()}),d(10," Ver lista "),s()(),_(11,be,5,1,"div",8)(12,Se,2,0,"div",9)(13,ye,7,0,"div",10)(14,Pe,14,13),s()()()),e&2&&(k("selectedIndex",t.selectedTabIndex),l(3),p(t.isLoggedIn?-1:3),l(),p(t.isLoggedIn?4:-1),l(4),k("ngModel",t.friendUrl),l(),C("disabled",!t.friendUrl.trim()),l(2),p(t.friendError?11:-1),l(),p(t.friendLoading?12:-1),l(),p(!t.friendLoading&&!t.friendError&&!t.friendLoaded?13:-1),l(),p(!t.friendLoading&&t.friendLoaded?14:-1))},dependencies:[A,$,q,D,z,j,te,ee,Y,X,pe,le,de,G,H,ne,se],styles:["[_nghost-%COMP%]{display:block}.wishlist-tab-body[_ngcontent-%COMP%]{padding:12px 8px 16px}@media (min-width: 640px){.wishlist-tab-body[_ngcontent-%COMP%]{padding:16px 4px 24px}}.wishlist-tabs[_ngcontent-%COMP%]     .mat-mdc-tab-body-content{overflow-x:hidden}.view-toggle-btn[_ngcontent-%COMP%]{cursor:pointer;width:36px;height:36px;border-radius:50%;border:none;background:none;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;transition:background .15s ease}@media (min-width: 640px){.view-toggle-btn[_ngcontent-%COMP%]{width:40px;height:40px}}.view-toggle-btn[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:#6b7280;font-size:20px;width:20px;height:20px;transition:color .15s ease}.view-toggle-btn--active[_ngcontent-%COMP%]{background:var(--primary-light, #ffe1cb)}.view-toggle-btn--active[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:var(--primary)}.friend-url-input[_ngcontent-%COMP%]{height:40px;padding:0 12px;border:1px solid var(--product-border-color, #d1d5db);border-radius:8px;font-size:13px;color:var(--mat-sys-on-surface, #222);background:#fff;outline:none;transition:border-color .15s ease;min-width:0}@media (min-width: 640px){.friend-url-input[_ngcontent-%COMP%]{height:42px;font-size:14px;padding:0 14px}}.friend-url-input[_ngcontent-%COMP%]:focus{border-color:var(--primary)}.friend-url-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af;font-size:12px}@media (min-width: 640px){.friend-url-input[_ngcontent-%COMP%]::placeholder{font-size:14px}}"]})};export{ce as WishlistSectionComponent};

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.