PageSourceSearch

https://www.waterdrop.com/cdn/shop/t/30/assets/product-media-grid-C-aFyHGd.js

js waterdrop.com collected 2026-10-01 10:28:49 UTC 1,761 bytes, 1 lines download raw bytes

1import r from"./custom-html-element-Cddc4xm8.js";import{T as s,P as d,i as n,s as o,c as h}from"./product-media-helper-CZWIhHGR.js";import{D as l}from"./customer-portal-R96TstYq.js";import{l as c}from"./logger-pamvzmAu.js";import"./event-zU-Y6ZHH.js";import"./exports-NHIMKJG4.js";import"./image-DkAYJs43.js";class m extends r{constructor(){super(),this.productMediaWrapper=this.closest(".js-product-media-wrapper"),this._variant=null,this.templateRenderer=new s}connectedCallback(){this._loadMediaData(),this._initializeListeners(),this.hasOneVariant||this._render()}get hasOneVariant(){return this.hasAttribute("data-only-variant")}_loadMediaData(){var e,t;try{const a=(t=(e=this.productMediaWrapper)==null?void 0:e.querySelector("script.js-media-data"))==null?void 0:t.textContent.trim(),i=l(a,"@@","|","%%");this._productMediaHelper=new d(i)}catch(a){c.error("Failed to load or parse product media data",a)}}_initializeListeners(){const e=this.getAttribute("form-id");e&&this.rootDelegate.on("variant:changed",`form#${e}`,this._handleVariantChange.bind(this)),n(this,this._handleLazyImage.bind(this)),o(this.delegate,this._handleLazyImage.bind(this))}_handleVariantChange(e){const{detail:t}=e,{variant:a}=t;this._variant=a,this._render()}_handleLazyImage(e){e.target.classList.remove("opacity-0")}_render(){if(!this._productMediaHelper)return;const e=this._productMediaHelper.getVariantMedia(this._variant);!this.hasOneVariant&&e.length===0&&this._variant===null&&e.push(h());const t=this._productMediaHelper.sharedMedia,a=[...e,...t];this.innerHTML="";const i=this._productMediaHelper.renderMediaItems(a,this.templateRenderer);this.insertAdjacentHTML("beforeend",i)}}customElements.get("product-media-grid")||customElements.define("product-media-grid",m);

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.