PageSourceSearch

https://lafeemaraboutee.fr/cdn/shop/t/356/assets/__vite-smart-wishlist.c93f348a.js

js lafeemaraboutee.fr collected 2026-09-25 18:44:16 UTC 2,841 bytes, 1 lines download raw bytes

1import{g as f,s as _}from"./__vite-user.f69ca4cb.js";import{g,c as v,a as u,b as W,s as b,d as S}from"./__vite-wishlist.e3310fcb.js";import{S as I}from"./__vite-section-loader.cfabd402.js";import"./__vite-utils.9fac69fd.js";const d=(s,t={})=>new Promise(i=>{const o=`__fetchJsonp${new Date().getTime()}`,c=new URLSearchParams({...t,callback:o,__t:new Date().getTime()}).toString();window[o]=n=>{i(n),delete window[o],document.body.removeChild(e)};const e=document.createElement("script");e.src=`${s}?${c}`,document.body.appendChild(e)}),w="https://cloud.smartwishlist.webmarked.net/v6/savewishlist.php/",L="https://front.smartwishlist.webmarked.net/v6/fetchstoredata.php/",y="https://cloud.smartwishlist.webmarked.net/v6/clearwishlist.php/",m=(s,t)=>!t||t==="null"||t==="undefined"?s:`${s}|${t}`,T=()=>Math.random().toString(36).slice(2,22)+Math.random().toString().slice(2,22),A=()=>{let s=W();return s||(s=T(),b(s),s)},l=()=>({hostname:document.location.hostname,store_id:window.__st&&window.__st.a,customer_id:f().id,wishlist_id:A()}),h=async s=>{if(!s)return;const[t,i]=s.split(/\|/),o={product_id:t,variant_id:i,variant:0,action:"add",...l()};return await d(w,o)},p=async s=>{if(!s)return;const[t,i]=s.split(/\|/),o={product_id:t,variant_id:i,variant:0,action:"remove",...l()};return await d(w,o)},R=async()=>{const{customer_id:s,hostname:t,store_id:i}=l();return(await d(L,{customer_id:s,store_domain:t,store_id:i})).wishlist_items||[]},U=async()=>{await d(y,l())},C=async s=>{const t=await I.load({resource:"",sections:"ajax-handles-from-product_ids",params:{product_ids:s.join(",")},options:{returnNodes:!1,removeSectionWrapper:!0,cache:!1,saveToStorage:!1}}),{items:i}=JSON.parse(t);return i},P=async()=>{const s=[...g()],t=await R(),i=v(t.filter(e=>/\D/.test(e[0])).map(([e,n])=>m(e,n)));i.forEach(e=>{s.includes(e)||(console.log("Smart-wishlist : Adding from server",e),u(e))});const o=t.filter(e=>!/\D/.test(e[0])),c=o.map(e=>e[0]);if(c.length){const e=await C(c),n=o.map(([r,a])=>({toRemove:m(r,a),toAdd:e[r]?m(e[r],a):null}));for(let r=0;r<n.length;r++){const a=n[r];console.log("Smart-wishlist : Replacing obsolete item",a.toRemove),a.toAdd&&!s.includes(a.toAdd)&&(u(a.toAdd),await h(a.toAdd)),await p(a.toRemove)}}for(let e=0;e<s.length;e++){const n=s[e];i.includes(n)||(console.log("Smart-wishlist : Adding item to server",n),await h(n))}};class k extends HTMLElement{connectedCallback(){_(this.whenUser.bind(this),!0),S(this.whenItems.bind(this))}whenUser(t){this.userId=t.id,(t.action=="login"||t.action=="sign_up")&&P()}async whenItems(t){if(this.userId&&!(!t||!t.type))switch(t.type){case"add":for(let i=0;i<t.added_elems.length;i++)await h(t.added_elems[i]);break;case"remove":for(let i=0;i<t.deleted_elems.length;i++)await p(t.deleted_elems[i]);break;case"reset":await U()}}}customElements.define("smart-wishlist",k);

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.