PageSourceSearch

https://7oclock.de/cdn/shop/t/32/assets/section-rendering.js?v=78236524892828808931788986860

js 7oclock.de collected 2026-09-26 01:03:17 UTC 13,266 bytes, 4 lines download raw bytes

1document.addEventListener("DOMContentLoaded",()=>{const filterWrapper=document.querySelectorAll('[li-render="filter-wrapper"]'),recWrapper=document.querySelectorAll('[li-render="recommendations-wrapper"]'),customWrapper=document.querySelectorAll('[li-render="custom-wrapper"]'),searchWrapper=document.querySelectorAll('[li-render="predictive-search-wrapper"]');let filterQuery=new URLSearchParams(window.location.search),abortController=new AbortController;const abortSignal=abortController.signal,createSearchQuery=wrapper=>{const paramMap={"li-render-rt":"resources[type]","li-render-rl":"resources[limit]","li-render-rls":"resources[limit_scope]","li-render-roup":"resources[options][unavailable_products]","li-render-rof":"resources[options][fields]"};let searchQuery=new URLSearchParams;return Object.entries(paramMap).forEach(([attr,param])=>{const value=wrapper.getAttribute(attr);value!==null&&searchQuery.append(param,value)}),searchQuery},debounce=(callback,wait)=>{let timeoutId=null;return(...args)=>{window.clearTimeout(timeoutId),timeoutId=window.setTimeout(()=>{callback(...args)},wait)}},getSectionId=element=>{const realId=(element.closest("section")?.id||element.closest(".shopify-section")?.id)?.match(/shopify-section-(.+)/)||"";return realId===""&&console.warn("[liquify][getSectionId] Could not get section id"),realId[1]},setCheckboxFilter=()=>{document.querySelectorAll('[li-render="filter"]').forEach(element=>{const param=element.getAttribute("li-render-param-name"),value=element.getAttribute("li-render-value"),customCheckbox=element.parentElement.querySelector("div");!param||!value||(filterQuery.has(param,value)?(element.checked=!0,customCheckbox&&customCheckbox.classList.add("w--redirected-checked")):(element.checked=!1,customCheckbox&&customCheckbox.classList.remove("w--redirected-checked")))})},setPriceFilter=()=>{filterQuery.has("filter.v.price.gte")&&document.querySelectorAll('[li-render="price-min"]').forEach(element=>{element.value=filterQuery.get("filter.v.price.gte")}),filterQuery.has("filter.v.price.lte")&&document.querySelectorAll('[li-render="price-max"]').forEach(element=>{element.value=filterQuery.get("filter.v.price.lte")})},renderSection=async(fetchUrl,wrapper,target=null,type="")=>{try{abortController&&abortController.abort(),abortController=new AbortController;const response=await fetch(fetchUrl,{abortSignal});if(!response.ok)throw new Error(`[liquify][renderSection] Error fetching section, response status: ${response.status}`);let newHtml;try{newHtml=await response.text()}catch{throw new Error("[liquify][renderSection] Failed to parse response text.")}const parser=new DOMParser;let newDocument;try{newDocument=parser.parseFromString(newHtml,"text/html")}catch{throw new Error("[liquify][renderSection] Failed to parse HTML content.")}const newElements=target?newDocument.querySelectorAll(target):newDocument.querySelectorAll(wrapper);if(newElements.length>0){const currentElements=target?document.querySelectorAll(target):document.querySelectorAll(wrapper);currentElements.length===newElements.length?(currentElements.forEach((currentElement,index)=>{currentElement.innerHTML=newElements[index].innerHTML}),newDocument.querySelectorAll("style[data-section-stylesheet]").forEach(styleEl=>{const cssText=styleEl.textContent||"";!cssText.trim()||Array.from(document.querySelectorAll("style[data-section-stylesheet]")).some(existing=>existing.textContent===cssText)||document.head.appendChild(styleEl.cloneNode(!0))}),target||initializeFilters(),setCheckboxFilter(),setPriceFilter(),target&&(newDocument.querySelectorAll("[li-render-custom-source]").forEach(element=>{const value=element.value,customName=element.getAttribute("li-render-custom-source"),customTarget=document.querySelectorAll(`[li-render-custom-target="${customName}"]`);if(!value||customTarget.length===0){console.warn('[liquify][renderSection] If you want to show the li-render-custom value, you have to add a value to the element and also create a target and mark it with li-render-custom-target="TARGET_NAME". The target name must match the li-render-custom name.');return}customTarget.forEach(target2=>{target2.textContent=value})}),newDocument.querySelectorAll('[li-render="filter"]').forEach(element=>{const param=element.getAttribute("li-render-param-name"),value=element.getAttribute("li-render-value"),countSource=element.getAttribute("li-render-count"),countNumber=parseInt(countSource,10);if(!param||!value||!countSource){console.log(`[liquify][renderSection] If you want to show the counts, please add the following attributes to the li-render="filter" element: 
2                  li-render-count="{{ filter_value.count }}", li-render-value="{{ filter_value.value }}", li-render-param-name="{{ filter_value.param_name }}".`);return}document.querySelectorAll(`[li-render-param-name="${param}"][li-render-value="${value}"]`).forEach(filterElement=>{const countTarget=filterElement.parentElement.querySelector('[li-render="count-value"]');countNumber===0?filterElement.classList.add("is-disabled"):filterElement.classList.remove("is-disabled"),countTarget&&(countTarget.textContent=countNumber)})})),document.dispatchEvent(new CustomEvent("liquify:sections-rendered",{bubbles:!0,cancelable:!1})),type&&document.dispatchEvent(new CustomEvent(`liquify:${type}-rendered`,{bubbles:!0,cancelable:!1}))):console.warn("[liquify][renderSection] Mismatch in element count between current and new content.")}}catch(error){error.name==="AbortError"?console.log("[liquify][renderSection] Request was aborted."):console.error(error.message)}};
2searchWrapper.forEach(wrapper=>{const input=wrapper.querySelector('[li-render="predictive-search-input"]'),sectionId=getSectionId(wrapper),searchQuery=createSearchQuery(wrapper);input&&input.addEventListener("input",debounce(()=>{const searchTerm=input.value.trim();let searchUrl=window.Shopify.routes.root+"search/suggest";searchQuery.size===0?searchUrl+=`?q=${searchTerm}&section_id=${sectionId}`:searchUrl+=`?q=${searchTerm}&section_id=${sectionId}&${searchQuery}`,searchTerm&&renderSection(searchUrl,'[li-render="predictive-search-wrapper"]','[li-render="predictive-search-target"]',"predictive-search"),console.log("[liquify][searchWrapper] Search path:",searchUrl)},300))});const initializeFilters=()=>{filterWrapper.forEach(wrapper=>{const submitButtons=wrapper.querySelectorAll('[li-render="submit-button"]'),filterTarget=wrapper.querySelector('[li-render="filter-target"]'),sectionId=getSectionId(wrapper),handleTarget=completeFilterQuery2=>{console.log("[liquify][filterWrapper] Filter path:",completeFilterQuery2),history.replaceState(null,"",window.location.pathname+(filterQuery.size>0?"?"+filterQuery:"")),filterTarget?renderSection(completeFilterQuery2,'[li-render="filter-wrapper"]','[li-render="filter-target"]',"filter"):renderSection(completeFilterQuery2,'[li-render="filter-wrapper"]',void 0,"filter")},getQueryParam=(param="",value="",render=!1,uniqueValue=!1,priceRemove=!1)=>{if(filterQuery.has(param)&&uniqueValue===!0&&priceRemove===!1?filterQuery.set(param,value):filterQuery.has(param,value)&&uniqueValue===!1||priceRemove===!0?value===""?filterQuery.delete(param):filterQuery.delete(param,value):filterQuery.append(param,value),filterQuery.has("page")&&filterQuery.delete("page"),completeFilterQuery=filterQuery.size>0?"?section_id="+sectionId+"&"+filterQuery:"",submitButtons.length===0||render===!0){handleTarget(completeFilterQuery);return}};submitButtons.length>0&&submitButtons.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault(),handleTarget(completeFilterQuery)})}),wrapper.querySelectorAll('[li-render="filter"]').forEach(element=>{element.addEventListener("change",e=>{const param=element.getAttribute("li-render-param-name"),value=element.getAttribute("li-render-value");getQueryParam(param,value)})}),wrapper.querySelectorAll('[li-render="sort-select"]').forEach(element=>{element.addEventListener("change",e=>{getQueryParam("sort_by",element.value,!0,!0)})}),wrapper.querySelectorAll('[li-render="sort-radio"]').forEach(element=>{element.addEventListener("change",e=>{const value=element.getAttribute("li-render-value");getQueryParam("sort_by",value,!0,!0)})}),wrapper.querySelectorAll('[li-render="filter-remove"]').forEach(element=>{element.addEventListener("click",e=>{const removeFilter=element.getAttribute("li-render-value");renderSection(removeFilter,'[li-render="filter-wrapper"]',void 0,"filter"),history.replaceState(null,"",removeFilter)})}),wrapper.querySelectorAll('[li-render="filter-search"]').forEach(element=>{const form=element.closest("form"),searchQuery=createSearchQuery(wrapper);let inputValue=element.value;element.addEventListener("input",debounce(()=>{inputValue=element.value,window.location.pathname==="/search"&&getQueryParam("q",inputValue,void 0,!0),console.log("[liquify][filterWrapper] Search input value:",inputValue)},300)),inputValue!==""&&window.location.pathname!=="/search"&&form&&form.addEventListener("submit",e=>{e.preventDefault(),form.action=`/search?${searchQuery}&q=${inputValue}`,form.submit()})}),wrapper.querySelectorAll('[li-render="clear-all"]').forEach(element=>{element.addEventListener("click",e=>{const value=element.getAttribute("li-render-value");if(!value){console.warn(`[liquify][filterWrapper] Unable to clear all filters because of one missing attribute.
3                Please add the attribute li-render-value="{{ routes.search_url }}" on search pages or li-render-value="{{ collection.url }}" on collection pages to the li-render="clear-all" button`);return}filterQuery=new URLSearchParams,history.replaceState(null,"",window.location.pathname),renderSection(value,'[li-render="filter-wrapper"]',void 0,"filter")})}),wrapper.querySelectorAll('[li-render="price-min"]').forEach(element=>{element.addEventListener("blur",()=>{if(element.value.length===0){getQueryParam("filter.v.price.gte",element.value,!1,!0,!0);return}getQueryParam("filter.v.price.gte",element.value,!1,!0)})}),wrapper.querySelectorAll('[li-render="price-max"]').forEach(element=>{element.addEventListener("blur",()=>{if(element.value.length===0){getQueryParam("filter.v.price.lte",element.value,!1,!0,!0);return}getQueryParam("filter.v.price.lte",element.value,!1,!0)})})})};recWrapper.forEach(wrapper=>{const path=wrapper.getAttribute("li-render-path"),sectionId=getSectionId(wrapper)||"",productId=wrapper.getAttribute("li-render-product-id"),limit=wrapper.getAttribute("li-render-limit")||4,intent=wrapper.getAttribute("li-render-intent")||"related";if(sectionId===""){console.warn("[liquify][recWrapper] Unable to render product recommendations because of missing section ID");return}if(path===""||!path){console.warn('[liquify][recWrapper] Unable to render product recommendations because of missing path. Please add the attribute li-render-path="{{ routes.product_recommendations_url }}" to the li-render="recommendations-wrapper" element');return}if(productId===""||!productId){console.warn('[liquify][recWrapper] Unable to render product recommendations because of missing product ID. Please add the attribute li-render-product-id="{{ product.id }}" to the li-render="recommendations-wrapper" element');return}let recQuery=new URLSearchParams;recQuery.append("section_id",sectionId),recQuery.append("product_id",productId),recQuery.append("limit",limit),recQuery.append("intent",intent);const fetchUrl=`${path}?${recQuery}`;renderSection(fetchUrl,'[li-render="recommendations-wrapper"]',void 0,"recommendations"),console.log("[liquify][recWrapper] Recommendations Path:",fetchUrl)}),customWrapper.forEach(wrapper=>{const target=wrapper.querySelector('[li-render="custom-target"]');let currentSearchParams=new URLSearchParams(window.location.search);const initializeCustomTrigger=()=>{wrapper.querySelectorAll("[li-render-trigger]").forEach(element=>{const triggerEvent=element.getAttribute("li-render-trigger"),value=element.getAttribute("li-render-value");let newSerchParams=new URLSearchParams(value);element.addEventListener(triggerEvent,e=>{if(console.log("[liquify][customWrapper] Custom Path:",value),target?renderSection(value,'[li-render="custom-wrapper"]','[li-render="custom-target"]',"custom"):renderSection(value,'[li-render="custom-wrapper"]',void 0,"custom"),newSerchParams.has("variant")){const variantId=newSerchParams.get("variant");currentSearchParams.set("variant",variantId),history.replaceState(null,null,"?"+currentSearchParams.toString())}})})};wrapper.getAttribute("li-render-re-init")&&document.addEventListener("liquify:custom-rendered",e=>{initializeCustomTrigger()}),initializeCustomTrigger()}),initializeFilters(),setPriceFilter(),setCheckboxFilter()}),document.addEventListener("liquify:filter-rendered",()=>{console.log("[liquify][renderSection] Filter event fired")}),document.addEventListener("liquify:custom-rendered",()=>{console.log("[liquify][renderSection] Custom event fired")}),document.addEventListener("liquify:predictive-search-rendered",()=>{console.log("[liquify][renderSection] Predictive search event fired")}),document.addEventListener("liquify:recommendations-rendered",()=>{console.log("[liquify][renderSection] Recommendations event fired")});
4//# sourceMappingURL=/cdn/shop/t/32/assets/section-rendering.js.map?v=78236524892828808931788986860

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.