PageSourceSearch

https://kinrosscashmere.com/cdn/shop/t/23/assets/size-chart-modal.js?v=82621145523841479161788272154

js kinrosscashmere.com collected 2026-10-06 23:59:09 UTC 3,374 bytes, 2 lines download raw bytes

1(()=>{const SELECTORS={content:".product-popup-modal__content-info",modal:".product-popup-modal--size-chart",table:".product-popup-modal__content-info table"},getCellText=cell=>cell.textContent.replace(/\s+/g," ").trim(),normalizeText=value=>value.replace(/\u00a0/g," ").replace(/\s+/g," ").trim().toLowerCase(),createElement=(tagName,className,textContent)=>{const element=document.createElement(tagName);return element.className=className,textContent&&(element.textContent=textContent),element},enhanceTable=(table,tableIndex)=>{if(table.dataset.sizeChartEnhanced==="true")return;const rows=Array.from(table.rows),headerRow=table.tHead?.rows[0]||rows[0],headers=headerRow?Array.from(headerRow.cells,getCellText):[],measurementRows=rows.filter(row=>row!==headerRow&&row.cells.length>1);if(headers.length<2||measurementRows.length<1||headers.some(header=>!header))return;table.dataset.sizeChartEnhanced="true",table.classList.add("size-chart-modal__source-table");const picker=createElement("section","size-chart-mobile-picker");picker.setAttribute("aria-label",table.getAttribute("aria-label")||headers[0]);const label=createElement("p","size-chart-mobile-picker__label",headers[0]),options=createElement("div","size-chart-mobile-picker__options"),panel=createElement("div","size-chart-mobile-picker__panel"),panelId=`SizeChartPanel-${tableIndex}`;panel.id=panelId,panel.setAttribute("aria-live","polite");const updatePanel=(selectedRow,selectedButton)=>{options.querySelectorAll("button").forEach(button=>{button.setAttribute("aria-pressed",String(button===selectedButton))}),panel.replaceChildren();const cells=Array.from(selectedRow.cells);panel.appendChild(createElement("p","size-chart-mobile-picker__selected-size",getCellText(cells[0])));const measurements=createElement("dl","size-chart-mobile-picker__measurements");cells.slice(1).forEach((cell,cellIndex)=>{const measurement=createElement("div","size-chart-mobile-picker__measurement");measurement.appendChild(createElement("dt","",headers[cellIndex+1])),measurement.appendChild(createElement("dd","",getCellText(cell))),measurements.appendChild(measurement)}),panel.appendChild(measurements)};measurementRows.forEach((row,rowIndex)=>{const button=createElement("button","size-chart-mobile-picker__option",getCellText(row.cells[0]));button.type="button",button.setAttribute("aria-controls",panelId),button.setAttribute("aria-pressed",String(rowIndex===0)),button.addEventListener("click",()=>updatePanel(row,button)),options.appendChild(button)}),picker.append(label,options,panel),table.insertAdjacentElement("afterend",picker),updatePanel(measurementRows[0],options.querySelector("button"))},markSectionHeadings=modal=>{modal.querySelectorAll(`${SELECTORS.content} h2, ${SELECTORS.content} h3, ${SELECTORS.content} h4, ${SELECTORS.content} p`).forEach(element=>{normalizeText(element.textContent)==="how to measure"&&element.classList.add("size-chart-modal__section-heading")})},initialize=(root=document)=>{root.querySelectorAll(SELECTORS.modal).forEach((modal,modalIndex)=>{markSectionHeadings(modal),modal.querySelectorAll(SELECTORS.table).forEach((table,tableIndex)=>{enhanceTable(table,`${modalIndex}-${tableIndex}`)})})};initialize(),document.addEventListener("shopify:section:load",()=>initialize())})();
2//# sourceMappingURL=/cdn/shop/t/23/assets/size-chart-modal.js.map?v=82621145523841479161788272154

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.