PageSourceSearch

https://calzadospitillos.com/cdn/shop/t/27/assets/growave-wishlist.js?v=175995094877865860481790330811

js calzadospitillos.com collected 2026-10-04 13:33:13 UTC 4,760 bytes, 2 lines download raw bytes

1const WISHLIST_CHANGE_EVENT="growave:wishlist-change",DRAWER_TRIGGER_SELECTOR="[data-growave-wishlist-drawer]",COUNT_SELECTOR="[data-growave-wishlist-count]",COUNT_LIMIT=99,DRAWER_HOST_SELECTOR=".gw-wishlist-drawer-widget-placeholder",THEME_STYLESHEET_SELECTOR='link[href*="growave-wishlist.css"]',wishlistProductIds=new Set;let wishlistMethods=null,isWatchingWishlist=!1;const drawerStyleSheet=new CSSStyleSheet,styledShadowRoots=new WeakSet,themeStylesheet=document.querySelector(THEME_STYLESHEET_SELECTOR);themeStylesheet instanceof HTMLLinkElement&&fetch(themeStylesheet.href).then(response=>response.text()).then(css=>drawerStyleSheet.replace(css)).catch(()=>{});function styleShadowTree(root){root&&(styledShadowRoots.has(root)||(styledShadowRoots.add(root),root.adoptedStyleSheets=[...root.adoptedStyleSheets,drawerStyleSheet],new MutationObserver(()=>styleNestedShadowRoots(root)).observe(root,{childList:!0,subtree:!0})),styleNestedShadowRoots(root))}function styleNestedShadowRoots(root){for(const element of root.querySelectorAll("*"))element.shadowRoot&&styleShadowTree(element.shadowRoot)}function styleWishlistDrawer(){styleShadowTree(document.querySelector(DRAWER_HOST_SELECTOR)?.shadowRoot)}async function refreshCartBubble(){try{const cart=await(await fetch(`${window.Shopify?.routes?.root??"/"}cart.js`)).json();for(const cartIcon of document.querySelectorAll("cart-icon"))cartIcon.renderCartBubble?.(cart.item_count)}catch{}}const wishlistMethodsReady=new Promise(resolve=>{const onSdkReady=()=>{const{sdk}=window.gw;sdk.on(sdk.common.events.WIDGET_INJECTED,styleWishlistDrawer),sdk.runIfModuleReady(sdk.common.constants.modules.WISHLISTS,()=>{wishlistMethods=sdk.wishlists.methods,sdk.on(sdk.wishlists.events.WISHLIST_ITEM_ADDED_TO_CART,refreshCartBubble),styleWishlistDrawer(),resolve(wishlistMethods)})};window.gw?.sdk?onSdkReady():document.addEventListener("gwSdkReady",onSdkReady,{once:!0})});function updateWishlistCount(){const count=wishlistProductIds.size;for(const bubble of document.querySelectorAll(COUNT_SELECTOR)){const countElement=bubble.querySelector(".cart-bubble__text-count");countElement&&(countElement.textContent=count>99?"99+":String(count)),bubble.toggleAttribute("data-maintain-ratio",count<=99),bubble.hidden=count===0}}function notifyWishlistChange(){updateWishlistCount(),document.dispatchEvent(new CustomEvent(WISHLIST_CHANGE_EVENT))}function setProductInWishlist(productId,isInWishlist){isInWishlist?wishlistProductIds.add(productId):wishlistProductIds.delete(productId),notifyWishlistChange()}function watchWishlist(){isWatchingWishlist||(isWatchingWishlist=!0,wishlistMethodsReady.then(methods=>methods.getWishlistsSharedStateKit()).then(({result})=>{result.query.selectAll().subscribe(wishlists=>{wishlistProductIds.clear();for(const{items=[]}of wishlists??[])for(const{productId}of items)wishlistProductIds.add(String(productId));notifyWishlistChange()})}).catch(()=>{isWatchingWishlist=!1}))}class WishlistButton extends HTMLElement{connectedCallback(){this.button=this.querySelector("button"),!(!(this.button instanceof HTMLButtonElement)||!this.dataset.productId)&&(this.button.addEventListener("click",this.#toggle),document.addEventListener(WISHLIST_CHANGE_EVENT,this.#updateState),this.#updateState(),watchWishlist())}disconnectedCallback(){this.button?.removeEventListener("click",this.#toggle),document.removeEventListener(WISHLIST_CHANGE_EVENT,this.#updateState)}#toggle=async event=>{event.preventDefault();const{productId,variantId}=this.dataset;if(!productId||!wishlistMethods)return;const wasInWishlist=wishlistProductIds.has(productId);setProductInWishlist(productId,!wasInWishlist);try{wasInWishlist?await wishlistMethods.deleteWishlistItem(Number(productId)):await wishlistMethods.createWishlistItem(Number(productId),Number(variantId))}catch{setProductInWishlist(productId,wasInWishlist)}};#updateState=()=>{if(!(this.button instanceof HTMLButtonElement)||!this.dataset.productId)return;const isInWishlist=wishlistProductIds.has(this.dataset.productId);this.button.setAttribute("aria-pressed",String(isInWishlist)),this.toggleAttribute("data-in-wishlist",isInWishlist)}}customElements.get("wishlist-button")||customElements.define("wishlist-button",WishlistButton),document.addEventListener("click",event=>{if(!(event.target instanceof Element)||!wishlistMethods)return;const trigger=event.target.closest(DRAWER_TRIGGER_SELECTOR);trigger instanceof HTMLAnchorElement&&(event.preventDefault(),trigger.closest("header-drawer")?.close?.(),styleWishlistDrawer(),wishlistMethods.openWishlistsDrawer().then(styleWishlistDrawer).catch(()=>{window.location.href=trigger.href}))}),watchWishlist();
2//# sourceMappingURL=/cdn/shop/t/27/assets/growave-wishlist.js.map?v=175995094877865860481790330811

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.