PageSourceSearch

https://www.rowenta.es/chunk-WJBY4T3K.js

js rowenta.es collected 2026-09-25 19:45:30 UTC 3,980 bytes, 1 lines download raw bytes

1import{n as k}from"./chunk-AVFLSLTV.js";import{m as O,ra as u}from"./chunk-DJPGZFBY.js";import{c as T}from"./chunk-DIPFGUEX.js";import{u as R,y as w}from"./chunk-IOHXACAF.js";import{Ja as $}from"./chunk-TVUIQ6T2.js";import{db as j,fb as P}from"./chunk-2THTJ2V7.js";import{k as A}from"./chunk-XVZXOWV7.js";import{Aa as C,C as l,Ea as c,K as y,d as g,da as d,e as S,n as f,qa as m,ra as E,v as h}from"./chunk-VDJNVHIP.js";import{a as v}from"./chunk-NAIKXHWT.js";var Y=(()=>{class p{constructor(e,t,s,i,n,o,r,a){this.configService=e,this.http=t,this.authService=s,this.userAccountService=i,this.routingService=n,this.currentProductService=o,this.cartService=r,this.productListComponentService=a,this.sidStorageKey="prudsys_sid",this.services={},this.servicesStatus={},this.destroy$=new g}getRecommendations(e){let t=this.servicesStatus[e];return t?!t.loading&&Date.now()-(t.loadedAt??0)>2e3&&(this.servicesStatus[e].loading=!0,this.loadRecommendations(e)):(this.servicesStatus[e]={loading:!0,loadedAt:0},this.services[e]=new S(void 0),this.loadRecommendations(e)),this.services[e].pipe(y(s=>s!==void 0))}sendProductViewEvent(e){let t={pid:e};return this.sendEvent("productview",t)}sendCategoryViewEvent(e){let t={cid:e};return this.sendEvent("categoryview",t)}sendBasketEvent(e,t){let s={pids:e.join(","),quantities:t.join(",")};return this.sendEvent("basket",s)}sendOrderEvent(e){let t=[],s=[],i=[];e.forEach(o=>{let r=o.product?.code,a=o.quantity??0,b=o.totalPrice?.value??0;r&&(t.push(r),s.push(a),i.push(b.toFixed(2)))});let n={pids:t.join(","),quantities:s.join(","),totals:i.join(",")};return this.sendEvent("order",n)}sendSearchTermEvent(e){let t={searchterm:e};return this.sendEvent("search",t)}isEnabled(){let e=this.configService.config;return!!e.prudsys?.host&&!!e.prudsys?.reid}sendEvent(e,t){let s=this.configService.config;return this.authService.isUserLoggedIn().pipe(m(n=>n?this.userAccountService.get():f(void 0)),d()).pipe(m(n=>{let o=this.getCurrentSessionId(),r=`${s.prudsys?.host}/rde_server/res/${s.prudsys?.reid}/plugins/exec/prudsys/prudsys/event/${e}`,a=v({},t);return a.sid=o,a.tracking=String(this.isTrackingAllowed()),n!==void 0&&(a.userid=n.uid??""),this.http.get(r,{params:a})}))}loadRecommendations(e){let t=this.configService.config,s=this.authService.isUserLoggedIn().pipe(m(i=>i?this.userAccountService.get():f(void 0)),d());l([s,this.getRecommendationsServiceParams(e)]).pipe(m(([i,n])=>{let o=`${t.prudsys?.host}/rde_server/res/${t.prudsys?.reid}/plugins/exec/prudsys/prudsys/core/recommendation/${e}`,r=v({},n);return r.sid=this.getCurrentSessionId(),r.tracking=String(this.isTrackingAllowed()),i!==void 0&&(r.userid=i.uid??""),this.http.get(o,{params:r})}),E(this.destroy$)).subscribe(i=>{this.services[e].next(i),this.servicesStatus[e].loading=!1,this.servicesStatus[e].loadedAt=Date.now()})}getRecommendationsServiceParams(e){switch(e){case u.CATEGORY_ENTRY.valueOf():case u.CATEGORY_OVERVIEW.valueOf():return this.routingService.getRouterState().pipe(h(t=>({cid:t.state.params.categoryCode??""})),d());case u.PRODUCT_DETAIL.valueOf():return this.currentProductService.getProduct().pipe(h(t=>({pid:t?.code??"",cid:t?.categories?.[0]?.code??""})),d());case u.BASKET.valueOf():return this.cartService.getEntries().pipe(h(t=>({currentBasket:t.map(i=>i.product?.code).filter(i=>!!i).join(",")})),d());case u.SEARCH.valueOf():return this.productListComponentService.model$.pipe(h(t=>({searchterm:t.freeTextSearch??""})),d());default:return f({})}}getCurrentSessionId(){if(this.sid===void 0){let e=typeof sessionStorage<"u"?sessionStorage:void 0,t=e?.getItem(this.sidStorageKey);t?this.sid=t:(this.sid=$(),e?.setItem(this.sidStorageKey,this.sid))}return this.sid}isTrackingAllowed(){return!0}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(t){return new(t||p)(c(O),c(A),c(P),c(T),c(j),c(R),c(k),c(w))}}static{this.\u0275prov=C({token:p,factory:p.\u0275fac,providedIn:"root"})}}return p})();export{Y as a};

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.